/* ===== RAMOS CLÁSICOS - ESTILOS PRINCIPALES ===== */

/* Variables CSS para consistencia temática */
:root {
    /* Colores principales del tema */
    --ramos-primary: #d5a6bd;
    --ramos-dark: #2c2c2c;
    
    /* Variables del CTA (consistentes con el archivo principal) */
    --accent-pink: #d5a6bd;
    --dark-pink: #e8b4c8;
    --deep-rose: #8b1e6b;
    
    /* Tipografía */
    --font-primary: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--ramos-dark);
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===== GALLERY HERO SECTION =====  */
.gallery-hero {
    background: linear-gradient(90deg, #bba6b3 0%, #5c555a 100%);
    color: white;
    padding: 0.5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.gallery-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="petals" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23petals)"/></svg>');
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

.gallery-hero .hero-content {
    position: relative;
    z-index: 2;
}

.page-title {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.page-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

/* ===== FILTER SECTION ===== */
.filter-section {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.filter-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.filter-title {
    font-size: 1.5rem;
    color: #6d1e61;
    margin: 0;
    font-weight: 400;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.filter-btn {
    background: white;
    border: 2px solid var(--ramos-primary);
    color: var(--ramos-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-btn:hover {
    background: var(--ramos-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(213, 166, 189, 0.3);
}

.filter-btn.active {
    background: var(--ramos-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(213, 166, 189, 0.4);
}

.product-counter {
    margin-top: 1rem;
    color: #666;
    font-weight: var(--font-weight-medium);
}

/* ===== GALLERY SECTION ===== */
.gallery-section {
    padding: 4rem 0;
    min-height: 60vh;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* ===== LOADING STATE ===== */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--ramos-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--ramos-dark);
}

/* ===== MODAL STYLES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: white;
    transform: scale(1.1);
}

.modal-navigation {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
}

.modal-nav-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-nav-btn:hover {
    background: white;
    transform: scale(1.1);
}

#modal-prev {
    left: 1rem;
}

#modal-next {
    right: 1rem;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    max-height: 80vh;
    overflow: auto;
    min-height: 400px;
}

.modal-image {
    aspect-ratio: 1;
    background: #EFECE3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 100%;
}

.modal-info {
    padding: 2.2rem 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 320px;
    overflow-y: auto;
    text-align: center;
    height: 100%;
    gap: 1.2rem;
    background: white;
}

.modal-info h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    margin-top: 0;
    font-weight: 600;
    line-height: 1.15;
}

.modal-info p {
    font-size: 1.18rem;
    color: #666;
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
    font-weight: 400;
}

.modal-actions {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 1.2rem;
}

.modal-whatsapp-btn {
    background: #d5a6bd !important;
    color: white !important;
    border: none !important;
    padding: 16px 32px !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-transform: none !important;
    letter-spacing: 0.5px !important;
    width: 100% !important;
    text-align: center !important;
    text-decoration: none !important;
}

.modal-whatsapp-btn:hover {
    background: #b8859a !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(213, 166, 189, 0.3) !important;
}

.modal-whatsapp-btn:active {
    transform: translateY(0) !important;
}

/* ===== RESPONSIVE DESIGN - MOBILE OPTIMIZED ===== */
@media (max-width: 768px) {
    :root {
        --product-image-padding: 0px !important;
        --product-card-border-radius: 16px;
        --product-card-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        --product-card-shadow-hover: 0 8px 24px rgba(213, 166, 189, 0.15);
    }

    body {
        font-size: 1rem;
    }

    .container {
        padding: 0 1rem;
    }

    .page-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .page-subtitle {
        display: none;
    }

    /* Filtros mantienen estilos de desktop, solo ajuste de padding lateral si necesario */
    .filter-buttons {
        padding: 0 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .filter-buttons::-webkit-scrollbar {
        display: none;
    }

    /* Forzar que filtros mantengan estilos de desktop - Override de componentes mobile */
    .filter-btn {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    .filter-btn.active {
        background: var(--ramos-primary) !important;
        color: white !important;
        border: 2px solid #fff !important;
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    .gallery-section {
        padding: 1rem 0 2.5rem 0;
    }

    /* Grid mejorado: 2 columnas en mobile */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 0 0.25rem;
    }

    .product-card {
        min-width: 0;
        border-radius: 14px;
        box-shadow: 0 2px 10px rgba(213,166,189,0.13);
        margin-bottom: 0.5rem;
    }

    .product-content {
        padding: 0.85rem 0.7rem;
    }

    .product-name {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }

    .product-description {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
        -webkit-line-clamp: 3;
    }

    .add-to-cart-btn,
    .contact-btn {
        padding: 12px 0;
        font-size: 0.95rem;
        border-radius: 10px;
        min-width: 0;
        letter-spacing: 1px;
        margin-top: 0.5rem;
    }

    .product-price {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .modal-content {
        max-width: 99vw;
        width: 99vw;
        margin: 0.5rem;
        max-height: 98vh;
        border-radius: 18px;
        touch-action: pan-y;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }
    
    .modal-body {
        grid-template-columns: 1fr;
        min-height: auto;
        overflow: visible;
        position: relative;
    }
    
    .modal-image {
        height: 260px !important;
        min-height: 180px !important;
        background: transparent;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        position: relative;
        flex-shrink: 0;
        width: 100%;
        z-index: 1;
    }
    
    .modal-image img {
        max-width: 98% !important;
        max-height: 98% !important;
        object-fit: contain !important;
        margin: 0 !important;
        display: block !important;
        width: auto !important;
        height: auto !important;
        border-radius: 0;
        box-shadow: none;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .modal-info {
        padding: 1.1rem 0.7rem !important;
        min-height: auto !important;
        justify-content: flex-start !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    .modal-info h2 {
        font-size: 1.15rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .modal-info p {
        font-size: 0.95rem !important;
        margin-bottom: 0.7rem !important;
    }

    .modal-navigation {
        display: none;
    }
    
    .modal-nav-btn {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .cta-content {
        padding: 0 0.5rem;
    }
    .cta-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    .cta-description {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    .btn-dark-enhanced {
        padding: 14px 0;
        font-size: 1rem;
        min-width: 0;
        border-radius: 10px;
        width: 100%;
        margin: 0 auto;
    }
    .cta-text {
        font-size: 1.1rem;
    }
    .cta-subtitle {
        font-size: 0.7rem;
    }
    .whatsapp-float {
        right: 16px !important;
        bottom: 16px !important;
        width: 54px !important;
        height: 54px !important;
        background-size: 54px 54px !important;
    }
}

/* Body lock cuando modal está activo */
.modal-open {
    overflow: hidden;
}

/* ===== CTA SECTION ===== */
.gallery-hero:last-of-type {
    background: linear-gradient(90deg, #bba6b3 0%, #5c555a 100%);
    padding: 32px 0;
    text-align: center;
}

.cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.cta-title {
    font-size: 1.3rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: white;
}

.cta-description {
    font-size: 0.95rem;
    margin-bottom: 20px;
    color: white;
    opacity: 0.95;
}

.btn-dark-enhanced {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 18px 32px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 12px;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-width: 180px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    background: linear-gradient(135deg, #6d1e61, var(--deep-rose));
    color: white;
    text-decoration: none;
}

.btn-dark-enhanced:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.cta-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 2.5px;
}

.cta-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .cta-title {
        font-size: 1.2rem;
    }
    
    .cta-description {
        font-size: 0.9rem;
    }
    
    .cta-text {
        font-size: 1.2rem;
        letter-spacing: 2px;
    }
    
    .cta-subtitle {
        font-size: 0.7rem;
    }
    .cta-title,
    .cta-description {
        display: none !important;
    }
}

/* ===== ESTILOS DEL MENÚ HAMBURGUESA ===== */
.menu-toggle {
    display: none;
    background: none;
    font-size: 1.5rem;
    color: var(--ramos-dark);
    border: none;
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        padding: 8px;
        font-size: 1.2rem;
        border-radius: 8px;
        background: rgba(0,0,0,0.05);
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: white;
        flex-direction: column;
        gap: 0;
        padding: 0;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        border-radius: 0 0 16px 16px;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-menu li {
        width: 100%;
        padding: 16px 20px;
        border-bottom: 1px solid #f0f0f0;
        text-align: center;
    }

    .nav-menu li:last-child {
        border-bottom: none;
        border-radius: 0 0 16px 16px;
    }

    .nav-menu a {
        color: var(--ramos-dark);
        font-weight: 500;
        display: block;
        width: 100%;
    }

    .nav-menu a:hover {
        color: var(--ramos-primary);
    }
}