/*
 Theme Name:   Showmusic Child
 Template:     storefront
*/


/* =========================================
   MOBILE LAYOUT FIXES (Must be at the end)
   ========================================= */
@media (max-width: 768px) {
    /* 1. Force containers to use full width on mobile */
    .col-full,
    .mermoz-global-container,
    .mermoz-wrapper,
    .site-header .col-full,
    .site-content {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding-left: 10px !important; /* Small padding for breathing room */
        padding-right: 10px !important;
    }

    /* 2. Fix the Mobile Header container specifically */
    .mobile-mermoz-header {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
    }
}

body {
    background-color: #f4f4f4; /* Light grey background from reference */
}

/* Overwrite Storefront's default col-full to use your viewport width */
.col-full, 
.mermoz-global-container {
    max-width: 85dvw;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
}

/* Ensure the header content also aligns with the 85dvw */
.site-header .col-full {
    max-width: 85dvw;
}

/* =========================================
   2. HEADER STYLING (Dark Theme)
   ========================================= */
.site-header {
    background-color: #05051a; /* Dark navy/black from reference */
    border-bottom: none;
    padding-top: 10px;
    padding-bottom: 10px;
    margin-bottom: 0; /* Remove gap before hero */
}

/* Text & Links in Header */
.site-header a, 
.site-header h1, 
.site-header .site-title a {
    color: #ffffff !important;
}

/* Search Bar customization */
.site-search .widget_product_search form input[type=search], 
.site-search .widget_product_search form input[type=text] {
    background-color: #ffffff;
    border-radius: 4px; /* Slight roundness */
    color: #333;
}

/* Cart & Account Icons */
.site-header-cart .cart-contents, 
.site-header ul.menu li a {
    color: #ffffff !important;
}

/* =========================================
   3. HERO COMPONENT STYLES
   ========================================= */
.mermoz-hero-section {
    width: 100%;
    margin-bottom: 40px; /* Space below hero */
    margin-top: 20px;
}

.mermoz-wrapper {
    width: 100%;
    position: relative;
}

/* Swiper Sizing - Crucial for images to show */
.hero-swiper {
    width: 100%;
    height: auto;
    border-radius: 8px; /* Rounded corners like reference */
    overflow: hidden;
}

.hero-swiper img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

/* Swiper Navigation Arrows (Make them white/visible) */
.swiper-button-next, 
.swiper-button-prev {
    color: #fff;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.swiper-pagination-bullet-active {
    background: #fff;
}


/* =========================================
   CAROUSEL HEADER
   ========================================= */
.mermoz-product-carousel-section {
    margin-bottom: 50px;
}

.carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 5px;
}

.carousel-title {
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #111;
    margin: 0;
}

.view-more-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    text-decoration: none;
}

/* =========================================
   PRODUCT CARD (White Box Style)
   ========================================= */
.product-card {
    height: auto;
    display: flex;
}

.product-card-inner {
    background: #fff;
    border: 1px solid #eee; /* Subtle border */
    border-radius: 8px;     /* Rounded corners */
    padding: 15px;
    width: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
}

.product-card-inner:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

/* Image Wrapper */
.product-image-wrapper {
    position: relative;
    display: flex;             /* Changed to flex to center the image perfectly */
    justify-content: center;   /* Center horizontally */
    align-items: center;       /* Center vertically */
    margin-bottom: 15px;
    overflow: hidden;
    height: 200px;             /* Keep your fixed height */
    background-color: #fff;    /* Ensure background is white so "letterboxing" looks invisible */
}

.product-image-wrapper img {
    height: 100%;              /* specific height */
    width: 100%;               /* specific width */
    object-fit: contain;       /* Ensures the WHOLE image is visible */
    margin: 0 auto;
}

/* Sale Badge */
.sale-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: #0044cc; /* Blue badge */
    color: #fff;
    font-size: 1.35rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 10;
}

/* Price */
.product-info-compact .product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 5px;
    line-height: 1.1;
}

.product-info-compact .product-price del {
    font-size: 0.9rem;
    color: #999;
    font-weight: normal;
    display: block; /* Put old price on new line or inline */
}

/* Title */
.product-title {
    font-size: 0.95rem;
    line-height: 1.4;
    font-weight: 400;
    margin-bottom: 10px;
    min-height: 2.8em; /* Force 2 lines of height to align cards */
}

.product-title a {
    color: #666; /* Dark grey like reference */
    text-decoration: none;
}

/* Shipping Tag */
.shipping-tag {
    display: inline-block;
    background-color: #0044cc;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    margin-bottom: 15px;
}

/* =========================================
   ADD TO CART BUTTON (Outline Style)
   ========================================= */
