/* ==================================================
   BASE & VARIABLES
   ================================================== */
:root {
    /* Paleta de Colores */
    --color-primary:  #9b6148;/* Cafe Primario */
    --color-secondary: #c69c6d; /* cafe Secundario */
    --color-text: #555; /* Gris oscuro para Iconos social */
    --color-heading: #1b1b1b; /* Negro suave para títulos */
    --color-blak:#000000; /* negro para titulos */
    --color-light: #F3F3F3; /* grys claro para fondos */
    --color-white: #ffffff; /*Blanco Fondo principal */
    --color-border: #e4c8b5;

    /* Tipografía */
    --font-primary: 'Poppins', sans-serif;
    --font-size-base: 16px;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;

    /* Espaciado */
    --spacing-section: 100px;
    --border-radius: 20px;

    /* Header */
    --header-height: 145px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100vh; /* asegura que ocupe toda la altura de la ventana */
    scroll-behavior: smooth; /* Desplazamiento suave */
    scroll-padding-top: var(--header-height); /* Evita que el header tape el contenido al navegar */
}

body {
    width: 100%;
    min-height: 100vh; /* asegura que ocupe toda la altura de la ventana */
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background-color: var(--color-white);
    line-height: 1.7;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.section {
    padding: var(--spacing-section) 0;
}

.section-title {
    font-size: 2.8rem;
    color: var(--color-blak);
    font-weight: var(--font-weight-bold);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.title-light {
    color: var(--color-white);
}

.section-subtitle {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 4rem;
    line-height: 1.6;
}

.text-center {
    text-align: center;
}

.btn {
    display: inline-block;
    background: linear-gradient(45deg, var(--color-primary), var(--color-secondary));
    color: var(--color-white);
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: var(--font-weight-medium);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* ==================================================
   HEADER & NAVIGATION
   ================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: transform 0.4s ease-out, background-color 0.3s ease;
}

.top-bar {
    background: var(--color-secondary);
    padding: 12px 0;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-white);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--color-white);
    transition: transform 0.3s ease;
}

.social-links a:hover {
    transform: scale(1.2);
}

