/* =========================================
   ElectWatch Premium Boutique Styles
   Theme: Dark Luxury (Black/Gold/Glass)
   ========================================= */

:root {
    --ew-bg-dark: #f5f5f5;
    /* Light Gray Background */
    --ew-bg-card: #ffffff;
    /* White Card */
    --ew-gold-primary: #f68b1e;
    /* Jumia Orange */
    --ew-gold-hover: #e07e1b;
    --ew-text-white: #282828;
    /* Dark Text */
    --ew-text-gray: #757575;
    --ew-glass-bg: #ffffff;
    --ew-glass-border: #e0e0e0;
    --ew-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    --ew-font-family: 'Roboto', 'Open Sans', sans-serif;
}


.ew-boutique-container {
    font-family: var(--ew-font-family);
    background-color: var(--ew-bg-dark);
    color: var(--ew-text-white);
    padding: 40px 20px;
    min-height: 600px;
    width: 100%;
    box-sizing: border-box;
}

/* ================= HEADER SECTION ================= */
.ew-boutique-header {
    max-width: 1200px;
    margin: 0 auto 40px auto;
    text-align: center;
}

/* --- Search Bar & Icons --- */
.ew-search-container {
    max-width: 700px;
    margin: 0;
    position: relative;
    flex: 1;
}

.ew-search-wrapper {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: 1px solid var(--ew-glass-border);
    border-radius: 50px;
    padding: 10px 20px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ew-search-wrapper:focus-within {
    border-color: var(--ew-gold-primary);
    box-shadow: 0 0 0 2px rgba(246, 139, 30, 0.2);
    background: #fff;
}

.ew-search-icon {
    font-size: 20px;
    color: #888;
    margin-right: 12px;
}

#ew-boutique-search {
    background: transparent;
    border: none;
    color: var(--ew-text-white);
    font-size: 16px;
    width: 100%;
    outline: none;
    font-weight: 400;
}

#ew-boutique-search::placeholder {
    color: #999;
}

.ew-search-actions {
    display: flex;
    gap: 10px;
    padding-left: 10px;
}

.ew-search-action-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    transition: color 0.3s;
}

.ew-search-action-btn:hover {
    color: var(--ew-gold-primary);
}

.ew-icon-btn {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.ew-icon-btn:hover {
    background: #fdfdfd;
    border-color: var(--ew-gold-primary);
    color: var(--ew-gold-primary);
}

/* --- Category Menu --- */
.ew-category-menu {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    padding: 5px 0;
}

.ew-category-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    justify-content: center;
    /* Center if few items, otherwise scroll */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE */
}

/* Hide scrollbar */
.ew-category-scroll::-webkit-scrollbar {
    display: none;
}

.ew-category-pill {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    color: var(--ew-text-white);
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.ew-category-pill:hover {
    border-color: var(--ew-gold-primary);
    color: var(--ew-gold-primary);
}

.ew-category-pill.active {
    background: var(--ew-gold-primary);
    border-color: var(--ew-gold-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(246, 139, 30, 0.3);
}

/* ================= GRID SECTION ================= */
.ew-boutique-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Product Card --- */
.ew-product-card {
    background: var(--ew-bg-card);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.ew-product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--ew-shadow);
    border-color: rgba(212, 175, 55, 0.3);
    z-index: 2;
}

/* Image Wrapper */
.ew-card-image-wrapper {
    position: relative;
    height: 250px;
    background: #ffffff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ew-card-image-wrapper img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    transition: transform 0.5s ease;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

.ew-product-card:hover .ew-card-image-wrapper img {
    transform: scale(1.1);
}

/* Badge */
.ew-card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, var(--ew-gold-primary), #B8860B);
    color: #000;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* Overlay Actions (Quick View) */
.ew-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    display: flex;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.ew-product-card:hover .ew-card-overlay {
    opacity: 1;
    transform: translateY(0);
}

.ew-quick-view-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--ew-text-white);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.ew-quick-view-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Details Section */
.ew-card-details {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #ffffff;
}

.ew-card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: var(--ew-text-white) !important;
    line-height: 1.4;
    text-shadow: none;
}

.ew-card-desc {
    color: var(--ew-text-gray);
    font-size: 13px;
    margin: 4px 0 12px 0;
    line-height: 1.4;
}

.ew-card-cat {
    display: block;
    font-size: 13px;
    color: var(--ew-text-gray);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ew-card-price-row {
    margin-bottom: 20px;
}

.ew-prices {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.ew-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--ew-gold-primary);
}

.ew-old-price {
    font-size: 14px;
    color: var(--ew-text-gray);
    text-decoration: line-through;
    opacity: 0.6;
}

/* Action Buttons Container */
.ew-action-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
}

/* Buy Button Base */
.ew-buy-btn {
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Order Button (Primary) */
.ew-btn-order {
    flex-grow: 1;
    background: var(--ew-gold-primary);
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(246, 139, 30, 0.2);
}

.ew-btn-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(246, 139, 30, 0.3);
    filter: brightness(1.05);
}

/* Cart Button (Icon only) - Green Theme */
.ew-btn-cart {
    width: 50px;
    /* Square-ish */
    flex-shrink: 0;
    background: #ffffff;
    color: #10B981;
    border: 1px solid #10B981;
}

.ew-btn-cart:hover {
    background: #10B981;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.ew-buy-btn:active {
    transform: translateY(1px);
}