.product-actions-wrapper {
    margin-top: auto; /* Pushes button to bottom */
}

.main-add-btn {
    display: block;
    width: 100%;
    text-align: center;
    background-color: transparent;
    border: 1px solid #000; /* Black border */
    color: #000 !important;
    padding: 10px 0;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    text-transform: none; /* Storefront forces uppercase sometimes */
}

.main-add-btn:hover {
    background-color: #000;
    color: #fff !important;
    text-decoration: none;
}

/* Hide default storefront button styles if they conflict */
ul.products li.product .button {
    margin-top: 0;
}


/* =========================================
   CATEGORIES SECTION
   ========================================= */
.mermoz-categories-section {
    margin-bottom: 50px;
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 30px;
    color: #05051a; /* Dark Navy */
}

/* Grid Layout */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Force 4 equal columns */
    gap: 20px;
    margin-bottom: 30px; /* Space between grid and banner */
}

/* Category Items */
.cat-item {
    display: block;
    border-radius: 12px; /* Rounded corners like reference */
    overflow: hidden;
    transition: transform 0.3s ease;
    /* Optional: Adds a background color if your PNGs are transparent */
    background-color: #f9f9f9; 
}

.cat-item:hover {
    transform: translateY(-5px); /* Slight lift on hover */
}

.cat-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

/* =========================================
   PROMO BANNER (Underneath)
   ========================================= */
.mermoz-promo-banner {
    width: 100%;
    border-radius: 0; 
    overflow: hidden;
    margin-top: 20px;
}

.mermoz-promo-banner img {
    width: 100%;
    height: auto;
    display: block;
    /* Ensure it fills the width of the 85dvw container */
}

/* =========================================
   RESPONSIVE (Mobile)
   ========================================= */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablet */
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: 1fr; /* 1 column on mobile */
    }
    
    .section-title {
        font-size: 1.4rem;
    }
}


/* =========================================
   INFO BANNER SECTION
   ========================================= */
.mermoz-info-banner-section {
    margin-top: 60px;    /* Space above the banner */
    margin-bottom: 60px; /* Space below the banner */
}

.info-banner-img {
    width: 100%;
    height: auto;
    display: block;
    /* Optional: Add rounded corners to match the rest of the site */
    border-radius: 12px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* Subtle shadow for depth */
}

/* =========================================
   1. HEADER RESET & LAYOUT
   ========================================= */
.custom-mermoz-header, 
.custom-menu-bar,
.custom-top-bar {
    width: 100%;
    box-sizing: border-box;
}

.mermoz-wrapper {
    max-width: 85dvw;
    margin: 0 auto;
    width: 100%;
}

/* =========================================
   2. TOP BAR (Blue)
   ========================================= */
.custom-top-bar {
    background-color: #0000cc; /* Electric Blue */
    color: #fff;
    text-align: center;
    padding: 8px 0;
    font-size: 0.85rem;
    font-weight: 600;
}

.site-content {
    min-height: 100dvh !important;
    padding-top: 10px !important;
}

/* =========================================
   3. MAIN HEADER (Black)
   ========================================= */
.custom-mermoz-header {
    background-color: #05051a; /* Dark Black/Navy */
}

.header-flex-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.custom-logo-area {
    max-width: 40dvw;
}

/* Logo */
.custom-logo-area img {
    display: block;
    max-height: 50px;
}

/* Search Bar (Wide & White) */
.custom-search-area {
    flex-grow: 1; /* Takes available space */
    max-width: 800px;
}

.mermoz-search-form {
    display: flex;
    position: relative;
}

.mermoz-search-form .search-field {
    width: 100%;
    padding: 12px 15px;
    border-radius: 4px;
    border: none;
    font-size: 0.95rem;
    color: #333;
    outline: none;
}

.mermoz-search-form .search-submit {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
}

/* Icons */
.custom-icons-area {
    display: flex;
    gap: 20px;
    align-items: center;
}

.custom-icon-link {
    position: relative;
    display: flex;
    align-items: center;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #0000cc;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

/* =========================================
   4. NAVIGATION BAR (Simple)
   ========================================= */
.custom-menu-bar {
    background-color: #05051a; /* Black background */
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 0;
}

.main-menu-list.simple-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 40px; /* Space between items */
    justify-content: flex-start; /* Left align like reference image */
}

.main-menu-list.simple-nav li {
    padding: 15px 0;
}

.main-menu-list.simple-nav li a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem; /* Slightly larger readable text */
    font-weight: 500;
    transition: color 0.2s ease;
    white-space: nowrap; /* Prevent wrapping */
}

.main-menu-list.simple-nav li a:hover {
    color: #0000cc; /* Blue on hover */
}

.custom-search-area {
    max-width: 100% !important;
}

