/* Responsive CSS - Mobile Optimizations */

nav.container.main-nav {
   padding: 1rem 2rem;
}

/* Product Images - Prevent cutting on mobile - 30% taller (260px) */
@media (max-width: 768px) {
    .product-card img, 
    .featured-item img,
    .collection-item img,
    .product-image img {
        height: 260px !important;
        object-fit: contain !important;
        width: 100% !important;
    }
}

/* Product Attributes Styling (Mobile & Desktop) */
.product-attributes-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 0.6rem;
}

.product-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 22px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.product-attributes.colors {
    margin-bottom: 2px;
}

.product-attributes.sizes {
    margin-top: 2px;
}

.attr-color {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #ddd;
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.attr-text {
    font-size: 0.75rem;
    padding: 2px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    color: #555;
    font-weight: 500;
}

.attr-more {
    font-size: 0.75rem;
    color: #888;
    font-weight: 500;
}

/* Fix for Menu Style (White background) */
@media (max-width: 992px) {
    header, nav {
        background-color: #ffffff !important;
    }
}

/* Header Mobile Basic Fixes & Layout */
@media (max-width: 992px) {
    /* Main Layout & Spacing */
    main {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    /* Reduce top margin for sliders container on index */
    .sliders-container {
        margin-top: 60px !important;
        order: 1; /* Reordering: Step 1 */
    }

    /* Hide top bar on mobile to save space */
    .header-top-bar {
        display: none !important;
    }

    .main-nav {
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        padding: 0.8rem 1rem !important;
        gap: 0 !important;
    }

    .logo {
        margin-right: 0 !important;
        flex: 1;
        justify-content: center; /* Center logo if preferred, or left */
        font-size: 1.2rem !important;
        min-width: 0; /* Allow shrinking */
        order: 2;
        justify-content: flex-start !important; /* Align left next to toggle */
    }
    
    .logo img {
        max-height: 40px !important;
        max-width: 100%; /* Prevent overflow */
        object-fit: contain;
    }

    .mobile-menu-toggle {
        display: block !important;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #333;
        cursor: pointer;
        padding: 5px;
        margin-right: 10px;
        order: 1;
    }

    .header-actions {
        order: 3;
        gap: 0.5rem !important; /* Reduce gap to prevent overflow */
        align-items: center;
        display: flex;
        flex-shrink: 0; /* Prevent actions from shrinking too much */
    }

    .mobile-search-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 35px;
        height: 35px;
        color: #333;
        font-size: 1.2rem;
        cursor: pointer;
    }
    
    .search-container {
        order: 4;
        width: 100%;
        margin: 0 !important;
        display: none; /* Hidden by default on mobile */
        padding: 0 10px;
    }
    
    .search-container.active {
        display: block;
    }
    
    /* Oculta el icono cuando el buscador está abierto */
    .main-nav.search-active #mobileSearchToggle {
        display: none !important;
    }
    
    /* Nav links menu mobile */
    .nav-links {
        order: 5;
        width: 100%;
        display: none;
        flex-direction: column;
        gap: 0;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .nav-links li:last-child {
        border-bottom: none;
    }
    
    .nav-links a {
        display: block;
        padding: 15px;
        width: 100%;
    }
    
    /* Hide desktop-only elements */
    .header-social-links, 
    .header-top-bar {
        display: none;
    }
    
    /* Fix cart icon position */
    .cart-icon {
        position: relative;
    }
    
    /* Auth link adjustments */
    .action-link span {
        display: none; /* Hide text on mobile, show only icon */
    }
    
    .action-login {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 35px;
        height: 35px;
        color: #333;
    }
}

/* Reorder Main Content and Compact Trust Banner on Mobile */
@media (max-width: 992px) {
    /* Section Ordering */
    /* Sliders is order 1 (above) */

    .featured-products-section {
        order: 2;
        padding-top: 1rem !important; /* Reduce padding between slider and products */
        padding-bottom: 1rem !important;
    }

    .temu-trust {
        order: 3;
        margin: 0 0 1.5rem 0 !important;
        padding: 0 10px !important; /* Add side padding for container */
        background: transparent !important;
    }

    .collection-section,
    .hero,
    .announcements-section {
        order: 4;
    }

    /* Compact Trust Banner Styling */
    .temu-trust-inner {
        padding: 0.75rem !important;
        border-radius: 12px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important; /* Remove gap, handle with padding */
        background: #fff !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
        border: 1px solid #eee !important;
        overflow: hidden !important;
    }

    .temu-trust-title {
        padding: 0.6rem !important;
        min-height: auto !important;
        background: #e7452e !important; /* Keep header red */
        color: #fff !important;
        justify-content: center !important;
        font-size: 0.9rem !important;
        margin: 0 !important;
    }
    
    .temu-trust-title i {
        font-size: 1rem !important;
    }

    .temu-trust-items {
        padding: 0.75rem 0.5rem !important;
        min-height: auto !important;
        background: #fff !important;
        color: #333 !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 1rem !important;
    }
    
    .temu-trust-items::after {
        display: none !important;
    }

    .temu-trust-item {
        padding: 0 !important;
        border: none !important;
        font-size: 0.8rem !important;
        color: #555 !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 0.3rem !important;
    }
    
    .temu-trust-item i {
        color: #e7452e !important;
        font-size: 0.9rem !important;
    }
    
    /* Hide separator lines */
    .temu-trust-item + .temu-trust-item::before {
        display: none !important;
    }

    .temu-trust-footer {
        padding: 0.6rem 0.75rem !important;
        margin: 0 !important;
        border-top: 1px solid #f0f0f0 !important;
        background: #f9f9f9 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
        flex-direction: row !important; /* Keep footer horizontal */
    }

    .temu-trust-warning {
        font-size: 0.7rem !important;
        line-height: 1.2 !important;
        flex: 1;
        text-align: left !important;
        color: #666 !important;
    }
    
    .temu-trust-link {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.75rem !important;
        background: #fff !important;
        color: #e7452e !important;
        border: 1px solid #e7452e !important;
        border-radius: 999px !important;
        white-space: nowrap !important;
        text-transform: uppercase;
        font-weight: 700 !important;
    }
}
