/* VARIABLES + RESET */
:root {
    --bg-color: #efe6db;      /* Crema suave */
    --accent-sage: #8da399;   /* Verde Salvia */
    --accent-earth: #b87352;  /* Terracota */
    --text-dark: #3e362e;     /* Café muy oscuro (evitar negro puro) */
    --soft-white: #ffffff;
    --radius-lg: 40px;
    --radius-sm: 15px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* BODY */
body {
    background-color: var(--bg-color);
    color: var(--text-dark);
    font-family: 'Quicksand', sans-serif;
    line-height: 1.6;
}

/* HEADER / NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
}

.logo {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.logo span { color: var(--accent-earth); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.btn-login-nav {
    background: transparent;
    border: 1px solid var(--accent-earth);
    color: var(--accent-earth);
    padding: 8px 20px;
    border-radius: 20px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login-nav:hover {
    background-color: var(--accent-earth);
    color: white;
}

.cart-status {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 15px;
    background-color: rgba(141, 163, 153, 0.1); /* Verde salvia muy tenue */
    border-radius: 20px;
    transition: background-color 0.3s ease;
}

.cart-status:hover {
    background-color: rgba(141, 163, 153, 0.2);
}

.cart-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.cart-icon-svg {
    color: var(--accent-sage);
    display: flex;
    align-items: center;
}

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.cart-overlay.active {
    display: block;
}

.cart-sidebar {
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--bg-color);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.cart-overlay.active .cart-sidebar {
    transform: translateX(0);
}

.cart-header {
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.cart-header h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
}

.close-cart {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-dark);
}

.cart-body {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}

.cart-footer {
    padding: 25px;
    background: var(--soft-white);
    border-top: 1px solid rgba(0,0,0,0.05);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1.1rem;
}

/* CAMPOS FORMULARIO*/ 
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid rgba(62, 54, 46, 0.2);
    background: var(--soft-white);
    font-family: 'Quicksand', sans-serif;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: var(--accent-earth);
    box-shadow: 0 0 0 3px rgba(184, 115, 82, 0.1);
}

.full-width {
    width: 100%;
    margin-top: 10px;
    border: none;
    cursor: pointer;
}

/* MODALES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none; /* Oculto por defecto */
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Un número muy alto para estar por encima de todo */
}

.modal-overlay.active {
    display: flex; /* Se muestra cuando tiene la clase active */
}

.modal-content {
    background: var(--bg-color); /* El crema suave que ya definimos */
    width: 90%;
    max-width: 450px;
    border-radius: var(--radius-sm);
    padding: 50px 40px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.25);
    animation: slideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-header h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 2.2rem;
    color: var(--text-dark);
}

.modal-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 0.9rem;
}

.modal-footer a {
    color: var(--accent-earth);
    font-weight: 600;
    text-decoration: none;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-dark);
    cursor: pointer;
    line-height: 1;
    z-index: 10; /* Para estar por encima del contenido */
}

.modal-close:hover {
    color: var(--accent-earth);
}

#view-login, #view-register {
    animation: fadeInModal 0.3s ease-in-out;
}

