/*
 * Zdesigner Responsive CSS
 * Optimized for all devices: mobile, tablet, desktop, large screens
 * Breakpoints: 320px, 375px, 425px, 768px, 1024px, 1440px+
 */

/* ============================================
   BASE RESPONSIVE SETUP
   ============================================ */

/* Prevent horizontal overflow globally */
html {
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: rgba(236, 182, 19, 0.3);
}

/* Ensure body is always interactive unless modal is open */
body:not(.modal-open) {
    overflow-y: auto !important;
    pointer-events: auto !important;
}

/* Fix for iOS Safari touch events */
body,
html {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

/* Allow text selection in input fields */
input,
textarea,
[contenteditable] {
    -webkit-user-select: text;
    user-select: text;
}

/* CRITICAL: Prevent transform interference with click detection on mobile */
@media screen and (max-width: 1024px) {
    /* Override all hover effects on mobile/tablet - but not header buttons */
    .group:hover img,
    .group:hover *[class*="scale"],
    img[class*="group-hover:scale"],
    *[class*="hover:scale"]:not(header button),
    button[class*="hover:scale"]:not(header button) {
        transform: none !important;
    }
    
    /* Ensure product card buttons and links have proper clickable areas */
    .product-card a, 
    .product-card button {
        position: relative;
        transform: none !important;
        will-change: auto;
    }
    
    /* Fix for product cards - ensure links cover full area */
    .product-card a {
        display: block;
        transform: none !important;
    }
    
    /* Prevent any nested transforms from affecting click targets - only in product cards */
    .product-card *,
    .product-card button * {
        transform: none !important;
    }
}

/* Ensure all containers respect boundaries */
* {
    box-sizing: border-box;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* Prevent images from breaking layout */
img {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* Responsive images with aspect ratio */
.wp-post-image,
.product-image,
.gallery-image {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Fix for images in flex/grid containers */
.flex img,
.grid img {
    flex-shrink: 0;
}

/* Lazy loading optimization */
img[loading="lazy"] {
    min-height: 200px;
}

/* ============================================
   MEDIA QUERIES - IMAGE OPTIMIZATION
   ============================================ */

@media (max-width: 767px) {
    /* Hero/Banner images - optimized height */
    .hero-image,
    .banner-image,
    [style*="background-image"] {
        min-height: 300px !important;
        background-size: cover !important;
        background-position: center !important;
    }
    
    /* Product images - square ratio */
    .product-image-wrapper {
        aspect-ratio: 1 / 1;
        overflow: hidden;
    }
    
    /* Gallery images - responsive grid */
    .gallery {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    .gallery-item {
        width: 100% !important;
    }
    
    /* Lightbox/Modal images */
    .lightbox-image,
    .modal-image {
        max-width: 95vw !important;
        max-height: 80vh !important;
        object-fit: contain !important;
    }
}

/* Remove 300ms tap delay on mobile */
a, button, input, select, textarea, label, .btn, .button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Enable text selection for inputs and content */
input, textarea, p, span, h1, h2, h3, h4, h5, h6 {
    -webkit-user-select: text;
    user-select: text;
}

/* Optimize scrolling on iOS */
.modal, .sidebar, .menu {
    -webkit-overflow-scrolling: touch;
}

/* Prevent text inflation on mobile */
* {
    max-height: 999999px;
}

/* Remove hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    a:hover, button:hover, .btn:hover {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================
   MOBILE-FIRST: Base styles (320px+)
   ============================================ */

/* Touch-friendly minimum sizes */
button, a, input[type="button"], input[type="submit"], 
.btn, .button, .wp-block-button__link {
    min-height: 44px;
    min-width: 44px;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Better click area for links */
a {
    display: inline-block;
    position: relative;
}

/* Increase tap targets for small touch elements */
.icon-button, .close-button, .toggle-button {
    min-width: 48px !important;
    min-height: 48px !important;
    padding: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Readable text on mobile */
body {
    font-size: 16px;
    line-height: 1.5;
}

/* Spacing optimization for mobile */
.layout-container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Header responsive */
header {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

/* Mobile header adjustments */
@media (max-width: 767px) {
    header {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
    
    header img {
        height: 2rem !important;
    }
    
    /* Hide desktop navigation */
    header nav.hidden {
        display: none !important;
    }
    
    /* Search form - full width on mobile */
    header form {
        display: none !important;
    }
}

/* Tablet header */
@media (min-width: 768px) and (max-width: 1023px) {
    .layout-container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
    
    header {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* Desktop header */
@media (min-width: 1024px) {
    .layout-container {
        padding-left: 2.5rem !important;
        padding-right: 2.5rem !important;
    }
}

/* ============================================
   HEADER - ALWAYS VISIBLE ON SCROLL (DESKTOP ONLY)
   CRITICAL: Using position: fixed for reliability
   ============================================ */

/* Ensure body handles horizontal overflow */
body {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Header base - always visible and interactive */
header {
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
    pointer-events: auto !important;
}

/* Mobile & Tablet: Normal scrolling header (NO fixed positioning) */
@media (max-width: 1279px) {
    header {
        position: relative !important;
        top: auto !important;
        z-index: 50 !important;
    }
    
    /* CRITICAL: Remove body padding on mobile to prevent layout issues */
    body {
        padding-top: 0 !important;
    }
}

/* Large Desktop: FIXED header - Always visible during scroll */
@media (min-width: 1280px) {
    /* CRITICAL: Use fixed positioning for guaranteed visibility */
    header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 9999 !important;
        will-change: transform;
        transition: box-shadow 0.3s ease;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    /* Add padding to body to compensate for fixed header */
    body {
        padding-top: 80px !important;
    }
    
    /* Add subtle shadow for depth */
    header {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }
    
    /* Prevent any parent container from hiding header */
    header {
        isolation: isolate;
        contain: layout style;
    }
}

/* Ensure no parent container blocks header visibility */
.relative.flex.flex-col,
div[class*="overflow"] {
    overflow-x: visible !important;
}

/* Remove any transforms on scrolling containers that could hide header */
@media (min-width: 1280px) {
    body > div:first-child {
        transform: none !important;
    }
}

/* ============================================
   MODALS - RESPONSIVE
   ============================================ */

/* Ensure modals appear above header */
#cart-modal,
#wishlist-modal,
#global-wishlist-toast {
    z-index: 10000 !important;
}

#mobile-menu-sidebar {
    z-index: 10001 !important;
}

/* Mobile: Full screen modals */
@media (max-width: 767px) {
    #cart-modal > div,
    #wishlist-modal > div {
        max-width: 100% !important;
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    
    /* Modal headers - compact on mobile */
    #cart-modal .p-6,
    #wishlist-modal .p-6 {
        padding: 1rem !important;
    }
    
    /* Modal scroll area optimization */
    #cart-items-container,
    #wishlist-items {
        max-height: calc(100vh - 200px) !important;
    }
    
    /* ========================================
       CART MODAL PRODUCT ITEMS - MOBILE FIX
       ======================================== */
    
    /* Product item container - stack on mobile */
    .cart-modal-item {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
        padding: 0.75rem !important;
    }
    
    /* Image & info row */
    .cart-modal-item > div:first-child {
        width: 100% !important;
    }
    
    /* Product image - smaller on mobile */
    .cart-modal-item .w-20 {
        width: 70px !important;
        height: 70px !important;
        min-width: 70px !important;
    }
    
    /* Product title */
    .cart-modal-item h4 {
        font-size: 0.875rem !important;
        line-height: 1.25rem !important;
    }
    
    /* Quantity & price row - horizontal with space-between */
    .cart-modal-item > div:last-child {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 0.75rem !important;
    }
    
    /* Quantity controls */
    .cart-modal-item .cart-qty-minus,
    .cart-modal-item .cart-qty-plus {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        touch-action: manipulation !important;
    }
    
    .cart-modal-item .cart-qty {
        min-width: 2rem !important;
        text-align: center !important;
        font-size: 1rem !important;
    }
    
    /* Price - no overlap */
    .cart-modal-item p.font-bold {
        font-size: 1rem !important;
        white-space: nowrap !important;
    }
    
    /* Remove button top right on mobile */
    .cart-modal-item .cart-remove-item {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        touch-action: manipulation !important;
    }
    
    /* CRITICAL: Hide remove button next to price on mobile */
    .cart-modal-item .cart-remove-item.hidden {
        display: none !important;
    }
    
    .cart-modal-item > div:last-child .cart-remove-item {
        display: none !important;
    }
    
    /* Show only the remove button next to title on mobile */
    .cart-modal-item .sm\\:hidden {
        display: inline-flex !important;
    }
    
    /* Modal footer */
    #cart-modal-footer .grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    #cart-modal-footer a {
        min-height: 48px !important;
        touch-action: manipulation !important;
    }
}

/* Tablet modals */
@media (min-width: 768px) and (max-width: 1023px) {
    #cart-modal > div,
    #wishlist-modal > div {
        max-width: 90% !important;
    }
}

/* ============================================
   PRODUCT CARDS & GRIDS
   ============================================ */

/* Mobile: Single column */
@media (max-width: 639px) {
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4,
    .products,
    ul.products {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
        gap: 1rem !important;
    }
    
    /* Product cards - optimize spacing */
    .product-card,
    .product,
    li.product {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .product-card img,
    .product img,
    li.product img {
        aspect-ratio: 1 / 1;
        object-fit: cover;
        width: 100% !important;
    }
    
    /* Product titles - readable */
    .product-card h3,
    .product h2,
    .product h3,
    .woocommerce-loop-product__title {
        font-size: 1rem !important;
        line-height: 1.4 !important;
        margin: 0.5rem 0 !important;
    }
    
    /* Product price - prominent */
    .product-price,
    .price,
    .woocommerce-Price-amount {
        font-size: 1.25rem !important;
        font-weight: 700 !important;
    }
    
    /* Add to cart buttons - full width */
    .product-card button,
    .product .button,
    .add_to_cart_button {
        width: 100% !important;
        min-height: 48px !important;
        font-size: 1rem !important;
    }
}

/* Small mobile: 2 columns for products */
@media (min-width: 375px) and (max-width: 639px) {
    .products-grid,
    ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.75rem !important;
    }
    
    /* Optimize for small screens */
    .product-card,
    .product,
    li.product {
        padding: 0.5rem !important;
    }
    
    .product-card img,
    .product img {
        border-radius: 8px !important;
    }
    
    .product-card h3,
    .woocommerce-loop-product__title {
        font-size: 0.875rem !important;
    }
    
    .product-price,
    .price {
        font-size: 1rem !important;
    }

}

/* 425px - Larger mobile */
@media (min-width: 425px) and (max-width: 767px) {
    ul.products,
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 1rem !important;
    }
    
    .product-card,
    .product {
        padding: 0.75rem !important;
    }
}

/* Tablet: 2-3 columns */
@media (min-width: 640px) and (max-width: 1023px) {
    .grid-cols-4,
    ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 1rem !important;
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Large tablet / Small laptop: 768px */
@media (min-width: 768px) and (max-width: 1023px) {
    ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    
    .product-card,
    .product {
        padding: 1rem !important;
    }
}

/* Desktop: Respect original columns */
@media (min-width: 1024px) {
    .grid-cols-3,
    ul.products.columns-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    
    .grid-cols-4,
    ul.products.columns-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

/* Large desktop: 1440px+ */
@media (min-width: 1440px) {
    .layout-container {
        max-width: 1400px !important;
        margin: 0 auto !important;
    }
    
    ul.products.columns-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 1.5rem !important;
    }
}

/* Extra large: 1920px+ */
@media (min-width: 1920px) {
    .layout-container {
        max-width: 1600px !important;
    }
    
    /* Product grids - 5 columns on very large screens */
    .products-grid,
    ul.products {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }
}

/* ============================================
   WOOCOMMERCE - SHOP PAGE ENHANCEMENTS
   ============================================ */

/* Mobile shop filters and sorting */
@media (max-width: 767px) {
    /* Result count and ordering - stack */
    .woocommerce-result-count-wrapper,
    .woocommerce-ordering {
        width: 100% !important;
        margin-bottom: 1rem !important;
    }
    
    .woocommerce-ordering select {
        width: 100% !important;
        min-height: 48px !important;
        font-size: 16px !important;
    }
    
    /* Pagination - responsive */
    .woocommerce-pagination,
    .pagination {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 0.5rem !important;
    }
    
    .woocommerce-pagination a,
    .woocommerce-pagination span,
    .pagination a,
    .pagination span {
        min-width: 44px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 12px !important;
        font-size: 1rem !important;
    }
    
    /* Product filters - sidebar to dropdown */
    .sidebar,
    .widget-area {
        margin-bottom: 2rem !important;
    }
    
    .widget {
        margin-bottom: 1.5rem !important;
        padding: 1rem !important;
        border-radius: 8px !important;
        background: #f9fafb !important;
    }
    
    .widget-title,
    .widgettitle {
        font-size: 1.125rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Price filter slider */
    .price_slider_wrapper {
        padding: 1rem !important;
    }
    
    .price_slider {
        margin: 1rem 0 !important;
    }
}

/* ============================================
   PRODUCT PAGE - SINGLE PRODUCT
   ============================================ */

/* Mobile product page */
@media (max-width: 767px) {
    /* Stack gallery and details vertically */
    .single-product .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* Product gallery - full width */
    .product-gallery {
        width: 100% !important;
    }
    
    /* Variation buttons - smaller on mobile */
    .color-btn,
    .size-btn {
        min-width: 2.5rem !important;
        min-height: 2.5rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Product actions - stack vertically */
    .product-actions {
        flex-direction: column !important;
    }
    
    .product-actions button {
        width: 100% !important;
    }
    
    /* Quantity controls - touch friendly */
    .quantity-control button {
        min-width: 44px !important;
        min-height: 44px !important;
    }
}

/* Tablet product page */
@media (min-width: 768px) and (max-width: 1023px) {
    .single-product .grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ============================================
   CART PAGE - COMPREHENSIVE RESPONSIVE FIXES
   ============================================ */

/* Prevent any horizontal overflow */
.woocommerce-cart,
.woocommerce-cart * {
    box-sizing: border-box;
}

.woocommerce-cart main {
    overflow-x: hidden !important;
    width: 100%;
}

/* Ensure all images scale properly */
.woocommerce-cart img {
    max-width: 100%;
    height: auto;
}

/* Base touch targets for all interactive elements */
.woocommerce-cart button,
.woocommerce-cart a[role="button"],
.woocommerce-cart input[type="submit"],
.woocommerce-cart .qty-btn {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(236, 182, 19, 0.3);
}

/* Input fields - prevent iOS zoom */
.woocommerce-cart input[type="text"],
.woocommerce-cart input[type="number"],
.woocommerce-cart input#coupon_code {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100%;
}

/* Mobile Phones (< 768px) */
@media (max-width: 767px) {
    /* Container adjustments */
    .woocommerce-cart main.py-8 {
        padding-top: 1rem !important;
        padding-bottom: 2rem !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .woocommerce-cart .max-w-\[960px\] {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    /* Breadcrumbs - compact on mobile */
    .woocommerce-cart nav[aria-label="Breadcrumb"] {
        font-size: 0.75rem !important;
        margin-bottom: 1rem !important;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Page heading */
    .woocommerce-cart h1 {
        font-size: 1.5rem !important;
        line-height: 2rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Continue shopping link */
    .woocommerce-cart .flex.flex-col.md\:flex-row {
        gap: 0.75rem !important;
    }
    
    /* Cart item cards */
    .woocommerce-cart .flex.gap-4.bg-white.p-4 {
        gap: 0.75rem !important;
        padding: 0.75rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    /* Product image - optimized size */
    .woocommerce-cart .shrink-0.w-24.h-32 {
        width: 80px !important;
        min-width: 80px !important;
        height: 100px !important;
        flex-shrink: 0 !important;
    }
    
    .woocommerce-cart .shrink-0.w-24.h-32 img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* Product info section */
    .woocommerce-cart .flex-1.flex.flex-col {
        min-width: 0;
        flex: 1;
    }
    
    /* Product title - prevent overflow */
    .woocommerce-cart h3 {
        font-size: 0.875rem !important;
        line-height: 1.25rem !important;
        margin-bottom: 0.25rem !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* SKU and variations */
    .woocommerce-cart .text-xs {
        font-size: 0.625rem !important;
    }
    
    .woocommerce-cart .bg-gray-50.px-2 {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.625rem !important;
    }
    
    /* Quantity controls container */
    .woocommerce-cart .flex.items-center.gap-2 {
        gap: 0.5rem !important;
        flex-wrap: nowrap !important;
    }
    
    /* Quantity input - visible and touchable */
    .woocommerce-cart input.qty,
    .woocommerce-cart .quantity input[type="number"] {
        width: 50px !important;
        min-width: 50px !important;
        max-width: 50px !important;
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 16px !important;
        line-height: 40px !important;
        text-align: center !important;
        background: #ffffff !important;
        color: #1b180d !important;
        border: 1px solid #d1d5db !important;
        border-radius: 0.25rem !important;
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        -webkit-appearance: none !important;
        appearance: none !important;
        box-sizing: border-box !important;
    }
    
    /* Quantity buttons - proper touch targets */
    .woocommerce-cart .qty-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
        font-size: 20px !important;
        line-height: 1 !important;
        padding: 0 !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #ffffff !important;
        color: #1b180d !important;
        border: 1px solid #d1d5db !important;
        border-radius: 0.25rem !important;
        flex-shrink: 0 !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: rgba(236, 182, 19, 0.3) !important;
    }
    
    /* Price and remove row */
    .woocommerce-cart .flex.justify-between.items-center:has(> .flex.items-center.gap-4) {
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
        align-items: center !important;
    }
    
    /* Price display */
    .woocommerce-cart .text-primary.font-bold.text-lg {
        font-size: 1rem !important;
        white-space: nowrap;
    }
    
    /* Remove button - larger touch target */
    .woocommerce-cart a[aria-label="Supprimer"] {
        min-width: 44px !important;
        min-height: 44px !important;
        width: 44px !important;
        height: 44px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        touch-action: manipulation !important;
    }
    
    .woocommerce-cart a[aria-label="Supprimer"] .material-symbols-outlined {
        font-size: 1.25rem !important;
    }\n    \n    /* Cart summary - full width on mobile */
    .woocommerce-cart .lg\:w-\[380px\] {
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 2rem !important;
    }
    
    .woocommerce-cart .sticky.top-8 {
        position: relative !important;
        top: auto !important;
    }
    
    /* Summary padding */
    .woocommerce-cart .bg-white.rounded.p-6 {
        padding: 1rem !important;
    }
    
    .woocommerce-cart .bg-white.rounded.p-6 h2 {
        font-size: 1.125rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Summary rows */
    .woocommerce-cart .flex.justify-between.mb-4,
    .woocommerce-cart .flex.justify-between.mb-6 {
        gap: 0.5rem !important;
        align-items: flex-start !important;
    }
    
    .woocommerce-cart .flex.justify-between span {
        word-wrap: break-word;
    }
    
    /* Coupon section - stack vertically */
    .woocommerce-cart .mb-6 .flex.flex-col {
        width: 100% !important;
    }
    
    /* Coupon input - fully visible */
    .woocommerce-cart input#coupon_code,
    .woocommerce-cart input[name="coupon_code"] {
        width: 100% !important;
        min-height: 48px !important;
        padding: 0.75rem !important;
        margin: 0 !important;
        font-size: 16px !important;
        background: #ffffff !important;
        color: #1b180d !important;
        border: 1px solid #d1d5db !important;
        border-radius: 0.375rem !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        box-sizing: border-box !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }
    
    /* Coupon apply button */
    .woocommerce-cart button[name="apply_coupon"] {
        width: 100% !important;
        min-height: 48px !important;
        margin-top: 0.5rem !important;
        font-size: 16px !important;
        padding: 0.75rem 1rem !important;
        touch-action: manipulation !important;
    }
    
    /* Total section */
    .woocommerce-cart .flex.justify-between.items-center.mb-6 {
        gap: 1rem !important;
    }
    
    /* Checkout button */
    .woocommerce-cart a[href*="checkout"] {
        min-height: 52px !important;
        padding: 1rem !important;
        font-size: 1rem !important;
        font-weight: 700 !important;
        touch-action: manipulation !important;
    }
    
    /* Trust badges */
    .woocommerce-cart .grid.grid-cols-3 {
        gap: 0.5rem !important;
    }
    
    .woocommerce-cart .grid-cols-3 .material-symbols-outlined {
        font-size: 1.25rem !important;
    }
    
    .woocommerce-cart .text-\[9px\] {
        font-size: 0.625rem !important;
        line-height: 1.1 !important;
    }
    
    /* Empty cart */
    .woocommerce-cart .flex.flex-col.items-center.py-20 {
        padding: 2rem 1rem !important;
    }
    
    .woocommerce-cart .flex.flex-col.items-center h2 {
        font-size: 1.25rem !important;
        text-align: center;
    }
}

/* Very Small Screens (320px - 374px) */
@media (max-width: 374px) {
    .woocommerce-cart .shrink-0.w-24.h-32 {
        width: 70px !important;
        height: 90px !important;
    }
    
    .woocommerce-cart input.qty {
        width: 44px !important;
        min-width: 44px !important;
        height: 36px !important;
        font-size: 14px !important;
        line-height: 36px !important;
    }
    
    .woocommerce-cart .qty-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
    }
    
    .woocommerce-cart h1 {
        font-size: 1.25rem !important;
    }
    
    .woocommerce-cart .text-primary.font-bold.text-lg {
        font-size: 0.875rem !important;
    }
}

/* Tablets (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .woocommerce-cart main.py-8 {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
    
    /* Stack layout on tablet */
    .woocommerce-cart .flex.flex-col.lg\:flex-row {
        flex-direction: column !important;
    }
    
    .woocommerce-cart .lg\:w-\[380px\] {
        width: 100% !important;
        margin-top: 2rem !important;
    }
    
    /* Comfortable sizing */
    .woocommerce-cart .shrink-0.w-24.h-32 {
        width: 100px !important;
        height: 120px !important;
    }
    
    .woocommerce-cart input.qty {
        width: 60px !important;
        height: 44px !important;
    }
    
    .woocommerce-cart .qty-btn {
        width: 44px !important;
        height: 44px !important;
    }
}

/* Landscape Mobile (small height) */
@media (max-width: 767px) and (max-height: 500px) {
    .woocommerce-cart .sticky {
        position: relative !important;
    }
    
    .woocommerce-cart main.py-8 {
        padding-top: 0.5rem !important;
        padding-bottom: 1rem !important;
    }
}

/* Fix for iOS safe areas */
@supports (padding-top: env(safe-area-inset-top)) {
    @media (max-width: 767px) {
        .woocommerce-cart main {
            padding-bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
        }
    }
}
@media (max-width: 767px) {
    /* Main container padding adjustment */
    .woocommerce-cart main.py-8 {
        padding-top: 1rem !important;
        padding-bottom: 2rem !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Page heading - better mobile spacing */
    .woocommerce-cart h1 {
        font-size: 1.5rem !important;
        line-height: 2rem !important;
    }
    
    .woocommerce-cart .flex.flex-wrap.justify-between {
        flex-direction: column !important;
        gap: 1rem !important;
        align-items: flex-start !important;
    }
    
    /* Cart item card - optimize for mobile */
    .woocommerce-cart .flex.gap-4.bg-white.p-4 {
        gap: 0.75rem !important;
        padding: 0.75rem !important;
    }
    
    /* Product image - smaller on mobile */
    .woocommerce-cart .shrink-0.w-24.h-32 {
        width: 80px !important;
        height: 100px !important;
        min-width: 80px !important;
    }
    
    .woocommerce-cart .shrink-0.w-24.h-32 img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* Product title - adjust size */
    .woocommerce-cart h3 {
        font-size: 0.875rem !important;
        line-height: 1.25rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    /* SKU and meta - smaller text */
    .woocommerce-cart .text-xs {
        font-size: 0.625rem !important;
    }
    
    /* Quantity controls - larger touch targets */
    .woocommerce-cart .qty-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
        font-size: 20px !important;
        line-height: 1 !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        touch-action: manipulation !important;
    }
    
    .woocommerce-cart input.qty {
        width: 50px !important;
        height: 40px !important;
        min-height: 40px !important;
        font-size: 16px !important;
        line-height: 40px !important;
        flex-shrink: 0 !important;
    }
    
    /* CRITICAL FIX: Quantity & Price Row - Stack vertically to prevent overlap */
    .woocommerce-cart .cart-quantity-price-row,
    .woocommerce-cart .flex.flex-col.sm\\:flex-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }
    
    /* Price and remove row - separate line below quantity */
    .woocommerce-cart .cart-quantity-price-row > div:last-child,
    .woocommerce-cart .flex.items-center.gap-3 {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
    }
    
    /* Legacy selectors for older structure */
    .woocommerce-cart .flex.justify-between.items-center:last-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }
    
    .woocommerce-cart .flex.items-center.gap-4 {
        width: 100% !important;
        justify-content: space-between !important;
    }
    
    /* Price - better visibility */
    .woocommerce-cart .text-primary.font-bold.text-lg {
        font-size: 1rem !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
    
    /* Remove button - proper touch target */
    .woocommerce-cart a[aria-label="Supprimer"] {
        min-width: 44px !important;
        min-height: 44px !important;
        width: 44px !important;
        height: 44px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        touch-action: manipulation !important;
    }
    
    .woocommerce-cart a[aria-label="Supprimer"] .material-symbols-outlined {
        font-size: 1.25rem !important;
    }
    
    /* Cart summary sidebar - full width on mobile */
    .woocommerce-cart .lg\:w-\[380px\] {
        width: 100% !important;
        margin-top: 2rem !important;
    }
    
    .woocommerce-cart .sticky {
        position: relative !important;
        top: auto !important;
    }
    
    /* Cart summary padding */
    .woocommerce-cart .bg-white.rounded.p-6 {
        padding: 1rem !important;
    }
    
    /* Summary title */
    .woocommerce-cart .bg-white.rounded.p-6 h2 {
        font-size: 1.125rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Summary rows - better spacing */
    .woocommerce-cart .flex.justify-between {
        gap: 0.5rem !important;
    }
    
    /* Coupon input - full width and visible */
    .woocommerce-cart .flex.gap-2 {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .woocommerce-cart .flex.gap-2 input[type="text"],
    .woocommerce-cart .flex.gap-2 input[name="coupon_code"],
    .woocommerce-cart input#coupon_code {
        width: 100% !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: white !important;
        color: #1b180d !important;
        border: 1px solid #d1d5db !important;
        padding: 0.75rem !important;
        font-size: 14px !important;
        min-height: 44px !important;
        border-radius: 0.375rem !important;
    }
    
    .woocommerce-cart .flex.gap-2 button {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 14px !important;
    }
    
    /* Checkout button - larger touch target */
    .woocommerce-cart a[href*="checkout"] {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
        font-size: 1rem !important;
        min-height: 48px !important;
    }
    
    /* Trust badges - better spacing */
    .woocommerce-cart .grid-cols-3 {
        gap: 0.5rem !important;
    }
    
    .woocommerce-cart .grid-cols-3 .material-symbols-outlined {
        font-size: 1.25rem !important;
    }
    
    .woocommerce-cart .text-\[9px\] {
        font-size: 0.625rem !important;
        line-height: 1 !important;
    }
    
    /* Breadcrumbs - smaller on mobile */
    .woocommerce-cart nav[aria-label="Breadcrumb"] {
        font-size: 0.75rem !important;
        margin-bottom: 1rem !important;
    }
    
    .woocommerce-cart nav[aria-label="Breadcrumb"] .material-symbols-outlined {
        font-size: 14px !important;
    }
    
    /* Empty cart - better mobile display */
    .woocommerce-cart .flex.flex-col.items-center.py-20 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .woocommerce-cart .flex.flex-col.items-center h2 {
        font-size: 1.25rem !important;
    }
    
    /* Continue shopping link - full width button on mobile */
    .woocommerce-cart .text-sm.underline {
        width: 100% !important;
        text-align: center !important;
        padding: 0.75rem !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 0.375rem !important;
        text-decoration: none !important;
        display: block !important;
        margin-top: 1rem !important;
    }
}

/* Tablet Optimization (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Main container - better tablet padding */
    .woocommerce-cart main.py-8 {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
    
    /* Cart layout - stack on tablet */
    .woocommerce-cart .flex.flex-col.lg\:flex-row {
        flex-direction: column !important;
    }
    
    /* Cart summary - full width on tablet */
    .woocommerce-cart .lg\:w-\[380px\] {
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 2rem !important;
    }
    
    /* Product cards - comfortable spacing */
    .woocommerce-cart .flex.gap-4.bg-white.p-4 {
        padding: 1.25rem !important;
    }
    
    /* Image - medium size on tablet */
    .woocommerce-cart .shrink-0.w-24.h-32 {
        width: 100px !important;
        height: 120px !important;
    }
    
    /* Touch targets - tablet optimized */
    .woocommerce-cart .qty-btn {
        width: 40px !important;
        height: 40px !important;
    }
    
    .woocommerce-cart input.qty {
        width: 60px !important;
        height: 40px !important;
    }
}

/* Large Tablets and Small Laptops (1024px - 1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
    /* Main container - optimal padding */
    .woocommerce-cart main.py-8 {
        padding-left: 3rem !important;
        padding-right: 3rem !important;
    }
    
    /* Cart summary - proportional width */
    .woocommerce-cart .lg\:w-\[380px\] {
        width: 340px !important;
    }
}

/* Landscape Mobile (small height) */
@media (max-width: 767px) and (max-height: 500px) {
    /* Adjust sticky elements */
    .woocommerce-cart .sticky {
        position: relative !important;
    }
    
    /* Reduce vertical spacing */
    .woocommerce-cart main.py-8 {
        padding-top: 0.5rem !important;
        padding-bottom: 1rem !important;
    }
    
    .woocommerce-cart .flex.flex-col.gap-4 {
        gap: 0.5rem !important;
    }
}

/* Very Small Screens (320px - 374px) */
@media (max-width: 374px) {
    /* Extra compact layout */
    .woocommerce-cart .shrink-0.w-24.h-32 {
        width: 70px !important;
        height: 90px !important;
    }
    
    .woocommerce-cart h1 {
        font-size: 1.25rem !important;
    }
    
    .woocommerce-cart .text-primary.font-bold.text-lg {
        font-size: 0.875rem !important;
    }
    
    /* Quantity controls - compact */
    .woocommerce-cart .qty-btn {
        width: 32px !important;
        height: 32px !important;
    }
    
    .woocommerce-cart input.qty {
        width: 40px !important;
        height: 32px !important;
    }
    
    /* Stack quantity and price */
    .woocommerce-cart .flex.justify-between.items-center:last-child {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    .woocommerce-cart .flex.items-center.gap-2 {
        width: 100% !important;
        justify-content: space-between !important;
    }
    
    .woocommerce-cart .flex.items-center.gap-4 {
        width: 100% !important;
        justify-content: space-between !important;
    }
}

/* Prevent horizontal scroll on all devices */
.woocommerce-cart * {
    max-width: 100%;
}

.woocommerce-cart img {
    height: auto;
}

/* Ensure buttons are always accessible */
.woocommerce-cart button,
.woocommerce-cart a[role="button"],
.woocommerce-cart input[type="submit"] {
    min-height: 44px;
    touch-action: manipulation;
}

/* Improve form element accessibility on touch devices */
.woocommerce-cart input[type="text"],
.woocommerce-cart input[type="number"] {
    font-size: 16px !important; /* Prevents zoom on iOS */
    min-height: 44px;
    background-color: white !important;
    color: #1b180d !important;
}

/* Critical fix for mobile inputs - ensure visibility */
@media (max-width: 767px) {
    .woocommerce-cart input.qty,
    .woocommerce-cart input[type="number"] {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: white !important;
        color: #1b180d !important;
        border: 1px solid #d1d5db !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }
    
    .woocommerce-cart input[name="coupon_code"],
    .woocommerce-cart #coupon_code {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        background: white !important;
        color: #1b180d !important;
    }
    
    /* Ensure quantity controls are properly spaced */
    .woocommerce-cart .flex.items-center.gap-2 {
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }
    
    /* Fix for webkit number input spinners */
    .woocommerce-cart input[type="number"]::-webkit-inner-spin-button,
    .woocommerce-cart input[type="number"]::-webkit-outer-spin-button {
        -webkit-appearance: none !important;
        margin: 0 !important;
    }
}

/* Legacy cart table styles (fallback) */
@media (max-width: 767px) {
    .woocommerce-cart-form table {
        display: block !important;
    }
    
    .woocommerce-cart-form thead {
        display: none !important;
    }
    
    .woocommerce-cart-form tbody,
    .woocommerce-cart-form tr {
        display: block !important;
        width: 100% !important;
    }
    
    .woocommerce-cart-form tr {
        margin-bottom: 1.5rem !important;
        padding: 1rem !important;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        background: white;
    }
    
    .woocommerce-cart-form td {
        display: block !important;
        width: 100% !important;
        text-align: left !important;
        padding: 0.5rem 0 !important;
        border: none !important;
    }
    
    .woocommerce-cart-form td::before {
        content: attr(data-title) ": ";
        font-weight: 600;
        margin-right: 0.5rem;
    }
    
    /* Cart image smaller on mobile */
    .woocommerce-cart-form .product-thumbnail img {
        max-width: 80px !important;
    }
    
    /* Quantity controls - larger touch targets */
    .quantity input {
        min-width: 60px !important;
        min-height: 44px !important;
    }
    
    /* Cart totals - full width */
    .cart-collaterals {
        width: 100% !important;
        margin-top: 2rem !important;
    }
}

/* ============================================
   CHECKOUT PAGE
   ============================================ */

/* Mobile checkout - single column */
@media (max-width: 1023px) {
    .woocommerce-checkout .grid,
    .checkout .grid {
        grid-template-columns: 1fr !important;
    }
    
    .lg\\:col-span-7,
    .lg\\:col-span-5,
    .xl\\:col-span-8,
    .xl\\:col-span-4 {
        grid-column: span 1 / span 1 !important;
    }
    
    /* Form fields - full width */
    .woocommerce-billing-fields .form-row,
    .woocommerce-shipping-fields .form-row {
        width: 100% !important;
        margin-bottom: 1rem !important;
    }
    
    /* Payment methods - better spacing */
    .wc_payment_method {
        padding: 0.75rem !important;
    }
    
    /* Place order button - full width touch friendly */
    #place_order {
        width: 100% !important;
        min-height: 56px !important;
        font-size: 1.125rem !important;
    }
}

/* Mobile checkout - compact header */
@media (max-width: 767px) {
    .checkout h1 {
        font-size: 1.75rem !important;
    }
    
    /* Progress steps - smaller */
    .checkout .flex.items-center.gap-2 {
        flex-wrap: wrap !important;
        font-size: 0.75rem !important;
    }
}

/* ============================================
   MY ACCOUNT PAGE
   ============================================ */

/* Mobile My Account - vertical tabs */
@media (max-width: 767px) {
    /* Tab navigation - vertical stack */
    .my-account-tabs {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .my-account-tabs a {
        width: 100% !important;
        justify-content: flex-start !important;
        padding: 1rem !important;
    }
    
    /* Orders table - card layout */
    .woocommerce-orders-table {
        display: block !important;
    }
    
    .woocommerce-orders-table thead {
        display: none !important;
    }
    
    .woocommerce-orders-table tbody,
    .woocommerce-orders-table tr {
        display: block !important;
        width: 100% !important;
    }
    
    .woocommerce-orders-table tr {
        margin-bottom: 1rem !important;
        padding: 1rem !important;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        background: white;
    }
    
    .woocommerce-orders-table td {
        display: flex !important;
        justify-content: space-between !important;
        padding: 0.5rem 0 !important;
        border: none !important;
    }
    
    .woocommerce-orders-table td::before {
        content: attr(data-title);
        font-weight: 600;
    }
    
    /* Profile form - full width inputs */
    .my-account-profile input,
    .my-account-profile select,
    .my-account-profile textarea {
        width: 100% !important;
    }
}

/* Tablet My Account */
@media (min-width: 768px) and (max-width: 1023px) {
    .my-account-tabs {
        flex-wrap: wrap !important;
    }
    
    .my-account-tabs a {
        flex: 1 1 auto !important;
        min-width: 120px !important;
    }
}

/* ============================================
   FORMS - RESPONSIVE
   ============================================ */

/* Mobile forms - full width fields */
@media (max-width: 767px) {
    .woocommerce form .form-row {
        width: 100% !important;
        float: none !important;
    }
    
    .woocommerce form input[type="text"],
    .woocommerce form input[type="email"],
    .woocommerce form input[type="tel"],
    .woocommerce form input[type="password"],
    .woocommerce form select,
    .woocommerce form textarea {
        width: 100% !important;
        min-height: 48px !important;
        font-size: 16px !important; /* Prevent zoom on iOS */
        padding: 0.75rem 1rem !important;
    }
    
    /* Buttons - full width and touch friendly */
    .woocommerce form button[type="submit"],
    .woocommerce form input[type="submit"] {
        width: 100% !important;
        min-height: 48px !important;
        font-size: 1rem !important;
    }
}

/* ============================================
   TABLES - RESPONSIVE
   ============================================ */

/* Mobile tables - scroll horizontally or convert to cards */
@media (max-width: 767px) {
    /* Generic table wrapper for horizontal scroll */
    .table-wrapper,
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin: 1rem 0 !important;
    }
    
    table {
        min-width: 600px !important;
        font-size: 14px !important;
    }
    
    table th,
    table td {
        padding: 8px !important;
        white-space: nowrap !important;
    }
    
    /* Size guide tables - horizontal scroll */
    .size-guide-table {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        display: block !important;
    }
    
    .size-guide-table table {
        min-width: 500px !important;
    }
    
    /* Order history tables - card layout */
    .woocommerce-orders-table {
        display: block !important;
    }
    
    .woocommerce-orders-table thead {
        display: none !important;
    }
    
    .woocommerce-orders-table tbody,
    .woocommerce-orders-table tr {
        display: block !important;
        width: 100% !important;
        margin-bottom: 1rem !important;
    }
    
    .woocommerce-orders-table td {
        display: flex !important;
        justify-content: space-between !important;
        padding: 12px !important;
        border-bottom: 1px solid #e5e7eb !important;
    }
    
    .woocommerce-orders-table td::before {
        content: attr(data-title) ": " !important;
        font-weight: 700 !important;
    }
}

/* ============================================
   FOOTER - RESPONSIVE
   ============================================ */

/* Mobile footer - single column */
@media (max-width: 767px) {
    footer .flex.flex-col.md\\:flex-row {
        flex-direction: column !important;
    }
    
    footer .grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Footer sections spacing */
    footer > div > div > div {
        margin-bottom: 2rem !important;
    }
    
    /* Social links - center on mobile */
    footer .flex.gap-4 {
        justify-content: center !important;
    }
    
    /* Newsletter form - full width */
    footer #newsletter-form input,
    footer #newsletter-form button {
        width: 100% !important;
    }
    
    /* Copyright - center */
    footer .pt-8 {
        text-align: center !important;
    }
}

/* Tablet footer - 2 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    footer .grid-cols-1.sm\\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* ============================================
   FORMS & INPUTS - MOBILE OPTIMIZATION
   ============================================ */

/* All form inputs - mobile friendly */
@media (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    input[type="url"],
    select,
    textarea {
        width: 100% !important;
        min-height: 48px !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 12px 16px !important;
        border-radius: 8px !important;
    }
    
    textarea {
        min-height: 120px !important;
    }
    
    select {
        background-size: 20px !important;
        padding-right: 40px !important;
    }
    
    /* Form labels - readable */
    label {
        font-size: 14px !important;
        font-weight: 600 !important;
        margin-bottom: 8px !important;
        display: block !important;
    }
    
    /* Form rows - full width */
    .form-row {
        width: 100% !important;
        margin-bottom: 16px !important;
    }
    
    /* Checkbox and radio - larger touch targets */
    input[type="checkbox"],
    input[type="radio"] {
        min-width: 24px !important;
        min-height: 24px !important;
        margin-right: 12px !important;
    }
    
    /* Submit buttons - prominent */
    input[type="submit"],
    button[type="submit"],
    .form-submit button {
        width: 100% !important;
        min-height: 56px !important;
        font-size: 18px !important;
        font-weight: 700 !important;
        border-radius: 12px !important;
        margin-top: 24px !important;
    }
    
    /* Error messages - visible */
    .woocommerce-error,
    .woocommerce-message,
    .woocommerce-info {
        padding: 16px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
    }
}

/* ============================================
   HOMEPAGE - RESPONSIVE
   ============================================ */

/* Hero section mobile - Fix for front-page.php */
@media (max-width: 767px) {
    /* Target the actual hero container */
    div[style*="background-image"]:has(h1),
    [class*="min-h-"][style*="background-image"] {
        min-height: 60vh !important;
        padding: 2rem 1rem !important;
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
    }
    
    /* Hero text responsive */
    div[style*="background-image"] h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }
    
    div[style*="background-image"] h2,
    div[style*="background-image"] p {
        font-size: 1rem !important;
    }
    
    /* CTA buttons - stack vertically */
    div[style*="background-image"] .flex.gap-4 {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    div[style*="background-image"] .flex.gap-4 a,
    div[style*="background-image"] .flex.gap-4 button {
        width: 100% !important;
    }
}

/* Hero section tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    div[style*="background-image"]:has(h1),
    [class*="min-h-"][style*="background-image"] {
        min-height: 500px !important;
        padding: 3rem 2rem !important;
    }
    
    div[style*="background-image"] h1 {
        font-size: 3rem !important;
    }
}

/* Hero section desktop - ensure image displays properly */
@media (min-width: 1024px) {
    div[style*="background-image"]:has(h1),
    [class*="min-h-"][style*="background-image"] {
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
    }
}


/* Featured sections - responsive grids */
@media (max-width: 639px) {
    .featured-products,
    .featured-categories {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .featured-products,
    .featured-categories {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* ============================================
   CONTACT PAGE
   ============================================ */

@media (max-width: 767px) {
    .contact-page .grid {
        grid-template-columns: 1fr !important;
    }
    
    .contact-info {
        order: 2 !important;
    }
    
    .contact-form {
        order: 1 !important;
    }
}

/* ============================================
   TABLES - RESPONSIVE
   ============================================ */

/* Generic table responsive */
@media (max-width: 767px) {
    table.responsive-table {
        display: block !important;
    }
    
    table.responsive-table thead {
        display: none !important;
    }
    
    table.responsive-table tbody,
    table.responsive-table tr {
        display: block !important;
        width: 100% !important;
    }
    
    table.responsive-table tr {
        margin-bottom: 1rem !important;
        padding: 1rem !important;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
    }
    
    table.responsive-table td {
        display: block !important;
        width: 100% !important;
        text-align: left !important;
        padding: 0.5rem 0 !important;
        border: none !important;
    }
}

/* ============================================
   UTILITIES - RESPONSIVE HELPERS
   ============================================ */

/* Hide on mobile */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .hide-tablet {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 1024px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Show only on mobile */
.show-mobile {
    display: none !important;
}

@media (max-width: 767px) {
    .show-mobile {
        display: block !important;
    }
}

/* ============================================
   ANIMATIONS & TRANSITIONS
   ============================================ */

/* Smooth transitions for responsive changes */
@media (prefers-reduced-motion: no-preference) {
    * {
        transition-property: transform, opacity;
        transition-duration: 0.2s;
        transition-timing-function: ease-in-out;
    }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */

/* CRITICAL FIX: Remove ALL transforms on touch devices to align click areas with visual elements */
@media (hover: none), (pointer: coarse) {
    /* Disable all hover transforms to prevent click offset issues */
    *:hover,
    *[class*="hover:scale"],
    *[class*="hover:translate"],
    *[class*="group-hover:scale"],
    *[class*="group-hover:translate"] {
        transform: none !important;
    }
    
    /* Only allow subtle active states that don't affect layout */
    *:active {
        opacity: 0.8 !important;
        transform: none !important;
    }
    
    /* Ensure interactive elements have proper touch targets (min 44x44px) */
    button,
    a,
    input[type="button"],
    input[type="submit"],
    [role="button"],
    [onclick] {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
    }
}

/* ============================================
   LANDSCAPE ORIENTATION FIXES
   ============================================ */

/* Mobile landscape - optimize height */
@media (max-width: 767px) and (orientation: landscape) {
    .mobile-menu-sidebar {
        max-height: 100vh !important;
        overflow-y: auto !important;
    }
    
    /* Modals - adjust height */
    #cart-modal > div,
    #wishlist-modal > div {
        max-height: 100vh !important;
    }
    
    /* Hero sections - reduce height */
    .hero-section {
        min-height: 50vh !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    header,
    footer,
    .mobile-menu-sidebar,
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt !important;
    }
}

/* ============================================
   LARGE SCREENS OPTIMIZATION
   ============================================ */

@media (min-width: 1440px) {
    .layout-container {
        max-width: 1400px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

@media (min-width: 1920px) {
    .layout-container {
        max-width: 1600px !important;
    }
    
    /* Product grids - 5 columns on very large screens */
    .products-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Touch device specific fixes - Applied via JS class */
.touch-device a:not(header button),
.touch-device button:not(header button),
.touch-device [role="button"]:not(header button),
.touch-device [onclick]:not(header button) {
    transform: none !important;
    will-change: auto !important;
    min-height: 44px;
    min-width: 44px;
}

/* Keep header buttons working normally */
header button {
    transform: none !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.touch-device .product-card img,
.touch-device *[class*="hover:scale"]:not(header button),
.touch-device *[class*="group-hover:scale"] {
    transform: none !important;
    transition: opacity 0.3s ease !important;
}

.touch-device *:hover:not(header *):not(header) {
    transform: none !important;
}

/* Ensure clickable elements are always on top */
a, button, [role="button"], [onclick] {
    position: relative;
    z-index: 1;
}

/* Ensure product card links cover the intended area */
.product-card > div > a {
    display: block;
    position: relative;
    z-index: 1;
}

/* Wishlist buttons should be on top and always visible */
.product-wishlist-btn {
    position: absolute;
    z-index: 30 !important; /* Increased from 20 to ensure it's above badges (z-10) */
    transform: none !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    /* Ensure button is tappable on touch devices */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    /* Remove all focus/outline rings */
    outline: none !important;
    border: none !important;
}

.product-wishlist-btn:focus,
.product-wishlist-btn:active,
.product-wishlist-btn:hover {
    outline: none !important;
    border: none !important;
}

/* Mobile: Keep desktop styling, only ensure visibility */
@media (max-width: 1023px) {
    .product-wishlist-btn {
        /* Always visible on mobile (no hover required) */
        opacity: 1 !important;
        visibility: visible !important;
        /* Minimum touch target for accessibility */
        min-width: 44px !important;
        min-height: 44px !important;
    }
}


/* Prevent wishlist button from being affected by product card hover states */
.product-card:hover .product-wishlist-btn,
.group:hover .product-wishlist-btn {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Fix for gradient overlays blocking clicks - only apply to decorative overlays */
.product-card .absolute.inset-0[class*="gradient"],
.product-card .absolute.inset-0[class*="bg-black"],
.product-card .absolute.inset-0[class*="bg-white"] {
    pointer-events: none !important;
}

/* Mobile menu overlay specific - CRITICAL: Must be completely invisible by default */
#mobile-menu-overlay {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* Only show overlay when explicitly not hidden and menu is open */
#mobile-menu-overlay:not(.hidden) {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure it stays hidden when marked as hidden */
#mobile-menu-overlay.hidden,
#mobile-menu-overlay.pointer-events-none {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Product card hover overlays that are off-screen */
.product-card [class*="translate-y-full"] {
    pointer-events: none !important;
}

/* Mobile Filters Sidebar (matches mobile menu pattern) */
@media (max-width: 1023px) {
    #mobile-filters-sidebar {
        -webkit-overflow-scrolling: touch;
    }
    
    #mobile-filters-content {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Apply Filters button styling */
    #mobile-filters-apply {
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        transition: all 0.2s ease;
    }
    
    #mobile-filters-apply:active {
        transform: scale(0.98);
        box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
    }
    
    /* Ensure filters are touch-friendly in mobile sidebar */
    #mobile-filters-content input[type="checkbox"] {
        min-width: 20px !important;
        min-height: 20px !important;
    }
    
    #mobile-filters-content label {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        font-size: 15px !important;
    }
    
    #mobile-filters-content select {
        min-height: 44px !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 0.75rem !important;
    }
    
    #mobile-filters-content h3 {
        font-size: 1.125rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Price slider in mobile panel */
    #mobile-filters-content #price-slider {
        min-height: 44px !important;
    }
    
    #mobile-filters-content input[type="number"] {
        font-size: 16px !important; /* Prevents zoom on iOS */
        min-height: 44px !important;
    }
}

/* Product card specific fixes */
.product-card {
    position: relative;
    transform: none !important;
}

.product-card a {
    display: block;
    transform: none !important;
    pointer-events: auto !important;
}

.product-card img {
    transform: none !important;
    pointer-events: none !important;
}

.product-card button {
    pointer-events: auto !important;
    transform: none !important;
}

/* Ensure absolute positioned decorative elements don't block parent links */
.product-card .absolute:not(button):not(a):not([role="button"]) {
    pointer-events: none !important;
}

/* But ensure buttons and links ARE clickable */
.product-card button,
.product-card a,
.product-card [role="button"] {
    pointer-events: auto !important;
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS (CONTINUED)
   ============================================ */

/* Focus states - keyboard navigation */
*:focus-visible {
    outline: 2px solid #ecb613 !important;
    outline-offset: 2px !important;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: #ecb613;
    color: #000;
    padding: 1rem;
    z-index: 9999;
    text-decoration: none;
}

.skip-to-content:focus {
    top: 0;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   DARK MODE RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Ensure dark mode images have proper contrast */
    img {
        opacity: 0.9;
    }
}

/* ============================================
   PRODUCT CARD "VOIR DÉTAILS" VISIBILITY FIX
   ============================================ */

/* Desktop hover overlay - ensure button is clearly visible */
@media (min-width: 1024px) {
    /* Enhance overlay gradient for better button visibility */
    .product-card .group-hover\:translate-y-0 {
        z-index: 5;
    }
    
    /* Ensure button has maximum contrast and visibility */
    .product-card .group-hover\:translate-y-0 button {
        position: relative;
        z-index: 6;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        /* Ensure text is fully opaque */
        color: rgb(15 23 42) !important; /* slate-900 with full opacity */
        font-weight: 700 !important;
        /* Add subtle text shadow for clarity on all backgrounds */
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }
    
    /* Ensure overlay doesn't reduce button visibility */
    .product-card .bg-gradient-to-t {
        backdrop-filter: none !important;
    }
}

/* Mobile button - ensure maximum visibility */
@media (max-width: 1023px) {
    .product-card button[class*="lg:hidden"] {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        /* Ensure text is fully opaque */
        color: rgb(15 23 42) !important; /* slate-900 with full opacity */
        font-weight: 700 !important;
        /* Enhance contrast */
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }
}

/* Ensure all "Voir détails" buttons are accessible and visible */
.product-card button {
    /* Prevent any opacity inheritance */
    opacity: 1 !important;
    /* Ensure proper stacking */
    position: relative;
    z-index: 2;
    /* Prevent transform issues */
    transform: translateZ(0);
    /* Smooth transitions */
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* Hover state enhancement for better feedback */
.product-card button:hover {
    transform: translateY(-1px) translateZ(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Active state for better user feedback */
.product-card button:active {
    transform: translateY(0) translateZ(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

/* Focus state for accessibility */
.product-card button:focus {
    outline: 2px solid rgb(234 179 8); /* yellow-600 */
    outline-offset: 2px;
}

/* ============================================
   END OF RESPONSIVE CSS
   ============================================ */
