/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Mockup palette */
    --color-cream: #F1E9DE;
    --color-cream-light: #FAF6F0;
    --color-green-dark: #1B4D3E;
    --color-green-medium: #2D5A45;
    --color-sage: #6F9786;
    --color-gold: #C9A86C;
    --color-gold-light: #DCC4A1;
    --color-text-dark: #1B4D3E;
    --color-text-light: #F1E9DE;
    --header-height: 120px;
}

body {
    font-family: 'Cormorant Garamond', serif;
    line-height: 1.6;
    color: var(--color-text-dark);
    background: var(--color-cream);
    min-height: 100vh;
}

section {
    scroll-margin-top: calc(var(--header-height) + 16px);
}

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

/* Header Styles */
.header {
    background: var(--color-green-dark);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 0;
    border-bottom: 1px solid rgba(241, 233, 222, 0.18);
}

.header.is-scrolled {
    background: rgba(27, 77, 62, 0.98);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: var(--header-height);
    max-width: 1400px;
    margin: 0 auto;
}

.nav-brand {
    flex-shrink: 0;
}

.nav-brand a {
    display: flex;
    align-items: center;
    height: var(--header-height);
    width: 280px;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(241, 233, 222, 0.35);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(241, 233, 220, 0.85);
}

/* UI overlays / helpers (styled in CSS, not JS) */
.order-confirmation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(45deg, #25d366, #128c7e);
    color: #fff;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    max-width: 420px;
    text-align: center;
    animation: haSlideIn 180ms ease;
}

.order-confirmation.is-leaving {
    animation: haSlideOut 180ms ease forwards;
}

.order-confirmation .confirmation-content i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.order-confirmation .confirmation-content p {
    margin: 0;
    font-size: 1rem;
}

.floating-whatsapp {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(45deg, #25d366, #128c7e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: transform 160ms ease, box-shadow 160ms ease;
    animation: haPulse 2s infinite;
}

.floating-whatsapp:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.floating-whatsapp:focus-visible {
    outline: 2px solid rgba(241, 233, 222, 0.8);
    outline-offset: 3px;
}

.scroll-to-top {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--color-gold);
    border: none;
    border-radius: 50%;
    color: var(--color-green-dark);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
    z-index: 1000;
}

.scroll-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:focus-visible {
    outline: 2px solid rgba(27, 77, 62, 0.55);
    outline-offset: 3px;
}

@keyframes haSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -56%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes haSlideOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -56%);
    }
}

@keyframes haPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left center;
    transform: scale(1.534);
    transform-origin: left center;
    backface-visibility: hidden;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    color: rgba(241, 233, 222, 0.75);
    text-decoration: none;
    font-weight: 400;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
}

.nav-link:hover {
    color: var(--color-gold);
}

.nav-separator {
    color: rgba(201, 168, 108, 0.75);
    font-size: 0.5rem;
}

/* Hero Section */
.hero {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    isolation: isolate;
    background-image:
        linear-gradient(
            90deg,
            rgba(27, 77, 62, 0.12) 0%,
            rgba(27, 77, 62, 0.38) 55%,
            rgba(27, 77, 62, 0.60) 100%
        ),
        url('assets/brand/banner.png'),
        url('assets/brand/bg_green.png');
    background-size: cover, cover, cover;
    background-position: center, center, center;
    background-color: var(--color-green-dark);
    padding: calc(var(--header-height) + 24px) 20px 60px;
    overflow: hidden;
}

.hero-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3rem;
    max-width: 1200px;
    width: 100%;
    position: relative;
    z-index: 2;
    min-height: 360px;
}

.hero-image {
    display: none;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
}

.hero-content {
    flex: 1;
    text-align: left;
    max-width: 400px;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--color-gold);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.hero-title em {
    font-style: italic;
    color: var(--color-cream);
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--color-cream);
    margin-bottom: 1.5rem;
    font-weight: 300;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    background: transparent;
    color: var(--color-cream);
    padding: 10px 24px;
    text-decoration: none;
    border: 1px solid var(--color-cream);
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.cta-button:hover {
    background: var(--color-cream);
    color: var(--color-green-dark);
}

/* Decorative Elements */
.decor-element {
    position: absolute;
    pointer-events: none;
    z-index: 10;
}

.decor-moth1 {
    width: 80px;
    height: auto;
}

.decor-moth2 {
    width: 60px;
    height: auto;
}

.decor-flower {
    width: 120px;
    height: auto;
}

.decor-serpent {
    width: 150px;
    height: auto;
}

/* Page decorations positioning */
.page-decor-left-top {
    left: 20px;
    top: 500px;
}

.page-decor-left-mid {
    left: 0;
    top: 900px;
}

