:root {
    --bg: #121212;
    --surface: #1a1a1a;
    --bg-hover: #242424;
    --card: #1e1e1e;
    --text: #ffffff;
    --muted: #a0a0a0;
    --border: #333333;
    --red: #ff4d4d;
    --wa-green: #25D366;
}
.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;
}

body.light-mode {
    --bg: #F5F5F5;       /* Pure White */
    --surface: #E5E1D8;  /* Whisper */
    --bg-hover: #D8C9BA; /* Latte */
    --card: #E1DBCE;     /* Pale Oak */
    --text: #2F2A26;     /* Negro entre gris y marrón */
    --muted: #6E655E;    /* Gris amarronado suave */
    --border: #CCB9AC;   /* Oat */
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Montserrat', sans-serif; }

html, body { 
    background: var(--bg); 
    color: var(--text); 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden; 
}

.logo img, .spinner-logo, .footer-logo img { 
    image-rendering: pixelated; 
    image-rendering: -moz-crisp-edges; 
    image-rendering: crisp-edges; 
}

/* --- SPLASH DE CARGA INICIAL --- */
#splash-loader {
    position: fixed; inset: 0; background: #000000;
    display: flex; justify-content: center; align-items: center;
    z-index: 99999; opacity: 1; transition: opacity 0.45s ease;
}
#splash-loader.hiding { opacity: 0; pointer-events: none; }
#splash-loader.hidden { display: none !important; }
.splash-logo {
    width: 170px; max-width: 55vw; height: auto; object-fit: contain;
    animation: splashLogoFade 1.8s ease-in-out infinite;
}
@keyframes splashLogoFade {
    0% { opacity: 0; transform: scale(0.95); }
    45% { opacity: 1; transform: scale(1); }
    80% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.97); }
}

/* --- PRELOADER --- */
#preloader {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    display: none; justify-content: center; align-items: center;
    z-index: 9999; backdrop-filter: blur(4px);
}
#preloader.active { display: flex; }
.spinner-logo { width: 80px; height: 80px; animation: girar 1s linear infinite; }
@keyframes girar { 100% { transform: rotate(360deg); } }

/* --- CÍRCULO VOLADOR --- */
.flying-dot {
    position: fixed;
    width: 24px;
    height: 24px;
    background-color: var(--red);
    border-radius: 50%;
    z-index: 99999;
    pointer-events: none;
    box-shadow: 0 0 12px rgba(255, 77, 77, 0.8);
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease-in;
}

/* --- CABECERA FIJA --- */
#top-bar {
    position: sticky; top: 0; z-index: 1000;
    background: var(--surface); border-bottom: 1px solid var(--border);
    width: 100%;
    transition: background 0.25s, border-color 0.25s;
}