/* --- No Results --- */
.ew-no-results {
    text-align: center;
    padding: 60px;
    color: var(--ew-text-gray);
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.ew-reset-search-btn {
    background: transparent;
    border: 1px solid var(--ew-gold-primary);
    color: var(--ew-gold-primary);
    padding: 10px 20px;
    border-radius: 30px;
    margin-top: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.ew-reset-search-btn:hover {
    background: var(--ew-gold-primary);
    color: #000;
}

/* Responsive */
@media (max-width: 768px) {
    .ew-boutique-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Force 2 columns */
        gap: 12px;
        /* Reduce gap */
    }

    .ew-category-scroll {
        justify-content: flex-start;
        /* Allow scroll from left */
        padding-left: 10px;
        -webkit-overflow-scrolling: touch;
        /* Smooth scroll on iOS */
    }

    /* Smaller product card for mobile 2-col */
    .ew-product-card {
        border-radius: 12px;
        /* Smaller radius */
        padding: 0;
        /* Remove padding for edge-to-edge feel */
    }

    .ew-card-image-wrapper {
        height: 160px;
        /* Reduced height */
        margin: 5px;
        border-radius: 8px;
    }

    .ew-card-details {
        padding: 10px;
        /* Tighter spacing */
    }

    .ew-card-title {
        font-size: 14px;
        /* Smaller title */
        margin-bottom: 4px;
        min-height: 2.8em;
        /* 2 lines preserved */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        /* Standard property */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .ew-card-cat {
        font-size: 10px;
        margin-bottom: 8px;
    }

    .ew-price {
        font-size: 16px;
    }

    .ew-old-price {
        font-size: 12px;
    }

    .ew-buy-btn {
        padding: 10px;
        font-size: 10px;
    }

    .ew-category-pill {
        padding: 8px 16px;
        font-size: 13px;
    }

    /* Hide cart button on very small screens to save space? Or adjust */
    /* .ew-btn-cart { width: 36px; } */
    /* REMOVED: Managed by new mobile rule below */
}

/* =========================================
   SMARTPHONE SPECIFIC (App-Like Layout) < 480px
   ========================================= */
@media (max-width: 480px) {

    /* 1. Layout & Spacing */
    .ew-boutique-container {
        padding: 10px 5px;
        /* Minimal padding */
        background: #f5f5f5;
    }

    .ew-boutique-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        /* Force 2 cols */
        gap: 8px;
        /* Tight gap like Jumia */
        padding: 0 4px;
    }

    .ew-product-card {
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        border: none;
        /* Cleaner look */
        background: #fff;
        display: flex;
        flex-direction: column;
        height: 100%;
        /* Uniform height */
    }

    /* 2. Image Area (Square/Aspect Ratio) */
    .ew-card-image-wrapper {
        height: 140px;
        /* Fixed concise height */
        padding: 10px;
        background: #fff;
        border-radius: 8px 8px 0 0;
        margin: 0;
    }

    .ew-card-image-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    /* Badge adjustment */
    .ew-card-badge {
        top: 8px;
        left: 8px;
        /* Jumia often puts badges left */
        right: auto;
        padding: 2px 6px;
        font-size: 10px;
        border-radius: 4px;
    }

    /* 3. Floating Cart Button (Top Right on Image) - Green Theme */
    .ew-btn-cart {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #fff !important;
        border: 1px solid #10B981;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #10B981;
        padding: 0;
    }

    .ew-btn-cart .dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
        line-height: 16px;
    }

    /* 4. Content Area */
    .ew-card-details {
        padding: 8px 10px 12px 10px;
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        justify-content: space-between;
        background: #fff;
    }

    .ew-card-header {
        margin-bottom: 5px;
    }

    /* Title */
    .ew-card-title {
        font-size: 13px;
        font-weight: 400;
        /* Regular weight like typical app lists */
        margin-bottom: 4px;
        line-height: 1.3;
        height: 2.6em;
        /* 2 lines strict */
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        color: #282828 !important;
    }

    /* Category hidden on mobile for cleaner look? Or keep minimal */
    .ew-card-cat {
        display: none;
    }

    .ew-card-desc {
        display: none;
        /* Hide excerpt on mobile */
    }

    .ew-card-price-row {
        margin-bottom: 8px;
    }

    /* Price */
    .ew-price {
        font-size: 16px;
        font-weight: 700;
        color: var(--ew-gold-primary);
        display: block;
    }

    .ew-old-price {
        font-size: 11px;
        color: #757575;
        text-decoration: line-through;
        margin-left: 4px;
    }

    /* 5. Actions (Full Width Order Button) */
    .ew-action-buttons {
        margin-top: auto;
        flex-direction: column;
        gap: 0;
    }

    .ew-btn-order {
        width: 100%;
        padding: 8px 0;
        font-size: 13px;
        font-weight: 600;
        border-radius: 4px;
        /* Slightly squarer for mobile buttons */
        height: 36px;
        background: var(--ew-gold-primary);
        box-shadow: none;
        /* Flat design */
        text-transform: uppercase;
    }

    /* Remove hover effects on touch */
    .ew-product-card:hover {
        transform: none;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
}

/* --- CRITICAL FIX FOR MODAL VISIBILITY --- */
#ew-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2147483647 !important;
    /* Max value */
    display: block;
}

.ew-modal-overlay {
    z-index: 2147483647 !important;
}

.ew-order-modal {
    z-index: 2147483647 !important;
    position: relative;
}