/* ========================================
   FLORISTERIA ARTISTICA - ESTILOS UNIFICADOS
   Tema floral, responsive, moderno
   ======================================== */

@import url('tokens.css');


/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: clamp(1.125rem, 2.5vw, 1.375rem); }
h5 { font-size: clamp(1rem, 2vw, 1.125rem); }
h6 { font-size: 1rem; }

p { margin-bottom: var(--space-md); }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
}

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

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ========================================
   UTILIDADES
   ======================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.container-sm { max-width: 640px; }
.container-md { max-width: 768px; }
.container-lg { max-width: 1024px; }
.container-xl { max-width: 1280px; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-cols-2, .grid-cols-3, .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ========================================
   BOTONES
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.875rem;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1.0625rem;
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary);
    transform: translateY(-1px);
}

.btn-accent {
    background: var(--accent);
    color: var(--primary-dark);
}

.btn-accent:hover:not(:disabled) {
    background: var(--accent-light);
    transform: translateY(-1px);
}

.btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
}

.btn-ghost {
    color: var(--gray-700);
    background: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--gray-100);
    color: var(--primary);
}

.btn-whatsapp {
    background: #25d366;
    color: var(--white);
}

.btn-whatsapp:hover:not(:disabled) {
    background: #1ebd5a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-block {
    width: 100%;
}

/* ========================================
   FORMULARIOS
   ======================================== */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.9375rem;
}

.form-control {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--gray-800);
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-control:disabled {
    background: var(--gray-100);
    color: var(--gray-500);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right var(--space-md) center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
}

.form-text {
    margin-top: var(--space-xs);
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--primary);
}

/* ========================================
   TARJETAS
   ======================================== */
.card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.card-body {
    padding: var(--space-lg);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.card-text {
    color: var(--gray-600);
    font-size: 0.9375rem;
    margin-bottom: var(--space-md);
}

.card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* ========================================
   BADGES
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-primary { background: var(--primary); color: var(--white); }
.badge-secondary { background: var(--secondary); color: var(--white); }
.badge-accent { background: var(--accent); color: var(--primary-dark); }
.badge-success { background: var(--success); color: var(--white); }
.badge-warning { background: var(--warning); color: var(--white); }
.badge-error { background: var(--error); color: var(--white); }
.badge-outline { background: transparent; border: 1px solid currentColor; }

/* ========================================
   HEADER / NAVBAR
   ======================================== */
.header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--gray-200);
}

.header-top {
    background: var(--primary-dark);
    color: var(--white);
    padding: var(--space-xs) 0;
    font-size: 0.8125rem;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.header-main {
    padding: var(--space-md) 0;
}

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--space-md);
}

/* El logo y las acciones (carrito + Entrar) no se encogen; el menu si, para que
   todo quepa en una fila cuando esta el boton de sesion. En pantallas medianas
   el menu se colapsa a hamburguesa antes de que esto apriete. */
.header-main .logo,
.header-main .header-actions { flex: 0 0 auto; }
.header-main .nav-main { flex: 1 1 auto; justify-content: flex-end; min-width: 0; }

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--primary-dark);
    min-width: 0;
}

/* Sin esto el div interior hereda min-width:auto y anula el encogido. */
.logo > div {
    min-width: 0;
}

/* Logo real de la floristeria. Sustituye al icono generico .logo-icon, que
   queda sin uso pero se conserva por si se quisiera volver a el. */
.logo-img {
    display: block;
    height: 72px;
    width: auto;
    max-width: 100%;
}

/* En el pie hay mas sitio y el fondo es verde oscuro: el PNG va con fondo
   transparente, asi que el dorado y las orquideas se leen bien igual. */
.logo-img--pie {
    height: 76px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
}

.logo-text {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    overflow-wrap: anywhere;
}

.logo-tagline {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1;
}

.nav-main {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    list-style: none;
}

.nav-main a {
    color: var(--gray-700);
    font-weight: 500;
    padding: var(--space-xs) 0;
    position: relative;
}

.nav-main a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition-base);
}

