/* ===================================
   MEJORAS RESPONSIVE PARA MOBILE
=================================== */

/* Variables para colores */
:root {
    --primary-gold: #DAA520;
    --secondary-gold: #B8860B;
    --light-gold: #FFD700;
    --dark-bg: #1a1a1a;
}

/* Menu Hamburguesa - OCULTO por defecto en desktop */
.mobile-menu-toggle {
    display: none !important;
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    color: var(--light-gold);
}

.mobile-menu-toggle i {
    pointer-events: none;
}

/* Overlay para el menú móvil */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

/* Desktop - Nav normal horizontal */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .nav-overlay {
        display: none !important;
    }
    
    .nav {
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        flex-direction: row !important;
        padding: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
    }
    
    .nav::before {
        display: none !important;
    }
    
    .nav a {
        width: auto !important;
        padding: 0 !important;
        border: none !important;
    }
}

/* Ajustes generales para mobile */
@media (max-width: 768px) {
    body {
        background-attachment: scroll;
        overflow-x: hidden;
    }

    .container {
        padding: 0 15px;
    }

    /* Header mejorado */
    .header {
        position: sticky;
        padding: 12px 0;
    }

    .header .container {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .logo {
        flex: 1;
        justify-content: center;
        order: 2;
    }

    .logo-image {
        height: 45px;
    }

    /* Mostrar botón hamburguesa SOLO EN MOBILE */
    .mobile-menu-toggle {
        display: block !important;
        order: 1;
        flex-shrink: 0;
    }

    .header-actions {
        order: 3;
        gap: 10px;
        flex-shrink: 0;
    }

    /* Nav Mobile - OCULTAR por defecto */
    .nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2416 100%);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 0;
        padding: 80px 0 20px 0;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
        display: flex !important;
    }

    /* Nav Mobile ABIERTO */
    .nav.active {
        left: 0;
    }

    /* Links dentro del nav mobile */
    .nav a {
        width: 100%;
        padding: 18px 30px;
        font-size: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.3s;
        display: block !important;
    }

    .nav a:hover {
        background: rgba(218, 165, 32, 0.2);
        padding-left: 40px;
    }

    /* Botón de cerrar en el menú móvil */
    .mobile-nav-close {
        display: flex !important;
        position: absolute;
        top: 20px;
        right: 20px;
        background: transparent;
        border: none;
        color: white;
        font-size: 28px;
        cursor: pointer;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: all 0.3s;
        z-index: 10;
    }

    .mobile-nav-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--light-gold);
    }

    .cart-btn {
        font-size: 16px;
        padding: 8px 15px;
    }

    .cart-count {
        padding: 2px 6px;
        font-size: 11px;
        min-width: 18px;
    }

    /* Hero responsivo */
    .hero {
        height: 250px;
        margin-bottom: 30px;
    }

    .hero-content h1 {
        font-size: 36px;
        letter-spacing: 2px;
        text-align: center;
        padding: 0 15px;
    }

    .hero-subtitle {
        font-size: 16px;
        letter-spacing: 1px;
        text-align: center;
    }

    /* Secciones principales */
    .main-section,
    .products-section {
        padding: 30px 0;
    }

    .section-header {
        margin-bottom: 30px;
    }

    .section-header h2 {
        font-size: 24px;
        line-height: 1.3;
    }

    .subtitle-text {
        font-size: 14px;
        padding: 0 10px;
        line-height: 1.5;
    }

    /* Categorías - Carrusel */
    .product-categories {
        padding: 0 10px;
        margin-top: 30px;
    }

    .carousel-nav {
        width: 35px;
        height: 35px;
    }

    .carousel-nav.prev {
        left: -5px;
    }

    .carousel-nav.next {
        right: -5px;
    }

    .carousel-nav i {
        font-size: 16px;
    }

    .category-card {
        flex: 0 0 250px;
    }

    .category-image {
        height: 200px;
    }

    .category-card h3 {
        font-size: 16px;
        padding: 15px;
    }

    .carousel-indicators {
        margin-top: 15px;
    }

    .carousel-indicator {
        width: 8px;
        height: 8px;
    }

    .carousel-indicator.active {
        width: 24px;
    }

    /* Controles de productos */
    .products-controls {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .show-controls {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .show-controls span {
        width: 100%;
        text-align: center;
        margin-bottom: 8px;
    }

    .show-controls button {
        padding: 8px 16px;
        font-size: 13px;
        min-width: 45px;
    }

    .breadcrumb {
        order: -1;
        text-align: center;
        width: 100%;
        font-size: 13px;
    }

    .sort-controls {
        width: 100%;
    }

    .sort-controls select {
        width: 100%;
        padding: 10px;
        font-size: 14px;
    }

    /* Grid de productos */
    .products-grid-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .filters-sidebar {
        position: static;
        padding: 20px;
        margin-bottom: 20px;
    }

    .filter-group h3 {
        font-size: 15px;
    }

    .filter-group label {
        font-size: 14px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-card {
        margin: 0 auto;
        max-width: 100%;
        width: 100%;
    }

    .product-image {
        height: 250px;
    }

    .product-card h4 {
        min-height: auto;
        padding: 12px 15px 8px 15px;
        font-size: 15px;
    }

    .product-info {
        padding: 0 15px 15px 15px;
    }

    .product-price {
        font-size: 20px;
    }

    .view-detail-btn {
        padding: 12px;
        font-size: 15px;
    }

    /* Modal de detalles */
    .modal {
        padding: 10px;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        max-height: 95vh;
        border-radius: 12px;
    }

    .close-modal {
        right: 10px;
        top: 10px;
        width: 35px;
        height: 35px;
        font-size: 24px;
        z-index: 20;
    }

    .product-detail-container {
        grid-template-columns: 1fr;
        padding: 60px 15px 20px 15px;
        gap: 20px;
    }

    .main-image {
        height: 280px;
    }

    .thumbnail-images {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
        scrollbar-width: thin;
    }

    .thumbnail-images::-webkit-scrollbar {
        height: 6px;
    }

    .thumbnail-images::-webkit-scrollbar-thumb {
        background: var(--primary-gold);
        border-radius: 3px;
    }

    .thumbnail {
        width: 70px;
        height: 70px;
        flex-shrink: 0;
    }

    .product-detail-info h2 {
        font-size: 22px;
        line-height: 1.3;
    }

    .product-detail-price {
        font-size: 26px;
    }

    .product-detail-info h3 {
        font-size: 17px;
    }

    .product-detail-info p,
    .product-detail-info ul li {
        font-size: 14px;
    }

    .quantity-selector {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .quantity-controls {
        flex: 1;
        justify-content: center;
    }

    .quantity-controls button {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .quantity-controls input {
        width: 55px;
        padding: 6px;
        font-size: 16px;
    }

    .add-to-cart-large {
        padding: 14px;
        font-size: 16px;
    }

    /* Cart Sidebar */
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .cart-sidebar.active {
        right: 0;
    }

    .cart-header {
        padding: 15px;
    }

    .cart-header h3 {
        font-size: 18px;
    }

    .cart-items {
        padding: 15px;
    }

    .cart-item {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .cart-item-info {
        width: 100%;
    }

    .cart-item-name {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .cart-item-details {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .remove-item {
        align-self: center;
        margin-left: 0;
        margin-top: 5px;
    }

    .cart-footer {
        padding: 15px;
    }

    .cart-total {
        font-size: 18px;
    }

    .checkout-btn,
    .whatsapp-checkout-btn {
        padding: 12px;
        font-size: 15px;
    }

    .clear-cart-btn {
        font-size: 14px;
    }

    /* Checkout Modal */
    .checkout-modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .checkout-container {
        padding: 60px 15px 20px 15px;
    }

    .checkout-container > h2 {
        font-size: 22px;
        text-align: center;
        margin-bottom: 25px;
    }

    .checkout-sections {
        flex-direction: column;
        gap: 25px;
    }

    .checkout-form h3 {
        font-size: 17px;
        margin-bottom: 15px;
    }

    .checkout-form input,
    .checkout-form textarea {
        padding: 12px;
        font-size: 16px;
    }

    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .form-row .form-group {
        width: 100%;
    }

    .checkout-summary {
        padding: 20px;
        position: static;
        order: -1;
    }

    .checkout-summary h3 {
        font-size: 17px;
    }

    .checkout-item {
        font-size: 13px;
    }

    .checkout-total-row {
        font-size: 14px;
    }

    .checkout-total-row.total {
        font-size: 18px;
    }

    .payment-btn {
        padding: 12px;
        font-size: 16px;
    }

    .payment-methods {
        margin-top: 15px;
    }

    .payment-methods p {
        font-size: 12px;
    }

    .payment-icons i {
        font-size: 24px;
    }

    /* Success Modal */
    .success-modal-content {
        width: 90%;
        padding: 30px 20px;
    }

    .success-animation i {
        font-size: 60px;
    }

    .success-modal-content h2 {
        font-size: 22px;
    }

    .success-modal-content p {
        font-size: 14px;
    }

    /* Footer */
    .footer {
        padding: 20px 15px;
        margin-top: 40px;
        font-size: 13px;
    }

    .footer p {
        text-align: center;
        line-height: 1.5;
    }
}

/* Ajustes adicionales para pantallas muy pequeñas */
@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 28px;
        letter-spacing: 1px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .section-header h2 {
        font-size: 20px;
    }

    .product-detail-info h2 {
        font-size: 20px;
    }

    .product-detail-price {
        font-size: 24px;
    }

    .nav {
        width: 260px;
    }

    .product-image {
        height: 220px;
    }

    .main-image {
        height: 250px;
    }
}

/* Mejoras de performance para mobile */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }

    .product-card:hover,
    .category-card:hover {
        transform: none;
    }

    .cart-items,
    .modal-content,
    .thumbnail-images,
    .nav {
        -webkit-overflow-scrolling: touch;
    }

    input,
    textarea,
    select {
        font-size: 16px !important;
    }

    button {
        -webkit-appearance: none;
        appearance: none;
    }
}

/* Estilos para el botón de WhatsApp */
.whatsapp-checkout-btn {
    width: 100%;
    padding: 14px;
    background: #25D366;
    color: white;
    border: none;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.whatsapp-checkout-btn:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.whatsapp-checkout-btn i {
    font-size: 20px;
}

.whatsapp-checkout-btn.disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.whatsapp-checkout-btn.disabled:hover {
    background: #ccc;
    transform: none;
    box-shadow: none;
}

/* Animación para evitar flickering */
@media (max-width: 768px) {
    .nav {
        will-change: transform;
    }

    .cart-sidebar {
        will-change: transform;
    }
}