form.mermoz-search-form {
    margin-bottom: 0px !important;
}

.header-menu-bottom {
    display: flex !important;
    justify-content: center !important;
}

/* =========================================
   FOOTER STYLES (Show Music Theme)
   ========================================= */
.site-footer {
    background-color: #000000 !important;
    color: #FFFFFF !important;
    padding: 60px 0 20px;
    font-size: 0.9rem;
}

.site-footer a {
    color: white !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: #0000cc !important;
    text-decoration: underline;
}

/* Layout Grid */
.footer-main-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer-col {
    flex: 1;
    min-width: 200px;
    margin-bottom: 30px;
}

.footer-col-right {
    text-align: right; /* Align Contact info to right */
}

/* Headings */
.footer-heading {
    color: white !important;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
}

/* Links List */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-logo-area a img {
    max-width: 150px !important;
}

.custom-logo-area a img {
    max-width: 180px !important;
}

.f-fiscal img {
    max-width: 40px !important;
}

/* Contact Block */
.footer-contact-block p {
    margin-bottom: 5px;
    color: #ccc;
    font-size: 0.9rem;
}

/* Social Icons */
.social-block {
    margin: 20px 0;
}

.social-icons {
    display: inline-flex;
    gap: 15px;
}

.social-icons img {
    width: 24px;
    height: 24px;
    filter: invert(1); /* Makes black icons white if they are black PNGs */
    transition: opacity 0.2s;
}

.social-icons img:hover {
    opacity: 0.8;
}

/* Payment Icons */
.payment-icons-row {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end; /* Align right */
    gap: 10px;
}

/* Bottom Row */
.footer-bottom-row {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.f-copy p {
    margin: 0;
    font-size: 0.8rem;
    color: #777;
}

/* Responsive */
@media (max-width: 768px) {
    .footer-main-row {
        flex-direction: column;
    }
    
    .footer-col-right {
        text-align: left;
    }
    
    .payment-icons-row {
        justify-content: flex-start;
    }
}

/* =========================================
   SINGLE PRODUCT PAGE
   ========================================= */

/* Main Container styling */
.mermoz-single-container {
    padding: 30px 0;
}

/* Top Grid Layout */
.mermoz-product-top-grid {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

/* Breadcrumbs */
.product-breadcrumbs {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #666;
}

.product-breadcrumbs a {
    color: #666;
    text-decoration: none;
}

.product-breadcrumbs a:hover {
    text-decoration: underline;
}


/* Product Info */
.product_title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: #111;
    line-height: 1.2;
}

.price {
    font-size: 2rem;
    font-weight: 800;
    color: #111;
    margin-bottom: 25px;
    display: block;
}

.woocommerce-product-details__short-description {
    margin-bottom: 30px;
    color: #555;
    line-height: 1.6;
}

/* Add to Cart Form */
.cart {
    margin-bottom: 30px;
    padding-bottom: 30px;
}

/* HIDE QUANTITY SELECTOR */
.quantity,
.qty-selector {
    display: none !important;
}

/* Add to Cart Button (Large & Black) */
.single_add_to_cart_button {
    background-color: #000 !important;
    color: #fff !important;
    width: 100%;
    padding: 18px;
    font-size: 1.1rem;
    text-transform: uppercase;
    font-weight: 700;
    border-radius: 6px;
    transition: background 0.3s, transform 0.2s;
    border: none;
    cursor: pointer;
}

.single_add_to_cart_button:hover {
    background-color: #333 !important;
    transform: translateY(-2px);
}

/* =========================================
   BENEFITS BLOCK (Icons)
   ========================================= */
.product-benefits-block {
    display: flex;
    justify-content: space-around; /* Better spacing */
    gap: 30px;
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-align: center; /* Center align text within each block */
}

.benefit-item {
    flex: 1;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center align items vertically */
}

.benefit-icon {
    margin-bottom: 20px;
}

.benefit-text h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #222;
}

.benefit-text p {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* =========================================
   ACCORDIONS (Description)
   ========================================= */
.mermoz-product-accordions {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

.mermoz-details {
    border-bottom: 1px solid #eee;
    padding: 25px 0;
}

.mermoz-details:last-child {
    border-bottom: none;
}

.mermoz-details summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    outline: none;
}

.mermoz-details summary h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}

.mermoz-details summary::-webkit-details-marker {
    display: none;
}

.details-content {
    padding-top: 25px;
    color: #555;
    line-height: 1.7;
    font-size: 1rem;
}