.nav-main a:hover::after,
.nav-main a.active::after {
    width: 100%;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.cart-btn {
    position: relative;
    padding: var(--space-sm);
    border-radius: var(--radius-full);
    color: var(--gray-700);
    transition: all var(--transition-fast);
}

/* Solo aparece por debajo de 768px (d-md-none). En escritorio el carrito ya
   esta en .header-actions, asi que no se duplica. */
.cart-btn--movil {
    color: var(--primary);
    font-size: 1.25rem;
}

.cart-btn:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    background: var(--accent);
    color: var(--primary-dark);
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.mobile-menu-btn {
    display: none;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    color: var(--gray-700);
}

.mobile-menu-btn:hover {
    background: var(--gray-100);
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
    position: relative;
    padding: var(--space-3xl) 0;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: var(--white);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M30 30c0-16.569 13.431-30 30-30s30 13.431 30 30-13.431 30-30 30-30-13.431-30-30zm0 4c0 14.333 11.667 26 26 26s26-11.667 26-26-11.667-26-26-26-26 11.667-26 26z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background: rgba(255,255,255,0.15);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--space-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.875rem, 7vw, 4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--white);
}

.hero p {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: rgba(255,255,255,0.9);
    margin-bottom: var(--space-xl);
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.hero-image {
    position: absolute;
    right: 0;
    bottom: 0;
    max-width: 50%;
    opacity: 0.15;
    pointer-events: none;
}

@media (max-width: 992px) {
    .hero-image { display: none; }
    .hero-content { max-width: 100%; }
}

/* ========================================
   SECCIONES GENERALES
   ======================================== */
.section {
    padding: var(--space-3xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-header h2 {
    margin-bottom: var(--space-sm);
}

.section-header p {
    color: var(--gray-600);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   CATEGORÍAS HOME
   ======================================== */
.categories-section {
    background: var(--white);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.category-card {
    /* Es un <a>: sin esto quedaria en linea y se perderia el aspect-ratio. */
    display: block;
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    aspect-ratio: 4/3;
    text-decoration: none;
    color: var(--white);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.category-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.6) 100%);
    z-index: 1;
    transition: opacity var(--transition-base);
}

.category-card:hover::before {
    opacity: 0.8;
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.category-card:hover img {
    transform: scale(1.05);
}

.category-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-lg);
    z-index: 2;
}

.category-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    /* Es un <h3> y la regla global de titulos lo pintaria del color de marca,
       ganando al blanco de la tarjeta. Sobre la foto no se leeria. */
    color: var(--white);
    /* Las fotos de categoria las sube la floristeria y pueden ser claras: la
       sombra garantiza el contraste sin oscurecer mas la imagen. */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.category-count {
    font-size: 0.875rem;
    color: var(--white);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
    opacity: 0.9;
}

/* ========================================
   PRODUCTOS GRID
   ======================================== */
.products-section {
    background: var(--cream);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

/* Los favoritos de la portada siguen el formato de las tarjetas de categoria de
   justo arriba: misma rejilla (250 px) y foto 4:3 en vez de cuadrada, para que
   las dos secciones se lean como una sola. Va acotado con el id porque
   .products-grid la comparten el catalogo y los productos relacionados, que
   deben seguir con la foto cuadrada. */
#featured-products {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

#featured-products .product-card-image {
    aspect-ratio: 4 / 3;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.product-card-image {
    position: relative;
    /* Algo mas alta que ancha: los arreglos son verticales y asi caben mejor. */
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--cream-dark);
}

.product-card-image img {
    width: 100%;
    height: 100%;
    /* contain (no cover): se ve la foto ENTERA, sin recortar la punta del
       arreglo ni la base del jarron. El fondo crema rellena lo que sobra. */
    object-fit: contain;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

/* Las insignias se apilan solas en una esquina. Antes la de "Destacado" llevaba
   un top: 40px escrito a mano para no chocar con la de promocion, asi que
   quedaba flotando a media foto cuando era la unica. */
.product-badges-cinta {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
}

.product-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.product-badge--promo {
    background: var(--error);
}

.product-badge--destacado {
    background: var(--accent);
    /* Sobre dorado, el texto oscuro se lee mejor que el blanco. */
    color: var(--gray-900);
}

.product-wishlist {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-base);
    z-index: 2;
}

.product-card:hover .product-wishlist {
    opacity: 1;
    transform: translateY(0);
}

.product-wishlist:hover {
    color: var(--rose);
    background: var(--white);
}

.product-card-body {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Empuja el boton al fondo para que todas las tarjetas de una fila terminen
   igual aunque los nombres ocupen una o dos lineas. */
.product-card-body .btn {
    margin-top: auto;
}

.product-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.product-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--gray-800);
}

/* El titulo lleva a la ficha, pero debe seguir leyendose como un titulo y no
   como un enlace morado. */
.product-title a {
    color: inherit;
    text-decoration: none;
}

.product-title a:hover,
.product-title a:focus-visible {
    color: var(--primary);
    text-decoration: underline;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    margin-top: auto;
}

.price-current {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.price-original {
    font-size: 0.9375rem;
    color: var(--gray-400);
    text-decoration: line-through;
}

/* ========================================
   PRODUCTO DETALLE
   ======================================== */
.product-detail {
    background: var(--cream);
}

/* Mismo caso que el carrito: las dos columnas (galeria e informacion) colgaban
   de un <div> suelto con clases col-lg-6, pero ese div no era una .row, asi que
   se apilaban en vez de ponerse una al lado de la otra. */
.producto-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-xl);
    width: 100%;
}

