/* =====================================================================
   Creartón Cajas — Estilos custom
   Paleta verde naturaleza + kraft cartón + dark mode con toggle.
   ===================================================================== */

:root {
    /* Marca */
    --brand-green:        #7CB342;
    --brand-green-700:    #5A8A2E;
    --brand-green-900:    #2F4D14;
    --brand-kraft:        #C9A87C;
    --brand-kraft-700:    #9E7E55;

    /* Tema claro */
    --bg:                 #FAF7F2;
    --surface:            #FFFFFF;
    --surface-alt:        #F0EAE0;
    --text:               #2C3E2D;
    --text-muted:         #6B7468;
    --border:             #E3DCD0;
    --shadow-sm:          0 1px 2px rgba(44, 62, 45, 0.05);
    --shadow-md:          0 6px 24px rgba(44, 62, 45, 0.08);
    --shadow-lg:          0 18px 48px rgba(44, 62, 45, 0.14);

    --radius-sm:          .5rem;
    --radius:             .9rem;
    --radius-lg:          1.4rem;
    --transition:         .25s cubic-bezier(.4, 0, .2, 1);

    /* Tipografía */
    --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-body:    'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---- Tema oscuro --------------------------------------------------- */
[data-theme="dark"] {
    --bg:           #1A2218;
    --surface:      #243023;
    --surface-alt:  #2C3A2A;
    --text:         #E8EDE6;
    --text-muted:   #A8B0A4;
    --border:       #344232;
    --brand-kraft:  #DDB988;
    --shadow-sm:    0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md:    0 6px 24px rgba(0, 0, 0, .35);
    --shadow-lg:    0 18px 48px rgba(0, 0, 0, .45);
}

/* ---- Reset suave + base -------------------------------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition), color var(--transition);
}

h1, h2, h3, h4, h5, h6, .display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.15;
}

a { color: var(--brand-green-700); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-green-900); }
[data-theme="dark"] a { color: var(--brand-green); }
[data-theme="dark"] a:hover { color: #A2D266; }

img { max-width: 100%; height: auto; }

::selection { background: var(--brand-green); color: white; }

/* Skip to content para accesibilidad */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--brand-green-700);
    color: white;
    padding: .5rem 1rem;
    z-index: 9999;
}
.skip-link:focus { top: 0; color: white; }

/* ---- Botones marca ------------------------------------------------- */
.btn { font-family: var(--font-heading); font-weight: 600; border-radius: 999px; padding: .65rem 1.5rem; transition: all var(--transition); border: 0; }
.btn-primary { background: var(--brand-green); color: white; }
.btn-primary:hover { background: var(--brand-green-700); color: white; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-primary:focus, .btn-primary:active { background: var(--brand-green-700) !important; box-shadow: 0 0 0 .25rem rgba(124, 179, 66, .35) !important; }

.btn-outline-primary { background: transparent; color: var(--brand-green-700); border: 2px solid var(--brand-green); }
.btn-outline-primary:hover { background: var(--brand-green); color: white; transform: translateY(-2px); }
[data-theme="dark"] .btn-outline-primary { color: var(--brand-green); }

.btn-whatsapp { background: #25D366; color: white; }
.btn-whatsapp:hover { background: #1ebe5b; color: white; transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }

/* ---- Navegación principal ------------------------------------------ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
    transition: background-color var(--transition);
}
[data-theme="dark"] .site-header { background: rgba(26, 34, 24, .85); }

.site-header .navbar { padding: .75rem 0; }
.site-header .navbar-brand img { height: 44px; width: auto; transition: transform var(--transition); }
.site-header .navbar-brand:hover img { transform: scale(1.05); }

.site-header .nav-link {
    color: var(--text) !important;
    font-weight: 500;
    padding: .5rem 1rem !important;
    border-radius: 999px;
    transition: background-color var(--transition);
}
.site-header .nav-link:hover { background: var(--surface-alt); }
.site-header .nav-link.active { color: var(--brand-green-700) !important; font-weight: 600; }
[data-theme="dark"] .site-header .nav-link.active { color: var(--brand-green) !important; }

/* Toggle dark mode */
.theme-toggle {
    width: 42px; height: 42px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--surface-alt);
    color: var(--text);
    border: 0;
    transition: all var(--transition);
}
.theme-toggle:hover { transform: rotate(15deg); background: var(--brand-green); color: white; }

/* Menú hamburguesa móvil */
.navbar-toggler { border: 0; box-shadow: none !important; padding: .25rem .5rem; }
.navbar-toggler-icon {
    background-image: none;
    width: 28px; height: 28px;
    position: relative;
}
.navbar-toggler-icon::before, .navbar-toggler-icon::after, .navbar-toggler-icon span {
    content: ''; position: absolute; left: 0; right: 0;
    height: 3px; background: var(--text); border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}
.navbar-toggler-icon::before { top: 6px; }
.navbar-toggler-icon::after  { bottom: 6px; }
.navbar-toggler-icon span    { top: 50%; transform: translateY(-50%); display: block; }
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before { top: 50%; transform: translateY(-50%) rotate(45deg); }
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after  { bottom: 50%; transform: translateY(50%) rotate(-45deg); }
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon span { opacity: 0; }

/* ---- Hero ---------------------------------------------------------- */
.hero {
    position: relative;
    min-height: 78vh;
    display: flex; align-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(124,179,66,.15) 0%, rgba(201,168,124,.15) 100%);
}
.hero-slide {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    z-index: 1;
}
.hero-slide.active { opacity: 1; }
.hero-slide::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(26, 34, 24, .65) 0%, rgba(47, 77, 20, .45) 60%, rgba(124, 179, 66, .25) 100%);
}
.hero .container { position: relative; z-index: 2; }
.hero h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    color: white;
    text-shadow: 0 4px 24px rgba(0, 0, 0, .4);
}
.hero p.lead {
    color: rgba(255, 255, 255, .92);
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    max-width: 36rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .3);
}
.hero-controls {
    position: absolute;
    bottom: 1.5rem; right: 1.5rem;
    z-index: 3;
    display: flex; gap: .5rem;
}
.hero-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .4);
    border: 0;
    cursor: pointer;
    transition: all var(--transition);
}
.hero-dot.active { background: white; width: 36px; border-radius: 999px; }