header {
    padding: 15px 40px;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.logo { display: flex; align-items: center; cursor: pointer; transition: opacity 0.2s; justify-self: start; }
.logo:hover { opacity: 0.8; }
.logo img { height: 60px; width: auto; transition: transform 0.3s ease; }
.logo:hover img { transform: rotate(-5deg); }

.search-bar {
    justify-self: center; width: 100%; max-width: 800px;
    display: flex; align-items: center;
    background: var(--bg-hover); border: 1px solid var(--border);
    border-radius: 8px; padding: 12px 15px;
}
.search-bar i { color: var(--muted); margin-right: 12px; font-size: 16px; }
.search-bar input { background: none; border: none; color: var(--text); width: 100%; outline: none; font-size: 15px; }
.search-bar:has(input:focus-visible) { outline: 2px solid #22c55e; outline-offset: 2px; }

.header-icons { display: flex; align-items: center; gap: 20px; justify-self: end; }
.header-icons a { text-decoration: none; }
.header-icons a i, .header-icons .cart-icon i { font-size: 26px; color: var(--muted); cursor: pointer; transition: 0.2s; }
.header-icons a:hover i, .header-icons .cart-icon:hover i { color: var(--text); transform: scale(1.1); }

.theme-toggle {
    background: transparent;
    border: none;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text);
    transform: scale(1.06);
}
.theme-toggle svg {
    width: 20px;
    height: 20px;
    display: block;
}
.theme-toggle .icon-sun { display: none; }
body.light-mode .theme-toggle .icon-moon { display: none; }
body.light-mode .theme-toggle .icon-sun { display: block; }

.lang-selector { position: relative; cursor: pointer; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 6px; }
.lang-selector:hover { background: var(--bg-hover); }
.lang-selector i { font-size: 18px; color: var(--muted); transition: color 0.2s; }
.lang-selector:hover i { color: var(--text); }
.lang-selector span { white-space: nowrap; }
.lang-selector .lang-short { display: none; }

.dropdown {
    position: absolute; top: 130%; right: 0; background: var(--card);
    border: 1px solid var(--border); border-radius: 8px; display: none;
    flex-direction: column; min-width: 200px; z-index: 10; box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.dropdown.active { display: flex; }
.dropdown div { padding: 12px 15px; font-size: 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.dropdown div:hover { background: var(--bg-hover); }
.dropdown div:last-child { border-bottom: none; }

/* --- MENÚ LATERAL DE CATEGORÍAS (DRAWER IZQUIERDO) --- */
.cat-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.cat-drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}
.cat-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 86vw;
    height: 100vh;
    height: 100dvh;
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 10001;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.6);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.cat-dropdown.active {
    transform: translateX(0);
}
.cat-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface);
}
.cat-drawer-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}
.cat-drawer-close {
    background: none;
    border: none;
    color: var(--text);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.cat-drawer-close:hover {
    opacity: 1;
}
.cat-dropdown > div:not(.cat-submenu):not(.cat-drawer-header),
.cat-submenu .cat-subitem {
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    text-align: left;
    transition: background 0.2s;
}
.cat-dropdown > div:not(.cat-submenu):not(.cat-drawer-header):hover,
.cat-submenu .cat-subitem:hover {
    background: var(--bg-hover);
}
.cat-dropdown > div:last-child,
.cat-submenu .cat-subitem:last-child {
    border-bottom: none;
}
.cat-dropdown i {
    color: var(--muted);
    width: 16px;
    text-align: center;
}
.cat-item-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.cat-item-arrow {
    font-size: 10px;
    width: auto !important;
    margin-left: auto;
}
.cat-group-toggle {
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 12px !important;
}
.cat-group-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.cat-group-arrow {
    font-size: 11px;
    transition: transform 0.2s;
    width: auto !important;
}
.cat-group-toggle.open .cat-group-arrow {
    transform: rotate(180deg);
}
.cat-submenu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.cat-submenu.open {
    display: flex;
}
.cat-submenu .cat-subitem {
    padding: 10px 16px 10px 28px;
    font-size: 13px;
    font-weight: 500;
}
.card-platform {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}

.cart-icon { position: relative; cursor: pointer; display: flex; align-items: center; }
.cart-badge {
    position: absolute; top: -8px; right: -10px; background: var(--red);
    color: white; font-size: 11px; font-weight: 800; padding: 2px 6px;
    border-radius: 50%; transition: transform 0.1s; pointer-events: none;
}
.cart-badge.pop { animation: pop 0.3s ease; }
@keyframes pop { 50% { transform: scale(1.5); } }

/* --- NAVEGACIÓN --- */
nav {
    padding: 12px 40px; display: flex; gap: 25px; font-size: 13px;
    white-space: nowrap; position: relative; width: 100%;
    overflow-x: auto; scrollbar-width: none;
}
nav::-webkit-scrollbar { display: none; }

nav a { color: var(--muted); text-decoration: none; transition: 0.3s; display: flex; align-items: center; gap: 5px;}
nav a:hover { color: var(--text); }

/* --- VISTA TIENDA --- */
#store-view { padding-bottom: 50px; flex: 1; width: 100%; }

.hero { 
    padding: 30px 40px 20px; width: 100%; 
    max-height: 400px; overflow: hidden; opacity: 1;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease-in-out;
}

.hero-banner {
    position: relative;
    overflow: hidden;
    background: linear-gradient(to right, #1c1c1c, #2a2a2a);
    border-radius: 12px; height: 280px; 
    display: flex; flex-direction: column;
    justify-content: center; align-items: center; text-align: center;
    border: 1px solid var(--border); width: 100%;
}
body.light-mode .hero-banner {
    background: linear-gradient(to right, #D8C9BA, #CCB9AC);
}
.hero-banner h1 { font-size: 36px; margin-bottom: 20px; font-weight: 800; text-align: center; }
.hero-slide {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center; text-align: center;
    padding: 20px;
    opacity: 0; pointer-events: none;
    transition: opacity 0.45s ease;
}
.hero-slide.active { opacity: 1; pointer-events: auto; }
.hero-slide-bg {
    position: absolute !important; inset: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 0 !important; pointer-events: none;
}
.hero-slide.has-overlay::before {
    content: ''; position: absolute; inset: 0; z-index: 1;
    background: rgba(0, 0, 0, 0.45);
}
.hero-slide > *:not(.hero-slide-bg) { position: relative; z-index: 2; }
.hero-slide h1 { color: #ffffff; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.hero-nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    background: rgba(0, 0, 0, 0.45); color: #fff; border: none;
    width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.hero-nav-btn:hover { background: rgba(0, 0, 0, 0.75); }
.hero-nav-btn.prev { left: 12px; }
.hero-nav-btn.next { right: 12px; }
.hero-dots {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 7px; z-index: 3;
}
.hero-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.4); border: none; cursor: pointer; padding: 0;
}
.hero-dot.active { background: #ffffff; transform: scale(1.2); }
.btn { background: var(--text); color: var(--bg); padding: 12px 26px; border: none; border-radius: 12px; font-weight: 800; cursor: pointer; transition: 0.2s; text-transform: uppercase; display: inline-flex; align-items: center; justify-content: center; transform: skewX(-12deg); }
.btn:hover { background: var(--muted); transform: skewX(-12deg) scale(1.02); }
.btn-skew-label { display: inline-flex; align-items: center; justify-content: center; gap: 8px; transform: skewX(12deg); }

.hero.hero-hidden { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; pointer-events: none; }

.categories { 
    display: flex; justify-content: center; gap: 40px; padding: 20px 40px; 
    overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: none; width: 100%;
}
.categories::-webkit-scrollbar { display: none; }

.category { 
    display: flex; flex-direction: column; align-items: center; gap: 10px; 
    color: var(--muted); font-size: 12px; cursor: pointer; min-width: 80px; transition: 0.2s; 
}
.category:hover { color: var(--text); transform: translateY(-2px); }
.category i { font-size: 24px; }

.products { padding: 30px 40px; }

.products-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; flex-wrap: wrap; gap: 10px; }
.products-header-right { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-count { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.products h2 { font-size: 22px; font-weight: 700; }

/* --- PUBLICACIONES RECIENTES (CARRUSEL COVERFLOW 5 IMÁGENES) --- */
.recent-posts { padding: 10px 40px 48px; min-height: 430px; }
.recent-posts-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.recent-posts h2 { font-size: 22px; font-weight: 700; }
.ig-carousel-wrap {
    position: relative;
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ig-carousel-stage {
    position: relative;
    width: 100%;
    height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ig-slide {
    position: absolute;
    width: 310px;
    height: 310px;
    border-radius: 26px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.38s ease, box-shadow 0.38s ease;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    user-select: none;
}
.ig-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.38s ease, transform 0.38s ease;
}
.ig-slide.is-center {
    transform: translateX(0) scale(1);
    opacity: 1;
    z-index: 4;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.52);
}
.ig-slide.is-prev {
    transform: translateX(-58%) scale(0.82);
    opacity: 1;
    z-index: 3;
}
.ig-slide.is-next {
    transform: translateX(58%) scale(0.82);
    opacity: 1;
    z-index: 3;
}
.ig-slide.is-prev2 {
    transform: translateX(-108%) scale(0.66);
    opacity: 1;
    z-index: 2;
}
.ig-slide.is-next2 {
    transform: translateX(108%) scale(0.66);
    opacity: 1;
    z-index: 2;
}
.ig-slide.is-prev img,
.ig-slide.is-next img {
    filter: brightness(0.68) blur(1.2px);
    transform: scale(1.04);
}
.ig-slide.is-prev2 img,
.ig-slide.is-next2 img {
    filter: brightness(0.45) blur(2.5px);
    transform: scale(1.07);
}
body.light-mode .ig-slide {
    box-shadow: 0 10px 22px rgba(47, 42, 38, 0.14);
}
body.light-mode .ig-slide.is-center {
    box-shadow: 0 16px 34px rgba(47, 42, 38, 0.22);
}
.ig-slide.is-hidden {
    transform: translateX(0) scale(0.5);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}
.ig-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.ig-nav-btn:hover { background: var(--bg-hover); transform: translateY(-50%) scale(1.06); }
.ig-nav-btn.prev { left: 8px; }
.ig-nav-btn.next { right: 8px; }
.ig-follow-wrap {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}
.btn-ig-follow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--text);
    color: var(--bg);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: background 0.2s, transform 0.2s;
}
.btn-ig-follow:hover { background: var(--muted); transform: scale(1.02); }
.btn-ig-follow i { font-size: 16px; }
.hero-banner .btn { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 768px) {
    .recent-posts { padding: 10px 14px 34px; }
    .ig-carousel-stage { height: 250px; }
    .ig-slide { width: 220px; height: 220px; border-radius: 22px; }
    .ig-slide.is-prev { transform: translateX(-46%) scale(0.8); }
    .ig-slide.is-next { transform: translateX(46%) scale(0.8); }
    .ig-slide.is-prev2 { transform: translateX(-82%) scale(0.64); opacity: 1; }
    .ig-slide.is-next2 { transform: translateX(82%) scale(0.64); opacity: 1; }
    .ig-nav-btn { width: 34px; height: 34px; font-size: 13px; }
}

.btn-reset-filter { display: none; background: transparent; color: var(--muted); border: 1px solid var(--border); padding: 6px 12px; border-radius: 20px; font-size: 12px; cursor: pointer; transition: 0.2s; }
.btn-reset-filter:hover { color: var(--text); border-color: var(--text); }

.pagination-bar {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.recent-posts,
#extra-home-sections .products,
footer {
    content-visibility: auto;
    contain-intrinsic-size: 1px 420px;
}
.section-divider {
    height: 1px;
    border: none;
    margin: 14px 40px 22px;
    background: linear-gradient(90deg, transparent, var(--border) 15%, var(--border) 85%, transparent);
}
@media (max-width: 768px) {
    .section-divider { margin: 10px 16px 18px; }
}
.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.page-btn:hover:not(:disabled):not(.active) { background: var(--bg-hover); border-color: var(--muted); }
.page-btn.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 15px; align-content: start; }
#product-grid { min-height: 220px; }
@media (max-width: 768px) {
    #product-grid { min-height: 220px; }
    .recent-posts { min-height: 330px; }
}

.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; transition: 0.2s; overflow: hidden; cursor: pointer; position: relative; }
.card:hover { transform: translateY(-5px); border-color: #555; box-shadow: 0 10px 20px rgba(0,0,0,0.4); }
body.light-mode .card:hover { border-color: #b49f90; box-shadow: 0 10px 20px rgba(47, 42, 38, 0.12); }

.card-category {
    position: absolute; top: 10px; left: 10px; background: rgba(18, 18, 18, 0.85);
    color: var(--text); font-size: 10px; font-weight: 800; text-transform: uppercase;
    padding: 4px 8px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(4px); z-index: 2; letter-spacing: 0.5px;
}
body.light-mode .card-category {
    background: rgba(245, 245, 245, 0.9);
    border-color: rgba(47, 42, 38, 0.18);
}
.card-offer-badge {
    position: absolute; top: 10px; right: 10px; background: #dc2626;
    color: #ffffff; font-size: 10px; font-weight: 800; text-transform: uppercase;
    padding: 4px 8px; border-radius: 4px; z-index: 2; letter-spacing: 0.6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.card-img { width: 100%; aspect-ratio: 1 / 1; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; justify-content: center; align-items: center; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.card:hover .card-img img { transform: scale(1.05); }

.card-info { padding: 12px; display: flex; flex-direction: column; flex-grow: 1; }
.card-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; line-height: 1.2; }
.card-price { font-size: 16px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.card-price-old { font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: line-through; }
.card-price.has-discount .card-price-current { color: var(--text); }
body.light-mode .card-price.has-discount .card-price-current { color: var(--text); }
.card-discount-badge {
    display: inline-block; background: #dc2626; color: #ffffff;
    font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 5px;
    line-height: 1.2; align-self: center;
}

.btn-add { 
    margin-top: auto; background: transparent; color: var(--text); border: 1.5px solid rgba(255, 255, 255, 0.4);
    padding: 10px 15px; border-radius: 10px; cursor: pointer; font-weight: 600; transition: all 0.3s ease; 
    font-size: 12px; white-space: nowrap; display: flex; justify-content: center; align-items: center;
    transform: skewX(-12deg);
}
.btn-add:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); color: var(--text); border-color: var(--text); box-shadow: 0 0 10px rgba(255, 255, 255, 0.1); transform: skewX(-12deg); }
body.light-mode .btn-add { border-color: var(--border); }
body.light-mode .btn-add:hover { background: var(--bg-hover); border-color: var(--text); box-shadow: none; }

/* --- VISTAS SECUNDARIAS --- */
#product-view { display: none; padding: 24px 28px 50px; flex: 1; width: 100%; }
.detail-top-bar { border-bottom: none; margin-bottom: 16px; max-width: 1120px; margin-left: auto; margin-right: auto; padding-bottom: 0; }
.product-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; max-width: 1120px; margin: 0 auto; align-items: start; }
.product-detail-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.product-hero-card { display: flex; gap: 22px; align-items: flex-start; background: var(--card); border-radius: 14px; border: 1px solid var(--border); padding: 22px; }
.product-detail-img { flex: 0 0 260px; max-width: 260px; width: 100%; }
.product-detail-img #detail-img { width: 100%; height: auto; aspect-ratio: 1 / 1; display: block; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.product-detail-info { flex: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0; }

.product-category-tag { display: inline-block; background: var(--bg-hover); color: var(--text); font-size: 11px; font-weight: 800; text-transform: uppercase; padding: 5px 10px; border-radius: 6px; margin-bottom: 12px; border: 1px solid var(--border); align-self: flex-start; letter-spacing: 0.5px; }
.product-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.product-tags .product-category-tag { margin-bottom: 0; }
.product-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.product-thumbs img { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; border: 2px solid var(--border); cursor: pointer; transition: border-color 0.2s, transform 0.2s; }
.product-thumbs img:hover, .product-thumbs img.active { border-color: var(--text); transform: scale(1.04); }
.product-detail-info h1 { font-size: 24px; font-weight: 800; margin-bottom: 4px; line-height: 1.25; word-break: break-word; }

.product-specs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); width: 100%; }
.product-spec-item { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.product-spec-item i { font-size: 17px; color: #22c55e; flex-shrink: 0; }
.product-spec-item .spec-label { display: block; font-size: 11px; color: var(--muted); }
.product-spec-item strong { display: block; font-size: 13px; color: var(--text); font-weight: 700; }

.product-category-tag.offer-tag { background: #dc2626; color: #ffffff; border-color: #dc2626; }
.detail-offer-until { font-size: 12px; color: #f87171; font-weight: 600; margin: -6px 0 12px; }
body.light-mode .detail-offer-until { color: #dc2626; }

.detail-variants-wrap { width: 100%; text-align: left; }
.detail-variants-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin-bottom: 10px; }
.detail-variants-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.variant-card {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.18s, transform 0.15s, background 0.18s;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}
.variant-card:hover:not(:disabled) { border-color: var(--text); transform: translateY(-1px); }
.variant-card.active { border-color: #22c55e; box-shadow: 0 0 0 1px #22c55e; background: rgba(34, 197, 94, 0.08); }
.variant-card:disabled { opacity: 0.45; cursor: not-allowed; }
.variant-card-name { font-size: 14px; font-weight: 800; line-height: 1.25; }
.variant-card-price { font-size: 12px; font-weight: 600; color: var(--muted); }
.variant-card-stock { font-size: 10px; font-weight: 700; color: #ef4444; margin-top: 2px; }

.product-desc-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 22px; }
.product-desc-heading { font-size: 16px; font-weight: 800; margin-bottom: 12px; color: var(--text); }
.product-desc-card .description { font-size: 14px; color: var(--muted); line-height: 1.65; margin-bottom: 0; }
.product-desc-card .description p { margin-bottom: 8px; }
.product-desc-card .description h3, .product-desc-card .description h4 { color: var(--text); font-size: 15px; font-weight: 700; margin: 12px 0 6px; }
.product-desc-card .description ul, .product-desc-card .description ol { padding-left: 20px; margin: 8px 0; }
.product-desc-card .description li { margin-bottom: 4px; }
.product-desc-card .description strong, .product-desc-card .description b { color: var(--text); }

.product-buy-box { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 14px; }
.buy-box-card, .buy-box-trust-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.buy-box-kicker { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.7px; color: #22c55e; margin-bottom: 6px; }
.buy-box-card .price { font-size: 28px; font-weight: 800; color: var(--text); margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.buy-box-card .price .price-old { font-size: 16px; font-weight: 500; color: var(--muted); text-decoration: line-through; }
.buy-box-card .price.has-discount .price-current { color: var(--text); }
body.light-mode .buy-box-card .price.has-discount .price-current { color: var(--text); }
.price-discount-badge {
    display: inline-block; background: #dc2626; color: #ffffff;
    font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 6px;
    line-height: 1.2; align-self: center;
}
.buy-box-selected { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); background: var(--bg-hover); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; margin-bottom: 14px; }
.buy-box-selected i { color: #22c55e; font-size: 14px; }

.product-detail-actions { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; width: 100%; }
.product-detail-actions .qty-controls { height: 44px; padding: 0 4px; border-radius: 8px; flex-shrink: 0; }
.product-detail-actions .qty-btn { width: 32px; height: 34px; font-size: 16px; }
.product-detail-actions .qty-number { font-size: 15px; min-width: 22px; }

.btn-buy-large {
    flex: 1; min-width: 0; background: var(--text); color: var(--bg);
    padding: 13px 18px; border: none; border-radius: 12px;
    font-weight: 800; font-size: 12.5px; cursor: pointer; transition: 0.2s;
    text-transform: uppercase; white-space: nowrap;
    display: inline-flex; align-items: center; justify-content: center; text-align: center;
    transform: skewX(-12deg);
}
.btn-buy-large .btn-skew-label { display: inline-block; transform: skewX(12deg); }
.btn-buy-large:hover:not(:disabled) { background: var(--muted); transform: skewX(-12deg) scale(1.02); }

.trust-title { font-size: 13px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.trust-title i { color: #22c55e; }
.trust-payments { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.trust-payments span { font-size: 11px; font-weight: 700; color: var(--text); background: var(--bg-hover); border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; }
.trust-note { font-size: 12px; color: var(--muted); line-height: 1.45; margin: 0; }

.related-products { max-width: 1120px; margin: 36px auto 0; }
.related-products h3 { font-size: 18px; font-weight: 800; margin-bottom: 18px; }
.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) {
    .product-detail-layout { display: flex; flex-direction: column; gap: 14px; }
    .product-detail-main { display: contents; }
    .product-hero-card { order: 1; width: 100%; flex-direction: column; align-items: center; padding: 16px; gap: 14px; }
    .product-detail-img { flex: unset; max-width: 260px; width: 100%; }
    .product-detail-info { width: 100%; }
    .product-specs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .detail-variants-wrap { order: 2; width: 100%; }
    .detail-variants-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .product-buy-box { order: 3; position: static; width: 100%; }
    .product-desc-card { order: 4; width: 100%; padding: 16px; }
    .related-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

#cart-view { display: none; padding: 40px; min-height: 70vh; flex: 1; width: 100%;}
.cart-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 1px solid var(--border); padding-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.cart-top h2 { font-size: 26px; font-weight: 800; }
.btn-back { background: transparent; color: var(--muted); border: 1px solid var(--border); padding: 10px 20px; border-radius: 50px; cursor: pointer; transition: 0.2s; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.btn-back:hover { color: var(--text); border-color: var(--text); }

.cart-layout { display: flex; gap: 30px; flex-wrap: wrap; width: 100%;}
.cart-items { flex: 2; min-width: 250px; display: flex; flex-direction: column; gap: 15px; }

.cart-item { background: var(--card); padding: 15px 20px; border-radius: 8px; border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 15px; transition: opacity 0.3s ease, transform 0.3s ease; }
.cart-item.removing { opacity: 0; transform: scale(0.95); pointer-events: none; }
.cart-particle {
    position: fixed;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.9), 0 0 2px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
}
.confirm-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9500;
    padding: 16px;
}
.confirm-modal-backdrop.active { display: flex; }
.confirm-modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 24px;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    text-align: center;
}
.confirm-modal h4 { font-size: 17px; font-weight: 800; margin-bottom: 8px; color: var(--text); }
.confirm-modal p { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 18px; }
.confirm-modal-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-modal-actions button {
    flex: 1;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid var(--border);
}
.btn-modal-cancel { background: var(--bg-hover); color: var(--text); }
.btn-modal-cancel:hover { border-color: var(--muted); }
.btn-modal-delete { background: var(--red); color: #ffffff; border-color: var(--red) !important; }
.btn-modal-delete:hover { opacity: 0.9; }

.cart-toast {
    position: fixed;
    top: 76px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: #16a34a;
    color: #ffffff;
    border: 1px solid #22c55e;
    padding: 10px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    z-index: 2500;
    white-space: nowrap;
    max-width: calc(100vw - 24px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.cart-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.cart-item-left { display: flex; align-items: center; gap: 15px; }
.cart-item-img { width: 60px; height: 60px; border-radius: 6px; object-fit: cover; background: var(--surface); border: 1px solid var(--border); }
.cart-item-info h4 { font-size: 15px; margin-bottom: 4px; }
.cart-item-info p { font-size: 13px; color: var(--muted); margin-bottom: 8px;}

/* CONTROLES DE CANTIDAD */
.qty-controls { display: flex; align-items: center; gap: 10px; background: var(--bg-hover); width: fit-content; border-radius: 6px; border: 1px solid var(--border); }
.qty-btn { background: transparent; color: var(--text); border: none; width: 28px; height: 28px; font-size: 16px; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: 0.2s;}
.qty-btn:hover { background: rgba(255,255,255,0.1); }
.qty-number { font-size: 14px; font-weight: 600; min-width: 20px; text-align: center; }

.cart-item-right { display: flex; align-items: center; gap: 20px; }
.cart-item-prices { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cart-price-old { font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: line-through; }
.btn-remove { background: none; border: none; color: var(--red); font-size: 18px; cursor: pointer; transition: 0.2s; }
.btn-remove:hover { transform: scale(1.2); }

.cart-summary { flex: 1; min-width: 250px; background: var(--card); padding: 25px; border-radius: 10px; border: 1px solid var(--border); height: fit-content; }
.cart-summary h3 { font-size: 20px; margin-bottom: 20px; font-weight: 700; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 15px; font-size: 14px; color: var(--muted); }
.summary-total { display: flex; justify-content: space-between; font-size: 20px; font-weight: 800; color: var(--text); border-top: 1px solid var(--border); padding-top: 20px; margin-top: 20px; }

.cart-email-box {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cart-email-box label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.cart-email-box input {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 11px 13px;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
}
.cart-email-box input:focus {
    border-color: var(--text);
}
.cart-email-box input:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

.btn-checkout { width: 100%; background: var(--wa-green); color: white; padding: 15px 18px; border: none; border-radius: 12px; font-weight: 800; margin-top: 20px; cursor: pointer; transition: 0.2s; font-size: 15px; text-transform: uppercase; display: flex; justify-content: center; align-items: center; gap: 10px; text-align: center; transform: skewX(-12deg); }
.btn-checkout:hover { background: #1ebe56; transform: skewX(-12deg) scale(1.02); }
.btn-checkout i { font-size: 20px; }

.btn-checkout-ig {
    margin-top: 12px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}
.btn-checkout-ig:hover {
    background: linear-gradient(45deg, #e08322 0%, #d5572b 25%, #cb1632 50%, #bb1255 75%, #ab0777 100%);
    transform: skewX(-12deg) scale(1.02);
}

.payment-methods {
    margin-top: 6px;
    padding-top: 14px;
    margin-bottom: 4px;
    border-top: 1px solid var(--border);
    text-align: left;
}
.payment-methods-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.payment-logos {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 4px;
}
.payment-badge {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    border-radius: 12px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    font-family: inherit;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transform: skewX(-12deg);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.payment-badge > * {
    transform: skewX(12deg);
}
.payment-badge:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text);
    transform: skewX(-12deg) scale(1.01);
}
.payment-badge.active {
    border-color: var(--text);
    box-shadow: 0 0 0 1px var(--text);
    background: rgba(255, 255, 255, 0.12);
}
.payment-icon-box {
    width: 40px;
    height: 30px;
    border-radius: 6px;
    background: var(--card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.payment-badge svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: block;
}
.payment-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.payment-name {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}
.payment-sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    margin-top: 2px;
}
.payment-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--muted);
    flex-shrink: 0;
    margin-left: auto;
    position: relative;
    transition: border-color 0.2s;
}
.payment-badge.active .payment-radio {
    border-color: #22c55e;
}
.payment-badge.active .payment-radio::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: #22c55e;
}

.empty-msg { text-align: center; color: var(--muted); padding: 40px 0; font-size: 16px; }

/* --- PIE DE PÁGINA --- */
footer { background: var(--surface); border-top: 1px solid var(--border); padding: 40px; margin-top: auto; width: 100%; transition: background 0.25s, border-color 0.25s; }
.footer-content { display: flex; justify-content: space-between; align-items: center; gap: 30px; flex-wrap: wrap; max-width: 1200px; margin: 0 auto; width: 100%; }
.footer-logo img { height: 60px; width: auto; }
.footer-desc { flex: 1; }
.footer-desc p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.footer-socials { display: flex; gap: 20px; }
.footer-socials a i { font-size: 26px; color: var(--muted); transition: 0.2s; }
.footer-socials a:hover i { color: var(--text); transform: scale(1.1); }
.footer-bottom { text-align: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }

/* --- BOTÓN VOLVER ARRIBA --- */
#backToTop {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 950;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, background 0.2s;
}
#backToTop.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
#backToTop:hover {
    background: var(--bg-hover);
    transform: translateY(-3px);
}
@media (max-width: 768px) {
    #backToTop { bottom: 18px; right: 16px; width: 42px; height: 42px; font-size: 16px; }
}

/* --- RESPONSIVE --- */
@media (max-width: 1200px) {
    .grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

@media (max-width: 900px) {
    .cart-layout { flex-direction: column; }
    .cart-summary { width: 100%; }
}

/* =========================================
   AJUSTES ESPECÍFICOS PARA MÓVILES
   ========================================= */
@media (max-width: 768px) {
    /* CABECERA COMPACTA PARA MÓVILES: LOGO + BUSCADOR ARRIBA */
    header { 
        padding: 10px 14px; 
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: center;
        gap: 10px 12px; 
    }
    .logo { justify-self: start; }
    .logo img { height: 40px; }

    .search-bar { grid-column: 2; justify-self: stretch; width: 100%; max-width: none; padding: 8px 12px; }
    .search-bar input { font-size: 14px; }
    .search-bar i { margin-right: 8px; font-size: 14px; }
    
    .header-icons { grid-column: 1 / -1; justify-self: center; justify-content: center; width: auto; gap: 18px; padding-top: 2px; }
    .header-icons > a, .header-icons .cart-icon { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; }
    .header-icons a i, .header-icons .cart-icon i { font-size: 21px; }
    .theme-toggle { width: 40px; height: 40px; }
    .theme-toggle svg { width: 19px; height: 19px; }
    .lang-selector { padding: 6px 10px; gap: 6px; min-height: 40px; }
    .dropdown { left: 0; right: auto; }
    
    /* NAVEGACIÓN EN UNA SOLA FILA DESLIZABLE */
    nav { 
        padding: 8px 14px 10px; 
        justify-content: flex-start; 
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 18px;
        font-size: 13px;
    }
    
    /* CONTENIDO */
    .hero, .categories, .products, #cart-view, #product-view { padding: 14px; }
    .hero-banner { height: 180px; }
    .hero-banner h1 { font-size: 22px; margin-bottom: 12px; }
    .categories { justify-content: flex-start; gap: 20px; padding-bottom: 15px; }
    
    /* GRILLA DE PRODUCTOS (2 COLUMNAS) */
    .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    
    /* REDUCCIÓN DE TAMAÑO DE LAS TARJETAS */
    .card-img { aspect-ratio: 1 / 1; } 
    .card-info { padding: 8px; }
    .card-title { font-size: 11px; line-height: 1.1; margin-bottom: 5px; }
    .card-price { font-size: 14px; margin-bottom: 8px; }
    .btn-add { padding: 6px; font-size: 10px; }
    .card-category { font-size: 8px; padding: 3px 6px; top: 5px; left: 5px; }

    /* Otros ajustes */
    .lang-selector .lang-full { display: none; }
    .lang-selector .lang-short { display: inline; font-size: 13px; font-weight: 700; color: var(--text); }
    .lang-selector i { display: block; font-size: 19px; margin: 0; } 
    
    .cart-item { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
    .cart-item-right { justify-content: space-between; margin-top: 10px; }
    #product-view { padding: 16px 14px 40px; }
    .variant-card { padding: 9px 6px; border-radius: 8px; min-width: 0; }
    .variant-card-name { font-size: 13px; word-break: break-word; }
    .variant-card-price { font-size: 11px; }
    .variant-card-stock { font-size: 10px; }
    .product-detail-info h1 { font-size: 20px; }
    .buy-box-card .price { font-size: 24px; }

    /* PIE DE PÁGINA */
    footer { padding: 25px 15px; text-align: center; }
    .footer-content { flex-direction: column; gap: 15px; }
    .footer-desc { min-width: 100%; width: 100%; }
    .footer-socials { justify-content: center; }
    .footer-bottom { margin-top: 25px; padding-top: 15px; }
}

/* Ajustes para pantallas ultra pequeñas */
@media (max-width: 400px) {
    .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .header-icons { gap: 10px; }
    .logo img { height: 38px; }
    .card-title { font-size: 10px; }
    .card-price { font-size: 13px; }
    .btn-add { padding: 5px; font-size: 9px; }
}

:focus-visible { outline: 2px solid #22c55e; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* =========================================
   ESTILO MOCHA LIQUID GLASS & DEGRADADOS SOBRIOS
   ========================================= */
:root {
    --mocha-gold: #e4c082;
    --glass-bg: linear-gradient(160deg, rgba(29, 26, 22, 0.82), rgba(16, 15, 13, 0.90));
    --glass-bg-sub: linear-gradient(180deg, rgba(255, 240, 215, 0.045), rgba(255, 240, 215, 0.015));
    --glass-bg-strong: linear-gradient(160deg, rgba(26, 23, 20, 0.94), rgba(14, 13, 12, 0.96));
    --glass-border: rgba(255, 230, 190, 0.10);
    --glass-border-hover: rgba(228, 192, 130, 0.30);
    --glass-highlight: inset 0 1px 0 rgba(255, 236, 205, 0.09);
    --glass-shadow: 0 18px 44px rgba(0, 0, 0, 0.52);
}
body.light-mode {
    --mocha-gold: #8c6239;
    --glass-bg: linear-gradient(155deg, rgba(255, 252, 247, 0.78), rgba(242, 235, 224, 0.66));
    --glass-bg-sub: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(244, 238, 228, 0.56));
    --glass-bg-strong: linear-gradient(155deg, rgba(255, 252, 247, 0.94), rgba(242, 235, 224, 0.90));
    --glass-border: rgba(140, 98, 57, 0.22);
    --glass-border-hover: rgba(140, 98, 57, 0.42);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.88);
    --glass-shadow: 0 12px 32px rgba(47, 42, 38, 0.11);
}

html, body {
    background:
        radial-gradient(860px 460px at 50% -4%, rgba(228, 192, 130, 0.075), transparent 62%),
        radial-gradient(680px 420px at 14% 28%, rgba(212, 169, 98, 0.04), transparent 60%),
        radial-gradient(700px 420px at 86% 65%, rgba(34, 197, 94, 0.03), transparent 62%),
        linear-gradient(180deg, #0b0a09 0%, #100f0d 55%, #090807 100%);
    background-attachment: fixed;
}
body.light-mode {
    background:
        radial-gradient(900px 480px at 50% -4%, rgba(212, 169, 98, 0.26), transparent 62%),
        radial-gradient(680px 420px at 12% 35%, rgba(255, 255, 255, 0.65), transparent 60%),
        linear-gradient(180deg, #efe7da 0%, #e4dac9 100%);
    background-attachment: fixed;
}

#top-bar {
    background: linear-gradient(180deg, rgba(16, 15, 13, 0.86), rgba(12, 11, 10, 0.78));
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), var(--glass-highlight);
}
body.light-mode #top-bar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.80), rgba(244, 239, 231, 0.72));
    box-shadow: 0 6px 20px rgba(47, 42, 38, 0.07), var(--glass-highlight);
}

.search-bar {
    background: var(--glass-bg-sub);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-highlight);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.search-bar:focus-within {
    border-color: var(--glass-border-hover);
}

.dropdown,
.cat-dropdown,
.confirm-modal {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(22px) saturate(145%);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
    border-color: var(--glass-border);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.60), var(--glass-highlight);
}
.cat-drawer-header {
    background: linear-gradient(180deg, rgba(228, 192, 130, 0.06), transparent);
    border-bottom-color: var(--glass-border);
}

.hero-banner {
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), var(--glass-highlight);
}

.card,
.product-hero-card,
.product-desc-card,
.buy-box-card,
.buy-box-trust-card,
.cart-item,
.cart-summary {
    background: var(--glass-bg);
    backdrop-filter: blur(10px) saturate(130%);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), var(--glass-highlight);
}
@media (max-width: 768px) {
    html, body, body.light-mode { background-attachment: scroll; }
    .card { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
.card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.58), 0 0 26px rgba(228, 192, 130, 0.06), var(--glass-highlight);
}
body.light-mode .card:hover {
    box-shadow: 0 14px 30px rgba(47, 42, 38, 0.12), var(--glass-highlight);
}

.product-spec-item {
    background: var(--glass-bg-sub);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: var(--glass-highlight);
}
.product-specs-grid {
    border-top: none;
    padding-top: 4px;
}
.product-spec-item i,
.buy-box-kicker,
.trust-title i {
    color: #22c55e;
}
body.light-mode .product-spec-item i,
body.light-mode .buy-box-kicker,
body.light-mode .trust-title i {
    color: #16a34a;
}

.variant-card,
.qty-controls,
.page-btn,
#backToTop,
.cart-email-box input,
.product-category-tag {
    background: var(--glass-bg-sub);
    border-color: var(--glass-border);
    box-shadow: var(--glass-highlight);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.product-category-tag.offer-tag {
    background: #dc2626;
    border-color: #dc2626;
}
.variant-card:hover:not(:disabled) {
    border-color: var(--glass-border-hover);
}
.payment-icon-box {
    width: 34px;
    height: 30px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.payment-badge svg {
    width: 26px;
    height: 26px;
}
.variant-card.active {
    background: linear-gradient(145deg, rgba(34, 197, 94, 0.14), rgba(34, 197, 94, 0.04));
    border-color: #22c55e;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35), var(--glass-highlight);
}
body.light-mode .variant-card.active {
    background: linear-gradient(145deg, rgba(22, 163, 74, 0.14), rgba(22, 163, 74, 0.05));
    border-color: #16a34a;
    box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.30), var(--glass-highlight);
}
.payment-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(255, 255, 255, 0.34);
    box-shadow: none;
}
.payment-badge:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--text);
}
.payment-badge.active {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--text);
    box-shadow: 0 0 0 1px var(--text);
}
body.light-mode .payment-badge {
    background: rgba(255, 255, 255, 0.45);
    border-color: var(--glass-border);
}
body.light-mode .payment-badge:hover,
body.light-mode .payment-badge.active {
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--text);
}
.payment-badge.active .payment-radio {
    border-color: var(--text);
}
.payment-badge.active .payment-radio::after {
    background: var(--text);
}

.btn-buy-large,
.btn {
    background: var(--text);
    color: var(--bg);
    border: none;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}
.btn-buy-large:hover:not(:disabled),
.btn:hover {
    background: var(--muted);
}

.btn-add {
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(255, 255, 255, 0.34);
    color: var(--text);
}
.btn-add:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--text);
    color: var(--text);
}
body.light-mode .btn-add {
    background: rgba(255, 255, 255, 0.45);
    border-color: var(--glass-border);
    color: var(--text);
}
body.light-mode .btn-add:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--text);
}