/* Chevron Rotation */
.mermoz-details[open] .chevron {
    transform: rotate(180deg);
}
.chevron {
    transition: transform 0.3s ease;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {

    .product-benefits-block {
        flex-direction: column;
        gap: 40px;
        padding: 30px;
    }
    
    .benefit-item {
        border-bottom: 1px solid #eee;
        padding-bottom: 30px;
    }
    
    .benefit-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .product_title {
        font-size: 1.8rem;
    }

    .price {
        font-size: 1.6rem;
    }
}

/* =========================================
   SHOP / ARCHIVE PAGE
   ========================================= */

/* Layout Container */
.mermoz-shop-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* Sidebar Styling */
.mermoz-shop-sidebar {
    width: 250px; /* Fixed width sidebar */
    flex-shrink: 0;
}

.mermoz-filter-box {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.mermoz-filter-box:last-child {
    border-bottom: none;
}

.widget-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-transform: uppercase;
    color: #111;
}

/* Sidebar Lists */
.mermoz-shop-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mermoz-shop-sidebar ul li {
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #555;
    display: flex;
    justify-content: space-between;
}

.mermoz-shop-sidebar ul li a {
    color: #555;
    text-decoration: none;
    transition: color 0.2s;
}

.mermoz-shop-sidebar ul li a:hover {
    color: #000;
    font-weight: 600;
}

/* Price Slider adjustments */
.widget_price_filter .price_slider_amount .button {
    background: #000;
    color: #fff;
    font-size: 0.8rem;
    padding: 5px 10px;
}

/* Main Content Area */
.mermoz-shop-content {
    flex-grow: 1; /* Takes remaining space */
}

.mermoz-shop-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    line-height: 1;
    color: #111;
}

/* Sort Dropdown */
.woocommerce-ordering select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

/* Infinite Loader */
.mermoz-infinite-loader img {
    width: 30px;
    height: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .mermoz-shop-container {
        flex-direction: column;
    }
    
    .mermoz-shop-sidebar {
        width: 100%;
        margin-bottom: 30px;
        display: none; /* Often better to hide or put behind a "Filter" button on mobile */
    }
    
    .mermoz-shop-header {
    display: flex;
    flex-direction: column !important;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 10px;
}
}

/* =========================================
   SHOP GRID ALIGNMENT FIX
   ========================================= */

/* Force Grid Layout for Products */
ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important; /* Forces 4 columns */
    gap: 20px;
    justify-content: start !important; /* Aligns the grid itself to the left */
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure individual items don't have weird floats or widths */
ul.products li.product {
    width: auto !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
}

/* Ensure the wrapper allows full width */
.mermoz-shop-content {
    width: 100%;
}

/* Remove any default Storefront centering */
.site-main ul.products li.product {
    margin-right: 0; 
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .mermoz-shop-container {
        flex-direction: column;
    }
    
    .mermoz-shop-sidebar {
        display: none; /* Hide sidebar on mobile or use toggle */
    }

    ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }
}

/* =========================================
   ADD TO CART SUCCESS STATE
   ========================================= */
.product-added-success {
    background-color: black !important; /* Green Success Color */
    border-color: black !important;
    color: #fff !important;
    opacity: 1 !important;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Space between text and checkmark */
}

/* Ensure the checkmark icon aligns nicely */
.product-added-success svg {
    margin-top: -2px; 
}

/* Hide the default "View Cart" link just in case JS misses it for a split second */
a.added_to_cart {
    display: none !important;
}

/* =========================================
   CART PAGE STYLES
   ========================================= */

/* Background */
.woocommerce-cart .site-content {
    background-color: #f4f4f4;
    padding-bottom: 50px;
}

.mermoz-cart-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 30px 0 20px;
    padding-left: 15px; /* Align with wrapper */
}

/* Layout Wrapper */
.mermoz-cart-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    max-width: 85dvw;
    margin: 0 auto;
}

