/**
 * Fabrika Bire Product Picker - Corona Style Layout
 */

/* ============================================
   SECTION WRAPPER
   ============================================ */
.fb-picker-section {
    background-color: #1a365d;
    padding: 40px 20px 50px;
    position: relative;
}

/* ============================================
   MAIN CONTAINER (White Box)
   ============================================ */
.fb-picker-container {
    max-width: 1000px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* ============================================
   HEADER: Label + Dropdown
   ============================================ */
.fb-picker-header {
    margin-bottom: 25px;
}

.fb-picker-label {
    display: block;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #1a365d;
    text-decoration: underline;
    margin-bottom: 12px;
}

.fb-picker-dropdown {
    width: 100%;
    padding: 15px 45px 15px 20px;
    font-size: 16px;
    font-family: inherit;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #ffffff;
    color: #1a365d;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a365d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    transition: border-color 0.2s ease;
}

.fb-picker-dropdown:hover,
.fb-picker-dropdown:focus {
    border-color: #d4a934;
    outline: none;
}

/* ============================================
   TWO-COLUMN LAYOUT (Corona Style)
   ============================================ */
.fb-picker-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 10px;
}

/* ============================================
   LEFT SIDE: Product Cards (vertical list)
   ============================================ */
.fb-products-grid {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    min-height: 200px;
}

/* Custom scrollbar */
.fb-products-grid::-webkit-scrollbar {
    width: 6px;
}

.fb-products-grid::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.fb-products-grid::-webkit-scrollbar-thumb {
    background: #d4a934;
    border-radius: 3px;
}

.fb-product-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #ffffff;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    border-left: 3px solid transparent;
    padding: 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
    box-sizing: border-box;
}

.fb-product-card:last-child {
    border-bottom: none;
}

.fb-product-card:hover {
    background: #fafafa;
    border-left-color: #e0e0e0;
}

.fb-product-card.active {
    border-left-color: #d4a934;
    background: #fffef5;
}

.fb-product-card-image {
    width: 55px;
    height: 70px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fb-product-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.fb-placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #d4a934 0%, #f5d77a 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: #1a365d;
    text-align: center;
    padding: 5px;
}

.fb-product-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a365d;
    line-height: 1.3;
}

.fb-product-card-price {
    font-size: 13px;
    font-weight: 700;
    color: #d4a934;
    margin-top: 4px;
}

.fb-no-products {
    text-align: center;
    color: #666;
    padding: 30px;
    width: 100%;
}

/* ============================================
   RIGHT SIDE: Selected Product Display
   ============================================ */