/* ---- Secciones ----------------------------------------------------- */
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.section-title {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    margin-bottom: .5rem;
}
.section-eyebrow {
    text-transform: uppercase;
    letter-spacing: .15em;
    font-weight: 600;
    color: var(--brand-green-700);
    font-size: .85rem;
    margin-bottom: .75rem;
}
[data-theme="dark"] .section-eyebrow { color: var(--brand-green); }

.section-subtitle { color: var(--text-muted); font-size: 1.1rem; max-width: 42rem; }

/* ---- Tarjetas tipo de producto ------------------------------------- */
.tipo-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all var(--transition);
    display: block;
    color: var(--text);
    height: 100%;
}
.tipo-card:hover {
    transform: translateY(-6px);
    border-color: var(--brand-green);
    box-shadow: var(--shadow-md);
    color: var(--text);
}
.tipo-card .icon {
    width: 64px; height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-green), var(--brand-green-700));
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    transition: transform var(--transition);
}
.tipo-card:hover .icon { transform: rotate(-8deg) scale(1.08); }
.tipo-card h3 { font-size: 1.1rem; margin: .25rem 0 .5rem; }
.tipo-card p  { color: var(--text-muted); margin: 0; font-size: .92rem; }

/* ---- Tarjetas de producto ------------------------------------------ */
.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    height: 100%;
    display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--brand-green); }
.product-card .img-wrap {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--surface-alt);
    position: relative;
}
.product-card img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .6s ease;
}
.product-card:hover img { transform: scale(1.06); }
.product-card .badge-promo {
    position: absolute;
    top: 1rem; left: 1rem;
    background: var(--brand-green);
    color: white;
    padding: .3rem .75rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    box-shadow: var(--shadow-sm);
}
.product-card .info { padding: 1.25rem 1.25rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.product-card .info h3 { font-size: 1.1rem; margin: 0 0 .25rem; }
.product-card .tipo-tag { font-size: .82rem; color: var(--brand-green-700); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
[data-theme="dark"] .product-card .tipo-tag { color: var(--brand-green); }
.product-card .desc { color: var(--text-muted); font-size: .94rem; margin: .5rem 0 .75rem; flex: 1; }
.product-card .price { font-family: var(--font-heading); font-weight: 700; font-size: 1.25rem; color: var(--text); }
.product-card .price-old { color: var(--text-muted); font-size: .9rem; text-decoration: line-through; margin-left: .5rem; }
.product-card .actions { display: flex; gap: .5rem; margin-top: 1rem; }
.product-card .actions .btn { flex: 1; padding: .55rem 1rem; font-size: .9rem; }

/* ---- Ficha de producto -------------------------------------------- */
.product-gallery {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-alt);
    box-shadow: var(--shadow-sm);
}
.product-gallery .main-img {
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
}
.product-gallery .thumbs { display: flex; gap: .5rem; padding: .75rem; background: var(--surface); }
.product-gallery .thumb {
    width: 80px; height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    background-size: cover; background-position: center;
    transition: border-color var(--transition);
    flex-shrink: 0;
}
.product-gallery .thumb.active { border-color: var(--brand-green); }
.product-gallery .thumb:hover { border-color: var(--brand-green-700); }

.product-meta-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.product-meta-list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
}
.product-meta-list li:last-child { border: 0; }
.product-meta-list .lbl { color: var(--text-muted); font-size: .92rem; }
.product-meta-list .val { font-weight: 600; }