footer {
    background: linear-gradient(180deg, rgba(16, 15, 13, 0.82), rgba(9, 8, 7, 0.94));
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-top: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 rgba(255, 236, 205, 0.07);
}
body.light-mode footer {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(235, 229, 220, 0.88));
}

/* --- POP-IN DE MASCOTA (ESQUINA INFERIOR DERECHA) --- */
.mascot-popin {
    position: fixed;
    right: 16px;
    bottom: 0;
    width: 175px;
    z-index: 960;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%);
    transition: opacity 0.35s ease, transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.35s;
    pointer-events: none;
}
.mascot-popin.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.mascot-popin a {
    display: block;
    transition: transform 0.2s ease;
}
.mascot-popin a:hover {
    transform: translateY(-2px);
}
.mascot-popin img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.55));
}
.mascot-popin-close {
    position: absolute;
    top: -28px;
    right: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(20, 19, 17, 0.92);
    color: #ffffff;
    border: 1px solid rgba(255, 230, 190, 0.25);
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    z-index: 2;
    transition: background 0.2s, transform 0.15s;
}
.mascot-popin-close:hover {
    background: #dc2626;
    border-color: #dc2626;
    transform: scale(1.08);
}
#backToTop {
    left: 24px;
    right: auto;
    width: 54px;
    height: 54px;
    font-size: 21px;
}
@media (max-width: 768px) {
    .mascot-popin {
        right: 8px;
        bottom: 0;
        width: 125px;
    }
    .mascot-popin-close {
        top: -24px;
        right: 0;
        width: 22px;
        height: 22px;
        font-size: 14px;
    }
    #backToTop {
        left: 16px;
        bottom: 18px;
        width: 48px;
        height: 48px;
        font-size: 19px;
    }
}