.page-decor-left-bottom {
    left: 10px;
    bottom: 800px;
}

.page-decor-right-top {
    right: 20px;
    top: 350px;
}

.page-decor-right-mid {
    right: 10px;
    top: 750px;
}

.page-decor-right-bottom {
    right: 20px;
    bottom: 600px;
}

/* Products Section */
.products {
    padding: 60px 0;
    background: var(--color-cream);
    position: relative;
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    text-align: center;
    color: var(--color-green-dark);
    margin-bottom: 2.5rem;
    letter-spacing: 0.1em;
    font-weight: 400;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

/* Product Card */
.product-card {
    background: var(--color-green-dark);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    cursor: default;
    border: 1px solid rgba(201, 168, 108, 0.15);
}

.product-image {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.product-image img {
    max-height: 90px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
    filter: brightness(1.1);
}

.product-image i {
    font-size: 3.5rem;
    color: var(--color-gold);
}

.product-name {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--color-cream);
    margin-bottom: 0.5rem;
    font-weight: 400;
    letter-spacing: 0.05em;
}

.product-description {
    color: var(--color-cream);
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: 0.85rem;
    opacity: 0.85;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--color-cream);
    margin-bottom: 1rem;
    font-family: 'Cinzel', serif;
}

.product-button {
    background: var(--color-green-medium);
    color: var(--color-cream);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 400;
    cursor: pointer;
    transition: background-color 200ms ease, color 200ms ease, transform 150ms ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    font-family: 'Cormorant Garamond', serif;
}

.product-button:hover {
    background: var(--color-gold);
    color: var(--color-green-dark);
    transform: scale(1.04);
}

.product-button i {
    font-size: 1rem;
}

/* About Section */
.about {
    padding: 0;
    position: relative;
    overflow: hidden;
}

.about-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 400px;
}

.about-content {
    background: var(--color-sage);
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.about-title {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: var(--color-cream);
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
    font-weight: 400;
}

.about-text {
    color: var(--color-cream);
    font-size: 0.95rem;
    line-height: 1.8;
    opacity: 0.9;
}

.about-image {
    position: relative;
    overflow: hidden;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-decor {
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
}

.about-decor img {
    width: 100px;
    height: auto;
}

/* Contact Section */
.contact {
    padding: 60px 0;
    background-color: var(--color-green-dark);
    background-image: url('assets/brand/bg_green.png');
    background-size: cover;
    background-position: center;
    position: relative;
}

.contact-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    max-width: 800px;
    margin: 0 auto;
}

.contact-image {
    flex-shrink: 0;
}

.contact-image img {
    width: 150px;
    height: auto;
    opacity: 0.9;
}

.contact-info {
    text-align: left;
}

.contact-info h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: var(--color-gold);
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
    font-weight: 400;
}