/* LEFT COLUMN: Products */
.mermoz-cart-left {
    flex: 2; /* Takes 2/3 of space */
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Cart Item Row */
.mermoz-cart-item {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 20px 0;
}

.mermoz-cart-item:last-child {
    border-bottom: none;
}

/* Item Image */
.cart-item-image {
    width: 80px;
    margin-right: 20px;
}

.cart-item-image img {
    border-radius: 6px;
    width: 100%;
    height: auto;
}

/* Item Title & Remove */
.cart-item-details {
    flex: 2;
    padding-right: 15px;
}

.cart-item-title a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.remove-text {
    display: block;
    margin-top: 5px;
    color: #0000cc; /* Blue */
    font-size: 0.85rem;
    text-decoration: none;
}

.remove-text:hover {
    text-decoration: underline;
}

/* Quantity Selector in Cart */
.cart-item-quantity {
    margin-right: 30px;
}
/* Re-using your existing .qty-selector styles here */

/* Price */
.cart-item-price {
    font-weight: 700;
    font-size: 1.1rem;
    color: #111;
}

/* RIGHT COLUMN: Totals */
.mermoz-cart-sidebar {
    flex: 1; /* Takes 1/3 of space */
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.mermoz-cart-sidebar h3 {
    margin-top: 0;
    font-size: 1.1rem;
    font-weight: 700;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* Totals Rows */
.mermoz-totals-table .totals-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #555;
}

.mermoz-totals-table .order-total {
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 15px;
    font-weight: 800;
    color: #000;
    font-size: 1.2rem;
}

/* Checkout Button */
.checkout-button {
    background-color: #000 !important;
    color: #fff !important;
    width: 100%;
    display: block;
    text-align: center;
    padding: 15px;
    border-radius: 6px;
    font-weight: 700;
    margin-top: 20px;
    text-decoration: none;
}

.checkout-button:hover {
    background-color: #333 !important;
}

/* Disclaimer */
.shipping-disclaimer {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #888;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* HIDE Default Table Headers if they appear via hooks */
.shop_table thead {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .mermoz-cart-wrapper {
        flex-direction: column;
    }
    
    .mermoz-cart-item {
        flex-wrap: wrap;
    }
    
    .cart-item-quantity {
        order: 3;
        margin-top: 15px;
    }
    
    .cart-item-price {
        order: 4;
        margin-top: 15px;
        margin-left: auto;
    }
}

/* =========================================
   MERCADO LIBRE STYLE SINGLE PRODUCT
   ========================================= */

/* The Main Box Container */
.ml-style-box {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    background: #fff;
}

/* 1. Condition Label */
.ml-condition {
    font-size: 0.85rem;
    color: #666; /* Gray text */
    margin-bottom: 10px;
    display: block;
}

/* 2. Title */
.ml-title {
    font-size: 1.4rem; /* roughly 22px */
    font-weight: 700;
    line-height: 1.3;
    color: #000;
    margin-bottom: 15px;
}

/* 3. Price Styling */
.ml-price-container {
    margin-bottom: 20px;
}
.ml-price-container .price {
    font-size: 2.25rem !important; /* Large Price */
    font-weight: 300 !important;   /* Light font weight */
    color: #000 !important;
    line-height: 1;
}
.ml-price-container del {
    font-size: 1rem !important;
    color: #999 !important;
}

/* 4. Shipping Pill (Purple) */
.ml-shipping-section {
    margin-bottom: 25px;
}
.ml-purple-pill {
    background-color: #0000cc; /* Adjust to match your blue, or use #4a00e0 for ML purple */
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
}
.ml-shipping-text {
    font-size: 0.9rem;
    color: #777;
    line-height: 1.4;
    margin: 0;
}
.ml-shipping-text a {
    color: #0000cc;
    text-decoration: none;
}

/* 5. Stock Alert */
.ml-stock-alert {
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 1rem;
    color: #000;
}

/* 6. Buttons Area */
.ml-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

/* BUTTON 1: COMPRAR AHORA (The Custom Link) - Black */
.ml-btn-buy-now {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #000 !important; /* Black */
    color: #fff !important;
    border-radius: 6px;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.ml-btn-buy-now:hover {
    background-color: #333 !important;
    color: #fff !important;
}

/* BUTTON 2: AGREGAR AL CARRITO (The Standard WC Form) - Light Blue */
/* We target the standard WC button class inside our wrapper */
.ml-standard-cart-btn-wrapper .button,
.ml-standard-cart-btn-wrapper .single_add_to_cart_button {
    background-color: rgba(65,137,230,.15) !important; /* Very light blue bg */
    color: #0000cc !important; /* Blue Text */
    width: 100%;
    border-radius: 6px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    text-shadow: none !important;
    margin-top: 0 !important; /* Remove default margins */
}

.ml-standard-cart-btn-wrapper .button:hover,
.ml-standard-cart-btn-wrapper .single_add_to_cart_button:hover {
    background-color: rgba(65,137,230,.3) !important;
    color: #0000cc !important;
}

/* Ensure the form doesn't add weird spacing */
.ml-standard-cart-btn-wrapper form.cart {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Hide Quantity Input (Global override for this template) */
.mermoz-product-summary .quantity {
    display: none !important;
}

p.stock {
    display: none !important;
}

/* =========================================
   MAIN PRODUCT LAYOUT (2 Columns)
   ========================================= */

/* This splits the page: Gallery (60%) | Summary (40%) */
.product-grid-flex {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 30px;
    align-items: flex-start; /* Aligns them to the top */
    width: 100%;
}

/* Ensure the gallery container fits into that 60% slot */
.mermoz-product-gallery {
    width: 100%;
    overflow: hidden; /* Prevents scrollbars if images are huge */
}

/* Responsive: Stack them on mobile */
@media (max-width: 768px) {
    .product-grid-flex {
        grid-template-columns: 1fr; /* 1 column */
        gap: 0;
    }
}

.ml-g-item {
    display: flex !important;
    gap: 1rem !important;
}

/* =========================================
   SIDEBAR CATEGORIES: COMPACT TREE STYLE
   ========================================= */

/* 1. Reset List Styles */
.widget_product_categories ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.widget_product_categories li {
    margin-bottom: 8px; /* Space between items */
    padding: 0;
    position: relative;
    list-style: none !important;
}

/* 2. Remove default "Folder" icons from theme */
/* This targets typical theme icons like FontAwesome or simple CSS bullets */
.widget_product_categories li::before,
.widget_product_categories li::after,
.cat-item::before {
    content: none !important; 
    display: none !important;
}

/* 3. The "Compact" Logic: Hide subcategories by default */
.widget_product_categories ul.children {
    display: none;
    margin-left: 15px !important; /* Indent children */
    padding-left: 10px !important; 
    border-left: 1px solid #ddd; /* Optional: Thin line to guide the eye */
    margin-top: 5px;
}

/* 4. Show Children ONLY if the parent is Active (Current) or an Ancestor */
/* This creates the "Drill Down" effect */
.widget_product_categories li.current-cat > ul.children,
.widget_product_categories li.current-cat-parent > ul.children {
    display: block;
}

/* 5. Styling the Links */
.widget_product_categories a {
    text-decoration: none;
    color: #666; /* Default gray */
    font-size: 0.95rem;
    transition: color 0.2s;
    display: block; /* Makes the whole area clickable */
}

.widget_product_categories a:hover {
    color: #000;
}

/* 6. Highlight the Active Category */
.widget_product_categories li.current-cat > a {
    font-weight: 800; /* Bold */
    color: #000;
}

/* Optional: Add a small chevron '>' next to parents that have children? */
/* Note: This is purely visual. */

/* =========================================
   CUSTOM CATEGORY TREE WIDGET
   ========================================= */

/* =========================================
   SIDEBAR WIDGET TITLES (Global)
   ========================================= */

/* Applies to Categories, Price, Brands, etc. */
.mermoz-filter-box .widget-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #000; /* The black underline */
    color: #111;
}

/* Specific fix for the arrow inside the title */
.back-arrow {
    text-decoration: none;
    font-size: 1.2rem;
    color: #666;
    transition: color 0.2s;
    margin-right: 5px;
}
.back-arrow:hover {
    color: #000;
}

/* Back Arrow styling */
.back-arrow {
    text-decoration: none;
    font-size: 1.2rem;
    color: #666;
    transition: color 0.2s;
}
.back-arrow:hover {
    color: #000;
}

/* The List */
.custom-cat-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.custom-cat-list li {
    margin-bottom: 8px;
    padding: 0;
}

.custom-cat-list li a {
    text-decoration: none;
    color: #555;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between; /* Pushes count to the right */
    transition: all 0.2s;
}

.custom-cat-list li a:hover {
    color: #000;
    padding-left: 5px; /* Slight movement effect */
}

/* Count Number styling */
.custom-cat-list li a .count {
    color: #999;
    font-size: 0.85rem;
}

/* Current Item (if viewing siblings) */
.custom-cat-list li.current-item a {
    font-weight: 800;
    color: #000;
}

/* =========================================
   SHOW MORE MODAL STYLES
   ========================================= */

/* 1. "Mostrar Más" Link */
.show-more-cats-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #3483fa; /* Mercado Libre Blue */
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.show-more-cats-link:hover {
    text-decoration: underline;
}

/* 2. Modal Overlay (Background) */
.mermoz-modal-overlay {
    position: fixed;
    z-index: 99999; /* Top level */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5); /* Dimmed background */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 3. Modal Box */
.mermoz-modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 6px;
    width: 90%;
    max-width: 800px; /* Wide box like reference */
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: relative;
    animation: fadeIn 0.3s;
}

/* Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Close Button (X) */
.close-modal {
    color: #999;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover {
    color: #000;
}

/* 4. Grid Layout for Categories inside Modal */
.modal-cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 Columns */
    gap: 20px;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.modal-cat-grid li {
    margin: 0;
}

.modal-cat-grid li a {
    text-decoration: none;
    color: #333;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.modal-cat-grid li a:hover {
    color: #3483fa; /* Blue on hover */
}

/* Animation */
@keyframes fadeIn {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-cat-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablet */
    }
}

@media (max-width: 480px) {
    .modal-cat-grid {
        grid-template-columns: 1fr; /* 1 column on mobile */
    }
}

/* =========================================
   GRID GHOST ELEMENT FIX
   ========================================= */

ul.products::before, ul.products::after {
    content: none !important;
}

.entry-content {
    width: 100% !important;
}

.right-sidebar .content-area {
    width: 100% !important;
}

.price-ref {
    color: #6D6D6D !important;
    font-weight: normal !important;
    font-size: 1.5rem !important;
}

.mermoz-custom-price {
    font-size: 24px;
}

/* =========================================
   MOBILE FILTER DRAWER (SEQUENCED ANIMATION)
   ========================================= */

/* Hide trigger on desktop */
.mobile-filter-trigger-wrapper {
    display: none;
    margin-bottom: 20px;
}

/* 1. The Overlay (Backdrop) */
.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Slightly darker for better focus */
    z-index: 99999;
    
    /* Fade Animation: Starts immediately */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
}

/* 2. The Drawer Content (The White Box) */
.mobile-drawer-content {
    width: 85%;
    max-width: 320px;
    background: #fff;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    box-shadow: 4px 0 15px rgba(0,0,0,0.2);

    /* Slide Animation: Starts with a slight delay */
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- ACTIVE STATES --- */

/* Backdrop fades in instantly when clicked */
.mobile-drawer-overlay.is-active {
    visibility: visible;
    opacity: 1;
}

/* Content slides in with a 0.1s delay for a sequenced look */
.mobile-drawer-overlay.is-active .mobile-drawer-content {
    transform: translateX(0);
    transition-delay: 0.1s; 
}

/* --- DRAWER INTERNALS --- */

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.close-drawer {
    font-size: 32px;
    cursor: pointer;
    color: #333;
    line-height: 1;
}

.mobile-filter-btn {
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    padding: 12px;
    font-weight: 600;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .mobile-filter-trigger-wrapper {
        display: block;
    }
    .mermoz-shop-sidebar {
        display: none !important;
    }
}

/* =========================================
   STICKY FLOATING FILTER BUTTON
   ========================================= */

.sticky-filter-btn {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%) translateX(-100%); /* Start off-screen */
    background: #05051a; /* Matches your header dark navy */
    border: none;
    border-radius: 0 8px 8px 0; /* Rounded on the right side */
    padding: 15px 10px;
    z-index: 9999;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s;
    display: none; /* Only show on mobile */
}

.sticky-filter-btn.is-visible {
    transform: translateY(-50%) translateX(0); /* Slide into view */
}

.sticky-filter-btn:active {
    background: #0000cc; /* Blue flash on click */
}

@media (max-width: 768px) {
    .sticky-filter-btn {
        display: block;
    }
}

/* --- Global Visibility Helpers --- */
.desktop-only { display: block; }
.mobile-only { display: none; }

/* --- Global Visibility Helpers --- */
.desktop-only { display: block; }
.mobile-only { display: none; }

.custom-mermoz-header {
    position: fixed;
    z-index: 9998;
    top: 0;
    left: 0;
    width: 100%;
}

#page {
        padding-top: 15dvh !important;
    }