/* --- SECCIÓN LEGAL (PRIVACIDAD, GARANTÍA, COOKIES) --- */
#legal-view {
    padding: 24px 28px 56px;
    flex: 1;
    width: 100%;
}
.legal-container {
    max-width: 860px;
    margin: 0 auto;
}
.legal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}
.legal-tab-btn {
    background: var(--glass-bg-sub);
    color: var(--muted);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-highlight);
    padding: 10px 18px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: skewX(-12deg);
    transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s;
}
.legal-tab-btn:hover {
    color: var(--text);
    border-color: var(--glass-border-hover);
    transform: skewX(-12deg) scale(1.02);
}
.legal-tab-btn.active {
    color: var(--bg);
    border-color: var(--text);
    background: var(--text);
}
.legal-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), var(--glass-highlight);
    border-radius: 14px;
    padding: 28px;
}
.legal-card h1 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
}
.legal-updated {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--glass-border);
}
.legal-card h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 18px 0 8px;
    color: var(--text);
}
.legal-card p,
.legal-card li {
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted);
}
.legal-card ul {
    padding-left: 20px;
    margin: 8px 0 12px;
}
.legal-card li {
    margin-bottom: 6px;
}
.legal-card strong {
    color: var(--text);
}
.legal-card code {
    background: var(--glass-bg-sub);
    border: 1px solid var(--glass-border);
    padding: 1px 6px;
    border-radius: 5px;
    font-size: 12px;
    color: var(--text);
}
.footer-legal-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 12px;
}
.footer-legal-links a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.footer-legal-links a:hover {
    color: var(--text);
    text-decoration: underline;
}
.cart-terms-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    margin-bottom: -4px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted);
    cursor: pointer;
    text-align: left;
}
.cart-terms-check input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #22c55e;
    cursor: pointer;
}
.cart-terms-check a {
    color: var(--text);
    font-weight: 700;
    text-decoration: underline;
}
.cart-terms-check a:hover {
    color: #22c55e;
}
@media (max-width: 768px) {
    #legal-view { padding: 16px 14px 40px; }
    .legal-card { padding: 20px 16px; }
    .legal-card h1 { font-size: 20px; }
}