@keyframes fadeInModal {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* HERO (HOME) */
.hero {
    display: flex;
    align-items: center;
    padding: 5% 5%;
    min-height: 80vh;
}

.hero-content { flex: 1; }

.hero-content h1 {
    font-family: 'DM Serif Display', serif;
    font-size: 4rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

.blob-shape {
    width: 450px;
    height: 450px;
    background-color: #dcd2c5; /* Un tono intermedio */
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    overflow: hidden;
    animation: morph 8s ease-in-out infinite;
}

.blob-shape img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes morph {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

/* BOTONES GLOBALES */ 
.btn-primary {
    display: inline-block;
    background-color: var(--accent-earth);
    color: white;
    padding: 1.2rem 2.5rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    margin-top: 2rem;
    transition: transform 0.3s ease;
}

.btn-secundary {
    display: block;          /* 🔑 clave */
    background-color: var(--accent-sage);
    color: white;
    padding: 1.2rem 2.5rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    margin: 2rem auto;       /* 🔑 centra */
    width: fit-content;      /* evita que sea 100% ancho */
    transition: transform 0.3s ease;
}

.btn-primary,
.btn-secundary {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary:hover,
.btn-secundary:hover {
    transform: translateY(-5px);
}

.btn-buy {
    width: 100%;
    padding: 15px;
    background-color: var(--text-dark);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-buy:hover {
    background-color: var(--accent-earth);
}

.btn-whatsapp {
    background-color: var(--accent-sage);
    color: white;
    text-align: center;
    padding: 18px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.btn-whatsapp:hover {
    background-color: var(--accent-earth);
    transform: scale(1.02);
}

/* HOME - WRAPPER / CARDS */
.wrapper {
    display: flex;
    height: 600px;
    max-width: 900px;
    margin: 50px auto;
    background-color: #e5d9c9;
    border-radius: var(--radius-sm);
}

.card {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: flex 0.5s ease;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--accent-earth);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
}

.card-body h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.6rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

/* MOSTRAR TEXTO */
.card:is(:hover, :focus-within) .overlay {
    opacity: 1;
}

/* SCALE EN IMAGEN */
.card:is(:hover, :focus-within) img {
    transform: scale(1.1);
}

/* EXPANSIÓN */
.card:is(:hover, :focus-within) {
    flex: 4;
}

.overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    text-align: center;
    padding: 20px;
}

.overlay h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.overlay p {
    font-size: 0.9rem;
    max-width: 220px;
}

/* FEATURES */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding: 100px 10%;
    background-color: #f7f2eb; /* Un tono un poco más oscuro que el fondo principal */
    text-align: center;
}

.feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 20px;
}

.feature-item h4 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--accent-earth);
}

.feature-item p {
    font-size: 0.95rem;
    color: #666;
}