/* =========================================
   MOBILE HEADER - POLISHED LAYOUT (FIXED)
   ========================================= */

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }
    
    /* NEW: Fixed Header Container */
    /* switched to 'fixed' to guarantee it stays at the top */
    .mobile-mermoz-header {
        position: fixed !important;
        top: 0;
        left: 0;
        z-index: 9998; /* High z-index to stay above content */
        width: 100%;
    }

    /* CRITICAL: Push the website content down so it isn't hidden behind the header */
    #page {
        padding-top: 116px !important;
    }
    
    /* 1. Top Row: Nav | Logo | Cart */
    .mobile-header-top {
        background-color: #05051A !important; /* Dark Navy Background */
        padding: 8px 15px;
        border-bottom: none;
    }

    .mobile-nav-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 40px;
    }

    /* Logo Sizing - Smaller */
    .mobile-nav-container .custom-logo-area img {
        height: auto !important; /* Reduced size */
        width: auto;
        display: block;
        margin: 0 auto;
    }

    /* 2. Bottom Row: Back | Search */
    .mobile-header-bottom {
        background-color: #05051A !important; /* Dark Navy Background */
        padding: 10px 15px;
        box-shadow: 0 4px 6px -6px rgba(0,0,0,0.1);
    }

    .mobile-search-container {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    /* Back Button - White Icon */
    .back-btn {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        width: 24px;
        height: 40px; 
        flex-shrink: 0;
        outline: none;
    }
    
    .back-btn svg {
        stroke: #ffffff !important; /* White Arrow */
    }
    
    .back-btn:hover, .back-btn:focus {
        background: transparent !important;
        outline: none !important;
    }

    /* Search Form Wrapper */
    .mobile-search-container .mermoz-search-form {
        flex-grow: 1;
        position: relative;
        margin-bottom: 0 !important;
    }

    /* Search Input Styling - White Background */
    .search-field {
        width: 100%;
        background: #ffffff !important; /* White Background */
        border: none !important;
        border-radius: 20px !important;
        padding: 0 15px 0 40px !important;
        font-size: 14px;
        height: 40px;
        line-height: 40px;
        color: #333;
        box-shadow: none !important;
        outline: none;
    }

    /* Magnifying Glass Icon */
    .search-icon-inside {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
        width: 18px;
        height: 18px;
        stroke: #666 !important; /* Dark Grey inside white input */
    }

    /* Hamburger Button Styling - White */
    .hamburger-btn {
        background: transparent !important;
        border: none !important;
        padding: 5px 0 !important;
        width: 24px;
        height: 24px;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        cursor: pointer;
    }

    .hamburger-btn span {
        display: block;
        width: 100%;
        height: 2px;
        background: #ffffff !important; /* White Lines */
        border-radius: 2px;
    }
    
    /* Cart Icon Sizing - White */
    .mobile-nav-container .cart-icon {
        display: flex;
        align-items: center;
        position: relative;
        text-decoration: none;
    }
    
    .mobile-nav-container .cart-icon svg {
        width: 26px;
        height: 26px;
        stroke: #ffffff !important; /* White Cart */
    }
    
    /* Cart Count Badge */
    .cart-icon .cart-count {
        position: absolute;
        top: -5px;
        right: -5px;
        background: #0000cc;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        width: 16px;
        height: 16px;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 50%;
    }

    /* Bottom Nav Bar Styling - Fixed Row Layout */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #ffffff !important;
        display: flex !important;
        flex-direction: row !important; /* Force horizontal row */
        justify-content: space-around !important; /* Distribute items evenly */
        align-items: center !important;
        height: 60px;
        border-top: 1px solid #eee;
        z-index: 10000;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #666;
        font-size: 11px;
        flex: 1; /* Equal width for all items */
    }

    .nav-item svg { 
        margin-bottom: 4px;
        width: 24px;
        height: 24px;
    }
    
    /* Spacing fixes for content */
    #content, .site-footer {
        padding-bottom: 80px !important;
    }
    
    /* Drawer Overlay Styling */
    .mobile-drawer-content {
        position: relative; /* For close button positioning */
    }
}