/* --- SECCIÓN GUÍAS DE INSTALACIÓN Y ACTIVACIÓN --- */
#guides-view {
    padding: 24px 28px 56px;
    flex: 1;
    width: 100%;
}
.guides-container {
    max-width: 880px;
    margin: 0 auto;
}
.guides-intro {
    margin-bottom: 18px;
}
.guides-intro h1 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.guides-intro p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}
.guide-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}
.guide-tab-btn {
    background: var(--glass-bg-sub);
    color: var(--muted);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-highlight);
    padding: 10px 18px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: skewX(-12deg);
    transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s;
}
.guide-tab-btn:hover {
    color: var(--text);
    border-color: var(--glass-border-hover);
    transform: skewX(-12deg) scale(1.02);
}
.guide-tab-btn.active {
    color: var(--bg);
    border-color: var(--text);
    background: var(--text);
}
.guide-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), var(--glass-highlight);
    border-radius: 14px;
    padding: 28px;
}
.guide-card-header {
    padding-bottom: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--glass-border);
}
.guide-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text);
    background: var(--glass-bg-sub);
    border: 1px solid var(--glass-border);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
}
.guide-card-header h2 {
    font-size: 21px;
    font-weight: 800;
    margin-bottom: 6px;
}
.guide-subtitle {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}
.guide-method-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}
.guide-method-title i {
    color: var(--text);
}
.guide-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.guide-steps li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--glass-bg-sub);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 16px;
}
.guide-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--text);
    color: var(--bg);
    font-size: 13px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.guide-step-body {
    flex: 1;
    min-width: 0;
}
.guide-step-body strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.guide-step-body p {
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--muted);
    margin: 0;
}
.guide-step-body code,
.guide-alt-desc code {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 1px 6px;
    border-radius: 5px;
    font-size: 12px;
    color: var(--text);
}
.guide-link {
    color: var(--text);
    font-weight: 700;
    text-decoration: underline;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.guide-link:hover {
    opacity: 0.8;
}
.guide-alt-box {
    margin-top: 26px;
    padding: 20px;
    border-radius: 12px;
    background: var(--glass-bg-sub);
    border: 1px solid var(--glass-border);
}
.guide-alt-desc {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.65;
    margin-bottom: 14px;
}
.guide-cmd-box {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 9px 12px;
}
body.light-mode .guide-cmd-box {
    background: rgba(0, 0, 0, 0.05);
}
.guide-cmd-box code {
    background: none;
    border: none;
    padding: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    color: var(--text);
    overflow-x: auto;
    white-space: nowrap;
}
.guide-copy-btn {
    background: var(--text);
    color: var(--bg);
    border: none;
    border-radius: 10px;
    padding: 6px 14px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transform: skewX(-12deg);
    transition: background 0.2s, transform 0.2s;
}
.guide-copy-btn:hover {
    background: var(--muted);
    transform: skewX(-12deg) scale(1.02);
}
.guide-copy-btn.copied {
    background: var(--glass-bg);
    color: var(--text);
    border: 1px solid var(--glass-border-hover);
}
.guide-support-note {
    margin-top: 22px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--glass-bg-sub);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}
.guide-support-note i {
    color: var(--text);
    font-size: 16px;
    flex-shrink: 0;
}
.guide-support-note a {
    color: var(--text);
    font-weight: 700;
    text-decoration: underline;
}
@media (max-width: 768px) {
    #guides-view { padding: 16px 14px 40px; }
    .guides-intro h1 { font-size: 21px; }
    .guide-card { padding: 18px 14px; }
    .guide-card-header h2 { font-size: 18px; }
    .guide-alt-box { padding: 14px 12px; }
    .guide-steps li { padding: 12px; gap: 10px; }
    .guide-cmd-box { flex-direction: column; align-items: stretch; }
    .guide-copy-btn { justify-content: center; }
}