/* ---- Filtros del catálogo ----------------------------------------- */
.chip-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
    padding: .5rem 1rem;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    font-size: .9rem;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    display: inline-flex; align-items: center; gap: .4rem;
}
.chip:hover { border-color: var(--brand-green); color: var(--brand-green-700); }
.chip.active { background: var(--brand-green); border-color: var(--brand-green); color: white; }
[data-theme="dark"] .chip:hover { color: var(--brand-green); }

/* ---- Bloque "stats" ----------------------------------------------- */
.stats-row {
    background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-700) 100%);
    color: white;
    padding: 3rem 0;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
}
.stat .num { font-family: var(--font-heading); font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; line-height: 1; }
.stat .lbl { opacity: .9; font-size: .95rem; margin-top: .25rem; }

/* ---- Formularios -------------------------------------------------- */
.form-control, .form-select {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    transition: all var(--transition);
}
.form-control:focus, .form-select:focus {
    background: var(--surface);
    color: var(--text);
    border-color: var(--brand-green);
    box-shadow: 0 0 0 .2rem rgba(124, 179, 66, .2);
}
.form-label { font-weight: 500; color: var(--text); margin-bottom: .4rem; }
.honeypot { position: absolute !important; left: -10000px !important; opacity: 0; height: 0; }

/* ---- Footer ------------------------------------------------------- */
.site-footer {
    background: #1A2218;
    color: #C7CFC4;
    padding: 4rem 0 1.5rem;
    margin-top: 4rem;
}
.site-footer h4 { color: white; font-size: 1.05rem; margin-bottom: 1rem; }
.site-footer a { color: #C7CFC4; transition: color var(--transition); }
.site-footer a:hover { color: var(--brand-green); }
.site-footer .footer-brand img { height: 48px; filter: brightness(1.1); margin-bottom: 1rem; }
.site-footer .social { display: flex; gap: .75rem; margin-top: 1rem; }
.site-footer .social a {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.site-footer .social a:hover { background: var(--brand-green); color: white; transform: translateY(-3px); }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding-top: 1.5rem;
    margin-top: 3rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: .88rem;
}
.footer-attribution {
    display: inline-flex; align-items: center; gap: .5rem;
}
.footer-attribution img {
    /* Logo Webzi es negro por default — sobre footer oscuro, invertimos a blanco */
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: .85;
    transition: opacity var(--transition);
}
.footer-attribution:hover img { opacity: 1; }

/* ---- WhatsApp flotante -------------------------------------------- */
.whatsapp-float {
    position: fixed;
    right: 1.5rem; bottom: 1.5rem;
    width: 60px; height: 60px;
    border-radius: 50%;
    background: #25D366;
    color: white;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.7rem;
    box-shadow: var(--shadow-lg);
    z-index: 1020;
    transition: all var(--transition);
    animation: pulse-ring 2.4s infinite;
}
.whatsapp-float:hover { transform: scale(1.1); color: white; }
@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .5), var(--shadow-lg); }
    70% { box-shadow: 0 0 0 18px rgba(37, 211, 102, 0), var(--shadow-lg); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0), var(--shadow-lg); }
}

/* ---- Animaciones de aparición al hacer scroll --------------------- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .8s ease, transform .8s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .hero-slide { transition: none; }
}

/* ---- Breadcrumbs --------------------------------------------------- */
.breadcrumb-strip {
    background: var(--surface-alt);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.breadcrumb-strip .breadcrumb { margin: 0; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }
.breadcrumb-item a { color: var(--brand-green-700); }
[data-theme="dark"] .breadcrumb-item a { color: var(--brand-green); }
.breadcrumb-item.active { color: var(--text-muted); }

/* ---- Página de inicio: bloque about ------------------------------- */
.about-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    position: relative;
}
.about-image::before {
    content: '';
    position: absolute;
    inset: -20px -20px auto auto;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: var(--brand-kraft);
    opacity: .4;
    z-index: -1;
}

/* ---- Listas de bullets con check ---------------------------------- */
.list-check { list-style: none; padding: 0; }
.list-check li {
    padding: .35rem 0 .35rem 1.8rem;
    position: relative;
}
.list-check li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--brand-green);
    position: absolute;
    left: 0; top: .5rem;
}

/* ---- Alertas custom ----------------------------------------------- */
.alert-success-soft {
    background: rgba(124, 179, 66, .14);
    color: var(--brand-green-900);
    border: 1px solid rgba(124, 179, 66, .35);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
[data-theme="dark"] .alert-success-soft { color: #B8E07A; background: rgba(124, 179, 66, .12); }

/* ---- Responsive ajustes ------------------------------------------- */
@media (max-width: 991.98px) {
    .hero { min-height: 64vh; }
    .section { padding: 3.5rem 0; }
    .site-footer { padding: 3rem 0 1rem; }
}
@media (max-width: 575.98px) {
    .hero { min-height: 60vh; }
    .product-card .actions { flex-direction: column; }
    .whatsapp-float { width: 52px; height: 52px; font-size: 1.4rem; right: 1rem; bottom: 1rem; }
}

/* ---- Card de admin (genérico) ------------------------------------- */
.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