.contact-info h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    color: rgba(241, 233, 222, 0.92);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.contact-info p {
    color: rgba(241, 233, 222, 0.85);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.contact-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(241, 233, 222, 0.12);
    color: rgba(241, 233, 222, 0.95);
    border: 1px solid rgba(241, 233, 222, 0.65);
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-weight: 400;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.contact-button:hover {
    background: rgba(201, 168, 108, 0.9);
    border-color: rgba(201, 168, 108, 0.9);
    color: var(--color-green-dark);
}

/* Footer */
.footer {
    background: var(--color-gold);
    padding: 1.5rem 0;
    text-align: center;
}

.footer p {
    color: rgba(27, 77, 62, 0.85);
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    opacity: 1;
}

/* Floating Decorations Container */
.floating-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.float-decor {
    position: absolute;
    opacity: 0.9;
    transition: transform 0.3s ease;
}

/* Left side decorations */
.float-decor.flower-left-1 {
    left: -10px;
    top: 25%;
    transform: rotate(-15deg);
}

.float-decor.flower-left-1 img {
    width: 140px;
}

.float-decor.moth-left {
    left: 20px;
    top: 55%;
}

.float-decor.moth-left img {
    width: 50px;
}

.float-decor.serpent-left {
    left: -20px;
    top: 75%;
    transform: scaleX(-1);
}

.float-decor.serpent-left img {
    width: 160px;
}

/* Right side decorations — distribuidas uniformemente a lo largo de la página */

/* Mariposa superior derecha — zona alta (~12% de la altura) */
.float-decor.moth-right-1 {
    right: 18px;
    top: 12%;
}

.float-decor.moth-right-1 img {
    width: 72px;
}

/* Flor derecha — zona medio-alta (~33% de la altura) */
.float-decor.flower-right {
    right: -14px;
    top: 33%;
    transform: scaleX(-1) rotate(8deg);
}

.float-decor.flower-right img {
    width: 136px;
}

/* Mariposa segunda derecha — zona media (~56% de la altura) */
.float-decor.moth-right-2 {
    right: 24px;
    top: 56%;
    transform: rotate(12deg);
}

.float-decor.moth-right-2 img {
    width: 64px;
}

/* Serpiente derecha — zona baja (~76% de la altura) */
.float-decor.serpent-right {
    right: -22px;
    top: 76%;
}

.float-decor.serpent-right img {
    width: 148px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .floating-decorations {
        display: none;
    }
}

@media (max-width: 992px) {
    .hero-wrapper {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .about-wrapper {
        grid-template-columns: 1fr;
    }
    
    .about-content {
        padding: 40px 30px;
    }
    
    .about-image {
        height: 300px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 88px;
    }

    .nav {
        flex-direction: row;
        gap: 0;
        padding: 0 1rem;
        height: var(--header-height);
    }

    .nav-brand a {
        width: 180px;
        height: var(--header-height);
    }

    .logo-img {
        transform: scale(1.43);
        transform-origin: left center;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-green-dark);
        border-top: 1px solid rgba(241, 233, 222, 0.12);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 220ms ease;
    }

    .header.is-open .nav-links {
        max-height: 320px;
        padding: 8px 0;
    }

    .nav-separator {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        flex-direction: column;
        gap: 6px;
    }
    
    .nav-link {
        padding: 14px 16px;
        font-size: 0.95rem;
        letter-spacing: 0.08em;
        text-align: center;
        border-top: 1px solid rgba(241, 233, 222, 0.08);
    }

    .nav-link:first-child {
        border-top: none;
    }
    
    .hero {
        padding: calc(var(--header-height) + 18px) 15px 44px;
        min-height: 520px;
    }

    .hero-wrapper {
        min-height: 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 10px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .contact-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .contact-info {
        text-align: center;
    }
    
    .contact-image img {
        width: 120px;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 80px;
    }

    .nav-brand a {
        width: 160px;
    }

    .logo-img {
        transform: scale(1.3);
        transform-origin: left center;
    }

    .hero-title {
        font-size: 1.5rem;
    }
    
    .product-card {
        padding: 1.2rem;
    }
    
    .product-image {
        height: 80px;
    }
    
    .product-image img {
        max-height: 70px;
    }
    
    .about-content {
        padding: 30px 20px;
    }
    
    .about-title {
        font-size: 1.3rem;
    }
}

/* Product Gallery Modal */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    inset: 0;
    background-color: rgba(10, 10, 10, 0.95);
    animation: galleryFadeIn 0.3s ease-in;
    padding: 20px;
}

.gallery-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes galleryFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gallery-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 800px;
    max-height: 95vh;
    background-color: #0a0a0a;
    border: 2px solid var(--color-gold);
    border-radius: 8px;
    padding: 20px;
}

.gallery-close {
    position: absolute;
    right: 16px;
    top: 16px;
    color: var(--color-gold);
    font-size: 28px;
    line-height: 1;
    font-weight: bold;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.gallery-close:hover {
    color: var(--color-gold-light);
}

.gallery-title {
    flex-shrink: 0;
    color: var(--color-gold-light);
    font-family: 'Cinzel', serif;
    font-size: 22px;
    text-align: center;
    margin: 4px 40px 16px;
}

.gallery-container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 16px;
}

.gallery-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 6px;
}

.gallery-nav {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.gallery-prev,
.gallery-next {
    background-color: var(--color-gold);
    color: #0a0a0a;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 15px;
    border-radius: 4px;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    transition: background-color 0.3s ease;
}

.gallery-prev:hover,
.gallery-next:hover {
    background-color: var(--color-gold-light);
}

.gallery-counter {
    color: var(--color-gold-light);
    font-family: 'Cinzel', serif;
    font-size: 14px;
    flex-grow: 1;
    text-align: center;
}

.gallery-thumbnails {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 14px;
}

.gallery-thumbnail {
    width: 56px;
    height: 56px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumbnail:hover,
.gallery-thumbnail.active {
    border-color: var(--color-gold-light);
    transform: scale(1.05);
}

.product-gallery-button {
    cursor: pointer;
}

@media (max-width: 600px) {
    .gallery-modal {
        padding: 10px;
    }

    .gallery-modal-content {
        padding: 14px;
        max-height: 96vh;
    }

    .gallery-title {
        font-size: 18px;
        margin: 4px 36px 12px;
    }

    .gallery-prev,
    .gallery-next {
        padding: 8px 12px;
        font-size: 13px;
    }

    .gallery-thumbnail {
        width: 48px;
        height: 48px;
    }
}