@media (min-width: 992px) {
    .producto-layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

/* Galeria del producto: carrusel horizontal.
   Antes el CSS definia .main-image y .thumb, pero el HTML usaba .gallery-main y
   .gallery-thumb: los nombres no coincidian y no se aplicaba ningun estilo, asi
   que la imagen salia a lo ancho de toda la columna. */
.product-gallery {
    position: relative;
    /* Un arreglo floral no gana nada por ocupar 570 px de ancho. */
    max-width: 420px;
    margin: 0 auto;
}

.galeria-carrusel {
    position: relative;
}

/* El desplazamiento lo hace el navegador: con scroll-snap se pasa de imagen con
   el dedo en el movil sin necesidad de codigo de animacion. */
.galeria-pista {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    border-radius: var(--radius-xl);
    background: var(--cream-dark);
    box-shadow: var(--shadow-md);
    /* Sin barra de desplazamiento a la vista: se navega con el dedo o las flechas. */
    scrollbar-width: none;
}

.galeria-pista::-webkit-scrollbar {
    display: none;
}

.galeria-pista:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.galeria-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    aspect-ratio: 1 / 1;
}

.galeria-slide img {
    width: 100%;
    height: 100%;
    /* La foto completa tambien en la ficha del producto. */
    object-fit: contain;
    display: block;
}

.galeria-flecha {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: background var(--transition-fast), opacity var(--transition-fast);
}

.galeria-flecha:hover:not(:disabled) {
    background: var(--white);
}

.galeria-flecha:disabled {
    opacity: 0.35;
    cursor: default;
}

.galeria-flecha--anterior { left: var(--space-sm); }
.galeria-flecha--siguiente { right: var(--space-sm); }

.gallery-thumbs {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    overflow-x: auto;
    padding-bottom: var(--space-xs);
    scrollbar-width: thin;
}

.gallery-thumb {
    flex: 0 0 64px;
    height: 64px;
    padding: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    background: var(--cream-dark);
    transition: border-color var(--transition-fast);
}

.gallery-thumb:hover,
.gallery-thumb.active {
    border-color: var(--primary);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-info h1 {
    margin-bottom: var(--space-sm);
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
}

.product-meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--gray-600);
    font-size: 0.875rem;
}

.product-price-detail {
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.price-detail-current {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.price-detail-original {
    font-size: 1.25rem;
    color: var(--gray-400);
    text-decoration: line-through;
}

.product-description {
    margin-bottom: var(--space-xl);
    color: var(--gray-700);
    line-height: 1.7;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.qty-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--gray-100);
    color: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all var(--transition-fast);
}

.qty-btn:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
}

.qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.qty-input {
    width: 70px;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--gray-800);
}

.qty-input:focus {
    outline: none;
}

.add-to-cart-btn {
    width: 100%;
    padding: var(--space-md);
    font-size: 1.0625rem;
}