.navbar {
    background: var(--color-white);
    padding: 1.25rem 3rem;
    border-radius: 60px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin: 1.25rem auto;
    max-width: 1100px; /* Limita su ancho */
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-items {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    color: var(--color-heading);
    font-weight: var(--font-weight-medium);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-link.active {
    color: var(--color-primary);
}

.nav-link.active::after, .nav-link:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 2px;
    transform-origin: center;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.logo {
    font-size: 2.2rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: -1px;
}

/* ==================================================
   MOBILE NAVIGATION TOGGLE
   ================================================== */
.nav-toggle {
    display: none; /* Oculto por defecto, se activa con media query */
    width: 30px;
    height: 24px;
    position: relative;
    cursor: pointer;
    z-index: 1200;
}

.nav-toggle span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: var(--color-heading);
    border-radius: 3px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.nav-toggle span:nth-child(1) { top: 0px; }
.nav-toggle span:nth-child(2) { top: 10px; }
.nav-toggle span:nth-child(3) { top: 20px; }

.nav-toggle.active span:nth-child(1) { top: 10px; transform: rotate(135deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; left: -30px; }
.nav-toggle.active span:nth-child(3) { top: 10px; transform: rotate(-135deg); }

.logo-i {
    color: var(--color-primary);
}

.logo-cream {
    color: var(--color-secondary);
}

/* ==================================================
   HERO SECTION
   ================================================== */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    padding-top: var(--header-height);
}

.hero-bg {
    position: absolute;
    position: fixed; /* Cambiado de posicion */
    top: 0;
    left: 0;
    width: 100%; /* Usar 100% en lugar de 100vw para mejor compatibilidad */
    height: 100%; /* Usar 100% en lugar de 100vh */
    background: url(../media/fondoTienda.webp) no-repeat center center;
    background-size: cover;
    filter: brightness(0.6);
    z-index: -1;
}

.hero-content {
    max-width: 800px;
}

.hero-subtitle {
    font-size: 1.1rem;
    font-weight: var(--font-weight-medium);
    letter-spacing: 2px;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.hero-title {
    font-size: 4rem;
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
}

.hero-btn {
    margin-top: 2rem;
}

/* ==================================================
   ABOUT SECTION
   ================================================== */
.about-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.about-image img {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

.about-text {
    background: rgba(255, 255, 255, 0.25); /* Fondo semitransparente */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Safari */
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3); /* Borde sutil tipo cristal */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    text-align: center;
    color: var(--color-white); /* Cambia el color del texto a blanco */
}

.about-text p {
    margin-bottom: 2rem;
}

/* ==================================================
   SERVICES SECTION
   ================================================== */
.services {
    background-color: vari(--color-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.service-card {
    background: var(--color-white);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid var(--color-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
}

.service-card h3 {
    font-size: 1.5rem;
    color: var(--color-heading);
    margin-bottom: 1rem;
}

.service-card p {
    font-size: 0.95rem;
}

/* ==================================================
   PRODUCTS PAGE
   ================================================== */
.body_products::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("../media/bgmadera.webp") no-repeat center center;
    background-size: cover;
    z-index: -1;
}

.body_products {
    flex-wrap: wrap;
    justify-content: center;
    min-height: 100vh;
    position: relative; /* Necesario para el z-index del pseudo-elemento */
    z-index: 0;
}

.navbar_products {
    background: rgba(255, 255, 255, 0.25); /* Fondo blanco semitransparente */
    backdrop-filter: blur(10px); /* Desenfoque del fondo */
    -webkit-backdrop-filter: blur(10px); /* Compatibilidad con Safari */
    border: 1px solid rgba(255, 255, 255, 0.3); /* Borde sutil */
    padding: 1.25rem 3rem;
    border-radius: 60px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin: 0.2rem auto;
    max-width: 1100px; /* Mantiene el ancho máximo */
}

.products {
    padding-top: calc(var(--header-height)); /* Espacio para que el título no quede detrás del header */
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 2px solid var(--color-primary);
    margin-top: 4rem;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
}

.category-title {
    font-size: 2rem;
    color: var(--color-heading);
    /* Se eliminan márgenes y bordes que ahora maneja el contenedor '.category-header' */
    margin: 0;
    padding: 0;
    border: none;
}

.category-price {
    font-size: 1.5rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: rgba(255, 255, 255, 0.25); /* Fondo semitransparente */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Safari */
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3); /* Borde sutil tipo cristal */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: scale(1.03);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}


.product-image {
    width: 100%;
    height: 220px; /* Altura fija para todas las imágenes */
    object-fit: cover; /* Asegura que la imagen cubra el espacio sin deformarse */
    object-position: center; /* Centra la imagen para que el recorte sea equilibrado */
}

.product-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
}

.product-name {
    font-size: 1.3rem;
    color: var(--color-heading);
    margin: 0; /* Eliminamos el margen anterior */
    flex-grow: 1; /* Permite que el nombre ocupe el espacio disponible */
}

.product-item-price {
    font-size: 1.1rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    white-space: nowrap; /* Evita que el precio se divida en dos líneas */
    margin-left: 1rem;
}

.product-description {
    font-size: 0.9rem;
    padding: 0 1.5rem 1.5rem;
    /* Ocultamos la descripción en la tarjeta por defecto */
    display: none;
}

.footer_products .social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.footer_products .social-links a {
    color: var(--color-text);
    text-decoration: none;      /* quita subrayado */
    font-size: 1.5rem;          /* tamaño de iconos/texto */
}

/* ==================================================
   GALLERY SECTION
   ================================================== */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 4rem;
}

.gallery-item {
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* ==================================================
   FOOTER
   ================================================== */
.footer {
    background-color: var(--color-light);
}

.footer-top {
    text-align: center;
}

.footer-logo {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    display: inline-block;
    margin-bottom: 1rem;
}

.footer-tagline {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--color-text);
}

.footer .social-links {
    display: flex;              /* activa flexbox */
    justify-content: center;    /* centra horizontalmente */
    gap: 1rem;                  /* espacio entre iconos */
}

.footer .social-links a {
    color: var(--color-text);
    text-decoration: none;      /* opcional, quita subrayado */
    font-size: 1.5rem;          /* opcional, tamaño de iconos/texto */
}


.footer .social-links a:hover {
    color: var(--color-primary);
    transform: translateY(-2px);
}

.footer-columns {
    display: flex;
    justify-content: center;
    gap: 4rem;
    text-align: center;
    margin-bottom: 3rem;
}

.footer-column1{
    text-align: right;
}

.footer-column2{
    text-align: left;
}

.footer-column2 a {
  display: block;
  margin-bottom: 8px; /* Espacio entre enlaces */
}

.footer-title {
    font-size: 1.3rem;
    color: var(--color-heading);
    margin-bottom: 1.5rem;
}

/* ==================================================
   ANIMATIONS & HELPERS
   ================================================== */
.header--hidden {
    transform: translateY(-100%);
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}


/* ==================================================
   PRODUCT MODAL
   ================================================== */
.product-modal__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); /* Para Safari */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    padding: 1rem;
}