/* FOOTER */
.footer {
    padding: 80px 10% 20px;
    background-color: var(--text-dark); /* Color oscuro para contraste */
    color: var(--bg-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 50px;
}

.footer-logo {
    font-family: 'DM Serif Display', serif;
    font-size: 2rem;
}

.footer-newsletter p {
    margin-bottom: 15px;
}

.footer-bottom {
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.6;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    padding: 12px 20px;
    border-radius: 30px;
    border: none;
    outline: none;
    width: 250px;
}

.input-group button {
    padding: 12px 25px;
    border-radius: 30px;
    border: none;
    background-color: var(--accent-earth);
    color: white;
    cursor: pointer;
    font-weight: bold;
}

/* PRODUCTOS CATALOGOS */
.catalog-page {
    background-color: var(--bg-color);
}

.catalog-intro {
    text-align: center;
    padding: 60px 5%;
}

.catalog-intro h1 {
    font-family: 'DM Serif Display', serif;
    font-size: 3.5rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
}

.filter-btn {
    padding: 8px 20px;
    border: 1px solid var(--accent-sage);
    background: transparent;
    border-radius: 20px;
    color: var(--accent-sage);
    cursor: pointer;
    font-family: 'Quicksand', sans-serif;
    transition: all 0.3s ease;
}

.filter-btn.active, .filter-btn:hover {
    background-color: var(--accent-sage);
    color: white;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.product-card-v2 {
    background: var(--soft-white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid rgba(0,0,0,0.03);
}

.product-card-v2:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(62, 54, 46, 0.1);
}

.card-image {
    position: relative;
    height: 300px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tag {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

.price {
    font-size: 1.8rem;
    font-family: 'DM Serif Display', serif;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.price span {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.9rem;
    color: #888;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5% 100px;
}

/*NUESTRA HISTORIA */
.history-page {
    background-color: var(--bg-color);
}

.about-hero {
    padding: 100px 5% 60px;
    text-align: center;
}

.hero-text-center h1 {
    font-family: 'DM Serif Display', serif;
    font-size: 4rem;
    margin-bottom: 20px;
}

.subtitle {
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-earth);
    font-weight: 600;
    font-size: 0.9rem;
}

.content-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 5%;
}

.story-split {
    display: flex;
    align-items: center;
    gap: 80px;
    padding: 80px 0;
}

.story-image {
    flex: 1;
    height: 500px;
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: 20px 20px 0px var(--accent-sage); /* Detalle decorativo moderno */
}

.story-text {
    flex: 1;
}

.story-text h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.values-section {
    padding: 100px 0;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.value-num {
    font-family: 'DM Serif Display', serif;
    font-size: 3rem;
    color: rgba(184, 115, 82, 0.2); /* Terracota muy sutil */
    display: block;
    margin-bottom: 10px;
}

.value-card {
    background: var(--soft-white);
    padding: 40px;
    border-radius: var(--radius-sm);
    border-bottom: 4px solid var(--accent-earth);
    transition: transform 0.3s ease;
}

.value-card:hover {
    transform: translateY(-10px);
}

.value-card h4 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-family: 'DM Serif Display', serif;
}

/* CONTACTO */
.contact-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 5%;
}

.contact-card {
    background: var(--soft-white);
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1000px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.05);
}

.contact-info {
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-info h1 {
    font-family: 'DM Serif Display', serif;
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.blob-shape-static {
    width: 80%;
    height: 80%;
    border-radius: 40% 60% 70% 30% / 40% 40% 60% 50%;
    overflow: hidden;
}

.blob-shape-static img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-details {
    margin: 30px 0;
}

.detail-item {
    margin-bottom: 20px;
}

.detail-item strong {
    color: var(--accent-earth);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}


.contact-visual {
    background-color: #f7f2eb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* RESPONSIVE */ 
@media (max-width: 480px) {
    .cart-text {
        display: none;
    }
    .cart-status {
        padding: 8px;
    }
}

@media (max-width: 768px) {

    /* --- NAVBAR --- */
    .navbar {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem 5%;
    }

    .nav-links {
        flex-direction: column;
        gap: 15px;
    }

    .nav-actions {
        gap: 15px;
    }

    /* --- HERO --- */
    .hero {
        flex-direction: column;
        text-align: center;
        min-height: auto;
        gap: 2rem;
    }

    .hero-content h1 {
        font-size: 2.4rem;
    }

    .hero-image-container {
        width: 100%;
    }

    .blob-shape {
        width: 280px;
        height: 280px;
    }

    /* --- WRAPPER CARDS --- */
    .wrapper {
        flex-direction: column;
        height: auto;
    }

    .card {
        height: 220px;
    }

    .card:is(:hover, :focus-within) {
        flex: 1; /* evita expansión rara en móvil */
    }

    /* --- FEATURES --- */
    .features {
        padding: 60px 5%;
        gap: 30px;
    }

    /* --- FOOTER --- */
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .input-group {
        flex-direction: column;
        width: 100%;
    }

    .input-group input {
        width: 100%;
    }

    .input-group button {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .story-split {
        flex-direction: column;
        gap: 40px;
    }
    .hero-text-center h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 850px) {
    .contact-card {
        grid-template-columns: 1fr;
    }
    .contact-visual {
        display: none; /* En móvil simplificamos la vista */
    }
    .contact-info {
        padding: 40px 25px;
        text-align: center;
    }
}

/* --- NUEVO ESTILO CARRITO (BASADO EN IMAGEN) --- */

.cart-item-v3 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 0;
    border-bottom: 1px solid rgba(62, 54, 46, 0.08);
}

.cart-item-left {
    display: flex;
    gap: 15px;
    align-items: center;
}

.cart-img-wrapper {
    width: 65px;
    height: 65px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.05);
}

.cart-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-product-name {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1rem;
}

/* Bloque derecho: Precio arriba, controles abajo */
.cart-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Alinea todo a la derecha */
    gap: 8px;
}

.cart-product-price {
    font-family: 'DM Serif Display', serif;
    font-size: 1.15rem;
    color: var(--accent-earth);
}

.cart-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.qty-tag {
    background-color: var(--accent-sage);
    color: white;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.btn-remove-link {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    color: #666;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-remove-link:hover {
    background-color: var(--accent-earth);
    color: white;
    border-color: var(--accent-earth);
}

/* Ajuste del Footer del Carrito */
.cart-total {
    border-top: 2px solid var(--text-dark);
    padding-top: 15px;
    margin-top: 10px;
}

.cart-total span:last-child {
    color: var(--accent-earth);
    font-family: 'DM Serif Display', serif;
    font-size: 1.4rem;
}