.product-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--gray-200);
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--cream-dark);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-text strong {
    display: block;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.feature-text span {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ========================================
   CARRITO
   ======================================== */
.cart-page {
    background: var(--cream);
    min-height: 100vh;
}

.cart-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: var(--space-lg) 0;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.cart-title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 1.5rem;
}

.cart-count-badge {
    background: var(--primary);
    color: var(--white);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
}

.cart-content {
    padding: var(--space-xl) 0;
}

.cart-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--space-xl);
}

@media (max-width: 992px) {
    .cart-grid {
        grid-template-columns: 1fr;
    }
}

.cart-items {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: 1px solid var(--gray-200);
    align-items: center;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--gray-100);
}

.cart-item-details {
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--space-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-category {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.cart-item-price {
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.cart-item-qty .qty-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

.cart-item-qty .qty-input {
    width: 50px;
    font-size: 1rem;
}

.cart-item-subtotal {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--gray-800);
    white-space: nowrap;
}

.cart-item-remove {
    color: var(--gray-400);
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.cart-item-remove:hover {
    color: var(--error);
    background: var(--gray-100);
}

.cart-empty {
    text-align: center;
    padding: var(--space-3xl) var(--space-md);
}

.cart-empty-icon {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: var(--space-lg);
}

.cart-empty h3 {
    margin-bottom: var(--space-sm);
}

.cart-empty p {
    color: var(--gray-500);
    margin-bottom: var(--space-lg);
}

/* Cart Summary */
.cart-summary {
    position: sticky;
    top: 100px;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: var(--space-lg);
    height: fit-content;
}

.summary-title {
    font-size: 1.25rem;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--gray-200);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
    color: var(--gray-600);
}

.summary-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    padding-top: var(--space-md);
    border-top: 1px solid var(--gray-200);
    margin-top: var(--space-md);
}

.summary-row .value {
    font-weight: 600;
    color: var(--gray-800);
}

.summary-row.total .value {
    color: var(--primary);
}

.checkout-form {
    margin-top: var(--space-lg);
}

.checkout-form .form-group {
    margin-bottom: var(--space-md);
}

.checkout-form label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 500;
    font-size: 0.875rem;
}

.checkout-form input,
.checkout-form textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.checkout-form input:focus,
.checkout-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

.checkout-btn {
    width: 100%;
    margin-top: var(--space-md);
    padding: var(--space-md);
    font-size: 1.0625rem;
}

.secure-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.secure-notice i {
    color: var(--success);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background: var(--primary-dark);
    color: var(--white);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-brand .logo {
    margin-bottom: var(--space-md);
}

.footer-brand p {
    color: rgba(255,255,255,0.7);
    line-height: 1.7;
}

.footer-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--white);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-sm);
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    color: rgba(255,255,255,0.7);
}

.footer-contact i {
    color: var(--accent);
    margin-top: 2px;
    flex-shrink: 0;
}

.footer-social {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    background: var(--accent);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.footer-bottom {
    padding-top: var(--space-xl);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    font-size: 0.875rem;
    color: rgba(255,255,255,0.5);
}

.footer-legal {
    display: flex;
    gap: var(--space-lg);
}

.footer-legal a {
    color: rgba(255,255,255,0.5);
}

.footer-legal a:hover {
    color: var(--accent);
}

/* ========================================
   TOAST NOTIFICACIONES
   ======================================== */
.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 300px;
    max-width: 450px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast.success .toast-icon { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.toast.error .toast-icon { background: rgba(239, 68, 68, 0.1); color: var(--error); }
.toast.warning .toast-icon { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.toast.info .toast-icon { background: rgba(59, 130, 246, 0.1); color: var(--info); }

.toast-message {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--gray-800);
}

.toast-close {
    color: var(--gray-400);
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
}

.toast-close:hover {
    color: var(--gray-700);
    background: var(--gray-100);
}

/* ========================================
   MODAL
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

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

/* IMPORTANTE: estas reglas van acotadas a .modal-overlay a proposito.
   El modal propio del cliente siempre se crea dentro de un .modal-overlay
   (ver main.js). Sin acotar, .modal / .modal-header / .modal-body pisaban a
   los modales de Bootstrap del panel admin, que carga este CSS despues de
   bootstrap.min.css, y los dejaban recortados a 500px, 90vh y scale(0.9). */
.modal-overlay .modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-overlay .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
}

.modal-overlay .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-overlay .modal-close {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: all var(--transition-fast);
}

.modal-overlay .modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-overlay .modal-body {
    padding: var(--space-lg);
}

.modal-overlay .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-top: 1px solid var(--gray-200);
}