.product-modal__overlay--visible {
    opacity: 1;
    visibility: visible;
}

/* Estilos para la card dentro del modal */
.product-modal__overlay .product-modal__content {
    max-width: 500px; /* Aumentamos un poco el tamaño máximo */
    width: 100%;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default; /* El cursor no debe ser 'pointer' dentro del modal */
    background: var(--color-white); /* Asegura un fondo sólido */
}
/* Hacemos la imagen más grande dentro del modal */
.product-modal__content .product-image {
    height: 400px; /* Aumentamos la altura de la imagen */
}

/* Mostramos la descripción solo dentro del modal */
.product-modal__content .product-description {
    display: block;
}

.product-modal__overlay--visible .product-modal__content {
    transform: scale(1);
}

/* Evita el scroll del body cuando el modal está abierto */
.modal-open {
    overflow: hidden;
}

/* Botón de cierre para el modal */
.product-modal__close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--color-heading);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    z-index: 10; /* Asegura que esté sobre la imagen */
}

.product-modal__close:hover {
    background-color: var(--color-white);
    transform: scale(1.1);
}

/* ==================================================
   RESPONSIVE DESIGN
   ================================================== */
@media (max-width: 992px) {
    :root { --header-height: 135px; }
    
    .hero-title { font-size: 3rem; }
    .section-title { font-size: 2.2rem; }

    /* --- Mobile Navigation --- */
    .nav-toggle { display: block; }
    .nav-items {
        position: fixed;
        top: 0;
        right: 0;
        width: min(75vw, 350px);
        height: 100vh;
        background: var(--color-white);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        transition: transform 0.4s ease-in-out;
        z-index: 1100;
        transform: translateX(100%);
    }
    .nav-items.nav--visible { transform: translateX(0); }
    .nav-link { font-size: 1.2rem; }
    .nav-content { justify-content: space-between; }

    .about-container { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: 1fr; }    
}

@media (max-width: 768px) {
    :root {
        --spacing-section: 80px;
        --header-height: 90px;
    }
    html { scroll-padding-top: var(--header-height); }
    .hero-title { font-size: 2.5rem; }
    .top-bar { display: none; }
    .navbar { margin: 0.5rem auto; padding: 1rem 1.5rem; }
    .footer-columns {
        flex-direction: column;
        gap: 2.5rem;
    }
    .services-grid { grid-template-columns: 1fr; }

    .category-header {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}