.fb-selected-product {
    flex: 1;
    text-align: center;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fb-selected-image {
    max-width: 280px;
    height: 280px;
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fb-selected-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.fb-no-image {
    width: 150px;
    height: 200px;
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.fb-selected-image img.loading {
    opacity: 0.5;
}

.fb-selected-title {
    font-family: 'Oswald', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: #1a365d;
    margin: 0 0 10px;
    line-height: 1.3;
}

.fb-selected-price {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #d4a934;
    margin-bottom: 15px;
}

.fb-selected-price del {
    color: #999;
    font-size: 18px;
    margin-right: 10px;
}

.fb-selected-price ins {
    text-decoration: none;
}

.fb-selected-description {
    font-size: 14px;
    color: #666666;
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}

/* ============================================
   ADD TO CART BUTTON
   ============================================ */
.fb-add-to-cart-wrapper {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
}

/* Desktop button (inside selected product) - visible by default */
.fb-add-to-cart-desktop {
    display: block;
    border-top: 1px solid #e8e8e8;
}

/* Mobile button (below layout) - hidden by default */
.fb-add-to-cart-mobile {
    display: none;
    border-top: 1px solid #f0f0f0;
}

.fb-add-to-cart-btn {
    display: inline-block;
    padding: 15px 50px;
    background: #1a365d;
    color: #ffffff;
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.25s ease;
    border: 4px solid #fdc438;
}

.fb-add-to-cart-btn:hover {
    background: #d4a934;
    border-color: #d4a934;
    color: #1a365d;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.fb-add-to-cart-btn:active {
    transform: translateY(0);
}

.fb-add-to-cart-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ============================================
   LOADING STATE
   ============================================ */
.fb-products-grid.loading {
    position: relative;
    min-height: 150px;
}

.fb-products-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #d4a934;
    border-radius: 50%;
    animation: fb-spin 0.8s linear infinite;
}

@keyframes fb-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ============================================
   CART NOTIFICATION BAR
   ============================================ */
.fb-cart-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #d4a934;
    color: #1a365d;
    padding: 0;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fb-cart-notification.visible {
    transform: translateY(0);
}

.fb-cart-notification-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 14px 20px;
    flex: 1;
    flex-wrap: wrap;
}

.fb-cart-notification-text {
    font-family: 'Oswald', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.fb-cart-notification-link {
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #1a365d;
    text-decoration: underline;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.fb-cart-notification-link:hover {
    color: #ffffff;
}

.fb-cart-notification-close {
    background: none;
    border: none;
    color: #1a365d;
    font-size: 18px;
    cursor: pointer;
    padding: 14px 18px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.fb-cart-notification-close:hover {
    opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    /* Force overflow visible on Elementor parent wrappers */
    .elementor-widget-shortcode .elementor-widget-container,
    .elementor-shortcode,
    .elementor-widget-shortcode {
        overflow: visible !important;
    }
    
    .fb-picker-layout {
        flex-direction: column;
        overflow: visible;
        align-items: stretch;
        gap: 15px;
    }
    
    .fb-products-grid {
        flex: none !important;
        width: 100% !important;
        max-height: none !important;
        display: block !important;
        overflow: visible !important;
        overflow-y: visible !important;
        overflow-x: visible !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        font-size: 0; /* remove inline-block whitespace */
    }
    
    .fb-product-card {
        display: inline-block !important;
        vertical-align: top;
        width: calc(50% - 8px) !important;
        max-width: calc(50% - 8px) !important;
        flex: none !important;
        margin: 0 4px 10px 4px;
        text-align: center;
        border: 2px solid transparent !important;
        border-left: 2px solid transparent !important;
        border-bottom: 2px solid transparent !important;
        border-radius: 8px !important;
        padding: 12px 10px !important;
        box-sizing: border-box !important;
        background: #fafaf5 !important;
        font-size: 14px; /* restore font-size from parent's 0 */
        cursor: pointer;
    }
    
    .fb-product-card.active {
        border-color: #d4a934 !important;
        background: #fffef5 !important;
    }
    
    .fb-product-card:hover {
        border-color: #e0e0e0 !important;
    }
    
    .fb-product-card:last-child {
        border-bottom: 2px solid transparent !important;
    }
    
    .fb-product-card-image {
        display: block;
        margin: 0 auto 8px;
    }
    
    .fb-product-card-name {
        display: block;
    }
    
    .fb-product-card-price {
        display: block;
    }
    
    .fb-picker-container {
        padding: 20px;
        overflow: visible;
    }
    
    .fb-selected-product {
        min-height: auto;
        padding: 15px;
    }
    
    .fb-selected-image {
        height: 200px;
    }
    
    /* Swap buttons: hide desktop, show mobile */
    .fb-add-to-cart-desktop {
        display: none;
    }
    
    .fb-add-to-cart-mobile {
        display: block;
    }
    
    .fb-add-to-cart-btn {
        width: 100%;
        padding: 15px 30px;
    }
}

@media (max-width: 480px) {
    .fb-picker-section {
        padding: 40px 15px 60px;
    }
    
    .fb-product-card {
        width: calc(50% - 6px) !important;
        max-width: calc(50% - 6px) !important;
        margin: 0 3px 8px 3px;
    }
    
    .fb-selected-image {
        height: 180px;
    }
    
    .fb-cart-notification-inner {
        padding: 12px 15px;
        gap: 8px;
    }
    
    .fb-cart-notification-text {
        font-size: 13px;
    }
}