/* ========================================
   LOADING / SKELETON
   ======================================== */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-img {
    aspect-ratio: 1/1;
    border-radius: var(--radius-xl);
}

.skeleton-text {
    height: 1rem;
    margin-bottom: var(--space-sm);
}

.skeleton-text:last-child {
    width: 60%;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl);
    gap: var(--space-md);
    color: var(--gray-500);
}

/* ========================================
   PAGINACIÓN
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-xs);
    margin-top: var(--space-xl);
    /* Con 184 productos salen muchas paginas y en pantallas de 320 px la fila
       se salia del ancho. Que baje de linea en vez de desbordar. */
    flex-wrap: wrap;
    padding-left: 0;
    list-style: none;
}

.page-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: var(--gray-700);
    transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
}

.page-btn.active {
    background: var(--primary);
    color: var(--white);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-ellipsis {
    color: var(--gray-400);
    padding: 0 var(--space-sm);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .nav-main {
        position: fixed;
        top: 0;
        left: -100%;
        right: auto;
        width: min(280px, 85vw);
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        padding: var(--space-2xl) var(--space-lg);
        gap: var(--space-md);
        box-shadow: var(--shadow-xl);
        transition: left var(--transition-base);
        z-index: var(--z-modal);
        overflow-y: auto;
    }
    
    .nav-main.active {
        left: 0;
    }
    
    .nav-main a {
        font-size: 1.125rem;
        padding: var(--space-sm) 0;
    }
    
    .mobile-menu-btn {
        display: flex;
        /* El menu se abre por la izquierda: el boton acompana a su panel. */
        order: -1;
    }
    
    .header-main .container {
        flex-wrap: nowrap;
    }
    
    .logo-img {
        height: 56px;
    }
    
    /* Con space-between y solo dos elementos, el logo se iba al borde derecho.
       El margen automatico lo deja pegado al boton del menu. */
    .logo {
        margin-right: auto;
    }
    
    .header-top {
        display: none;
    }
    
    .cart-summary {
        position: static;
    }
    
    .cart-item {
        grid-template-columns: 70px 1fr;
        grid-template-rows: auto auto;
    }
    
    .cart-item-image {
        grid-row: span 2;
    }
    
    .cart-item-price {
        grid-column: 2;
    }
    
    .cart-item-qty {
        grid-column: 2;
    }
    
    .cart-item-subtotal {
        grid-column: 2;
    }
    
    .cart-item-remove {
        grid-column: 2;
        justify-self: end;
    }
}

@media (max-width: 480px) {
    .logo-img {
        height: 46px;
    }
    
    .logo-img--pie {
        height: 64px;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .product-price-detail {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }
}



/* ========================================
   CARRITO: LISTA + RESUMEN
   ======================================== */

/* El contenedor del carrito era un <div> suelto con columnas de Bootstrap
   dentro, pero al no ser una .row las columnas se apilaban y el resumen
   quedaba debajo y a un tercio de ancho. Rejilla propia, sin depender de la
   de Bootstrap. */
.carrito-layout {
    display: grid;
    /* minmax(0, ...) y no 1fr a secas: con 1fr la columna no puede encoger por
       debajo de su contenido y la tabla del carrito ensancha toda la pagina en
       movil. Asi la tabla se queda con su propio scroll horizontal. */
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-xl);
    width: 100%;
}

@media (min-width: 992px) {
    .carrito-layout {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        /* Nada de align-items: start. La columna debe estirarse a lo alto de la
           fila; si se encoge a la altura de la tarjeta, el sticky se queda sin
           recorrido y el resumen se va con el scroll. */
    }
}

/* El resumen se queda a la vista al desplazarse, pero POR DEBAJO de la
   cabecera: la clase sticky-top de Bootstrap trae z-index 1020 y se montaba
   encima de ella. Y se ancla a la altura real de la cabecera, no a un valor
   fijo que se queda corto cuando la cabecera crece. */
.resumen-pedido {
    position: sticky;
    top: calc(var(--altura-cabecera, 192px) + var(--space-md));
    z-index: 1;
}

/* Sin sitio para fijarlo: en movil la cabecera ya se come media pantalla. */
@media (max-width: 991.98px) {
    .resumen-pedido {
        position: static;
    }
}


/* Credito del desarrollador en el pie: discreto, para no competir con la
   informacion de la tienda, pero enlazado para quien quiera contactarlo. */
.credito-autor {
    display: block;
    margin-top: var(--space-xs);
    font-size: 0.8rem;
    opacity: 0.75;
}

.credito-autor a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.credito-autor a:hover {
    opacity: 1;
    color: var(--white);
}



/* ========================================
   CUPON EN EL CARRITO
   ======================================== */
.cupon-zona { text-align: right; }

.cupon-form {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.cupon-form input {
    max-width: 200px;
    text-transform: uppercase;
}

.cupon-aviso {
    margin: var(--space-xs) 0 0;
    font-size: 0.85rem;
    min-height: 1rem;
}
.cupon-aviso--error { color: var(--error); }
.cupon-aviso--ok { color: var(--success); font-weight: 600; }


/* ========================================
   SESION DE CLIENTE (login opcional)
   ======================================== */

#sesion-cliente { display: flex; align-items: center; }

.sesion-entrar { white-space: nowrap; }

.sesion-avatar {
    width: 38px;
    height: 38px;
    padding: 0;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--cream-dark);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.sesion-avatar:hover { border-color: var(--primary); }
.sesion-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sesion-inicial { font-weight: 700; color: var(--primary); }

.sesion-menu { position: relative; }

.sesion-desplegable {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-md);
    z-index: var(--z-dropdown);
}

/* Cabecera del desplegable: foto + nombre + correo, como una cuenta normal. */
.sesion-cabecera {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-bottom: var(--space-sm);
    margin-bottom: var(--space-sm);
    border-bottom: 1px solid var(--gray-200);
}

.sesion-avatar-grande {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--cream-dark);
    display: grid;
    place-items: center;
}
.sesion-avatar-grande img { width: 100%; height: 100%; object-fit: cover; }
.sesion-avatar-grande .sesion-inicial { font-size: 1.1rem; }