/* =========================================
   DRAWER & MENU STYLES
   ========================================= */

@media (max-width: 768px) {
    /* Drawer Menu List */
    .drawer-menu {
        list-style: none !important;
        padding: 0 !important;
        margin: 20px 0 0 0 !important;
    }

    .drawer-menu li {
        border-bottom: 1px solid #eee;
        margin: 0;
    }

    .drawer-menu li a {
        display: block;
        padding: 15px 5px;
        color: #333;
        font-weight: 500;
        text-decoration: none;
        font-size: 1rem;
    }

    /* Shipping Note */
    .free-shipping-note {
        background: #0000cc;
        color: #fff;
        padding: 15px;
        border-radius: 6px;
        font-size: 0.9rem;
        font-weight: 700;
        text-align: center;
        margin-bottom: 10px;
    }
}

/* Active State for Bottom Nav */
.mobile-bottom-nav a:active,
.mobile-bottom-nav a:focus,
.nav-item:hover {
    color: #0000cc;
}

@media (max-width: 1024px) {
    .categories-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 20px;
        gap: 10px;
        -webkit-overflow-scrolling: touch;
    }
}

/* =========================================
   FLOATING WHATSAPP BUTTON
   ========================================= */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366; /* WhatsApp Green */
    color: #FFF;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 4px 15px rgba(0,0,0,0.2);
    z-index: 9990; /* High, but below the Modal/Drawer (99999) */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 2px 6px 20px rgba(0,0,0,0.3);
}

/* Mobile Adjustment: Move UP to avoid Bottom Navbar */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 80px; /* 60px Navbar + 20px spacing */
        right: 15px;
        width: 55px;
        height: 55px;
    }
    
    .whatsapp-float svg {
        width: 28px;
        height: 28px;
    }
}

/* Single Product Sale Badge */
.mermoz-single-sale-badge {
    position: absolute;
    left: 90px;
    z-index: 99; /* Higher than the image zoom layer */
    background-color: #0000cc; /* Blue Color */
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Ensure mobile responsiveness */
@media (max-width: 768px) {
    .mermoz-single-sale-badge {
        left: 10px;
        font-size: 18px;
        padding: 4px 8px;
    }
}

span.onsale {
    display: none !important;
}