.sesion-datos { min-width: 0; }
.sesion-nombre { font-weight: 600; }
.sesion-correo { font-size: 0.8rem; color: var(--gray-500); word-break: break-all; }

.sesion-salir {
    width: 100%;
    border: 1px solid var(--gray-200);
    background: transparent;
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    cursor: pointer;
    color: var(--gray-700);
    font-weight: 500;
    transition: all var(--transition-fast);
}
.sesion-salir:hover { border-color: var(--error); color: var(--error); background: rgba(239,68,68,0.05); }

/* Panel deslizante de login */
.sesion-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    transition: opacity var(--transition-base);
}
.sesion-overlay.abierto { opacity: 1; }

.sesion-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(360px, 90vw);
    height: 100vh;
    background: var(--white);
    z-index: var(--z-modal);
    box-shadow: var(--shadow-xl);
    transition: right var(--transition-base);
    padding: var(--space-2xl) var(--space-xl);
}
.sesion-panel.abierto { right: 0; }

.sesion-cerrar {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    border: none;
    background: transparent;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--gray-500);
}
.sesion-cerrar:hover { color: var(--gray-800); }

.sesion-panel-cuerpo { text-align: center; margin-top: var(--space-2xl); }
.sesion-icono { font-size: 2.5rem; color: var(--primary); margin-bottom: var(--space-md); display: block; }
.sesion-panel-cuerpo p { margin-bottom: var(--space-xl); }
.sesion-google { display: flex; justify-content: center; }

/* ========================================
   SUSCRIPCION A OFERTAS
   ======================================== */

.suscripcion { padding: var(--space-2xl) 0; }

.suscripcion-caja {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    color: var(--white);
    display: grid;
    gap: var(--space-lg);
    align-items: center;
}

@media (min-width: 768px) {
    .suscripcion-caja { grid-template-columns: 1.2fr 1fr; }
}

.suscripcion-texto h2 { color: var(--white); margin-bottom: var(--space-xs); }
.suscripcion-texto p { color: rgba(255,255,255,0.85); margin: 0; }

.suscripcion-form { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

.suscripcion-form input {
    flex: 1;
    min-width: 0;
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.suscripcion-form .btn { white-space: nowrap; }

.suscripcion-aviso { margin: var(--space-sm) 0 0; font-size: 0.9rem; min-height: 1.2rem; }
.suscripcion-caja .suscripcion-aviso { grid-column: 1 / -1; color: rgba(255,255,255,0.95); }
.suscripcion-aviso--ok { font-weight: 600; }
.suscripcion-aviso--error { color: #ffd7d7 !important; }


/* ========================================
   RESENAS DE CLIENTES
   ======================================== */

.review-card {
    background: var(--white);
}

.review-card .card-text {
    /* El texto lo escribe un cliente: puede traer palabras muy largas o URLs. */
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.review-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    margin-right: var(--space-md);
    border-radius: var(--radius-full);
    background: var(--cream-dark);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bloque de identidad: boton de Google y separador */
.review-identidad {
    margin-bottom: var(--space-lg);
    text-align: center;
}

.review-identidad #google-boton {
    display: flex;
    justify-content: center;
}

.review-o {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0 0;
    color: var(--gray-500);
    font-size: 0.85rem;
}

.review-o::before,
.review-o::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* Ficha de quien ya entro con Google */
.review-perfil {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    background: var(--cream);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
}

.review-perfil img {
    border-radius: var(--radius-full);
    flex: 0 0 auto;
}

.review-perfil > div {
    flex: 1;
    min-width: 0;
}

.review-avatar--foto {
    object-fit: cover;
    background: var(--cream-dark);
}

.review-verificada {
    color: var(--primary);
    font-size: 0.85em;
    vertical-align: baseline;
}

.reviews-form-wrap {
    margin-top: var(--space-2xl);
    text-align: center;
}

.review-form {
    max-width: 560px;
    margin: 0 auto;
    text-align: left;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
}

.review-field {
    margin-bottom: var(--space-lg);
}

.review-label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

/* Estrellas: los radios van en orden 5..1 para que el selector ~ pueda
   pintar de dorado la elegida y todas las que le siguen (las menores). */
.rating-input {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: var(--space-xs);
    font-size: 1.75rem;
}

.rating-input input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.rating-input label {
    color: var(--gray-300);
    cursor: pointer;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.rating-input input:checked ~ label,
.rating-input label:hover,
.rating-input label:hover ~ label {
    color: var(--accent);
}

.rating-input label:hover {
    transform: scale(1.1);
}

/* Sin esto no habria forma de saber por teclado que estrella esta enfocada. */
.rating-input input:focus-visible + label {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Trampa para bots: fuera de la vista pero sin display:none, que algunos
   rellenadores automaticos ignoran. */
.review-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.review-feedback {
    margin-bottom: var(--space-md);
    font-size: 0.95rem;
    min-height: 1.25rem;
}

.review-feedback--error {
    color: var(--error);
}

.review-feedback--exito {
    color: var(--success);
    font-weight: 600;
}

/* ========================================
   FILTROS PLEGABLES (ACORDEON)
   ======================================== */

.filtro-seccion {
    border-bottom: 1px solid var(--gray-200);
}

.filtro-seccion:last-of-type {
    border-bottom: none;
}

.filtro-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    font-weight: 600;
    color: var(--gray-800);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

/* El triangulo por defecto de <summary>; usamos nuestra propia flecha. */
.filtro-titulo::-webkit-details-marker { display: none; }
.filtro-titulo::marker { content: ''; }

.filtro-titulo:hover {
    color: var(--primary);
}

.filtro-titulo:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.filtro-flecha {
    transition: transform var(--transition-fast);
    flex: 0 0 auto;
}

.filtro-seccion[open] > .filtro-titulo .filtro-flecha {
    transform: rotate(180deg);
}

.filtro-cuerpo {
    padding-bottom: var(--space-lg);
}

/* ========================================
   ANIMACIONES EXTRA
   ======================================== */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

.slide-up {
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.zoom-in {
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { 
        opacity: 0; 
        transform: scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Focus visible para accesibilidad */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .header, .footer, .cart-summary, .toast-container, .modal-overlay {
        display: none !important;
    }
    
    body {
        background: var(--white);
    }
    
    .cart-page {
        min-height: auto;
    }
}