/* =========================================================
   Sistema visual — telefonia (Tienda online tech)
   - Paleta cohesiva slate + cyan (variables CSS custom)
   - Tipografía Inter
   - Micro-animaciones, focus rings, scrollbar
   ========================================================= */

:root {
    /* Brand: slate profundo (tech moderno) */
    --brand-50:  #f8fafc;
    --brand-100: #e2e8f0;
    --brand-200: #cbd5e1;
    --brand-300: #94a3b8;
    --brand-400: #64748b;
    --brand-500: #475569;
    --brand-600: #1e293b;
    --brand-700: #0f172a;
    --brand-800: #0b1424;
    --brand-900: #020617;

    /* Accent: cyan/turquesa (tech / innovación) */
    --accent-50:  #ecfeff;
    --accent-100: #cffafe;
    --accent-200: #a5f3fc;
    --accent-300: #67e8f9;
    --accent-400: #22d3ee;
    --accent-500: #06b6d4;
    --accent-600: #0891b2;
    --accent-700: #0e7490;

    /* Neutros */
    --dark-50:  #f8fafc;
    --dark-100: #f1f5f9;
    --dark-200: #e2e8f0;
    --dark-300: #cbd5e1;
    --dark-400: #94a3b8;
    --dark-500: #64748b;
    --dark-600: #475569;
    --dark-700: #334155;
    --dark-800: #1e293b;
    --dark-900: #0b1424;

    /* Estados */
    --success: #10b981;
    --warning: #f59e0b;
    --danger:  #ef4444;

    /* Sombras */
    --shadow-sm:  0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow:     0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.06);
    --shadow-md:  0 4px 12px -2px rgba(15, 23, 42, 0.10), 0 2px 6px -3px rgba(15, 23, 42, 0.06);
    --shadow-lg:  0 12px 28px -8px rgba(15, 23, 42, 0.18), 0 6px 12px -6px rgba(15, 23, 42, 0.10);
    --shadow-xl:  0 24px 48px -12px rgba(15, 23, 42, 0.25);

    /* Transiciones */
    --t-fast: 150ms cubic-bezier(.4,0,.2,1);
    --t-med:  220ms cubic-bezier(.4,0,.2,1);
    --t-slow: 350ms cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }
body { font-feature-settings: "cv02","cv03","cv04","cv11"; }
::selection { background: var(--accent-200); color: var(--brand-900); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--dark-50); }
::-webkit-scrollbar-thumb { background: var(--dark-300); border-radius: 6px; border: 2px solid var(--dark-50); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-500); }

input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: none;
    border-color: var(--accent-500) !important;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.18);
}
button:focus-visible, a:focus-visible {
    outline: 2px solid var(--accent-500);
    outline-offset: 2px;
    border-radius: 8px;
}

.fade-in { animation: fadeIn .6s cubic-bezier(.16,1,.3,1) both; }
.fade-in-delay-1 { animation: fadeIn .6s cubic-bezier(.16,1,.3,1) .12s both; }
.fade-in-delay-2 { animation: fadeIn .6s cubic-bezier(.16,1,.3,1) .24s both; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card-hover {
    transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
    box-shadow: var(--shadow-sm);
}
.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-200) !important;
}
.card-hover img { transition: transform var(--t-slow); }
.card-hover:hover img { transform: scale(1.06); }

.cat-card {
    transition: transform var(--t-med), box-shadow var(--t-med);
    box-shadow: var(--shadow);
}
.cat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}
.cat-card img { transition: transform .55s cubic-bezier(.16,1,.3,1); }
.cat-card:hover img { transform: scale(1.08); }

.search-glow {
    transition: box-shadow var(--t-med);
    box-shadow: 0 18px 48px -10px rgba(2, 6, 23, 0.45), 0 4px 12px -2px rgba(2, 6, 23, 0.2);
}
.search-glow:focus-within {
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.32), 0 24px 56px -12px rgba(2, 6, 23, 0.55);
}

button, a { transition: background-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); }
button:active, a.active-press:active { transform: translateY(1px); }

.btn-shine {
    position: relative;
    overflow: hidden;
}
.btn-shine::after {
    content: "";
    position: absolute;
    top: 0; left: -120%;
    width: 60%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.35), transparent);
    transform: skewX(-20deg);
    transition: left .6s ease;
}
.btn-shine:hover::after { left: 130%; }

.nav-link {
    position: relative;
    transition: color var(--t-fast);
}
.nav-link::after {
    content: "";
    position: absolute;
    left: 12px; right: 12px; bottom: 6px;
    height: 2px;
    background: var(--accent-500);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--t-med);
    border-radius: 2px;
}
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); }

.badge-cat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: .02em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--brand-50);
    color: var(--brand-700);
    border: 1px solid var(--brand-100);
}
.badge-accent {
    background: var(--accent-50);
    color: var(--accent-700);
    border-color: var(--accent-100);
}

.table-zebra tr:nth-child(odd) { background: var(--dark-50); }
.table-zebra tr:hover { background: var(--accent-50); }

.skeleton {
    background: linear-gradient(90deg, var(--dark-100) 0%, var(--dark-200) 50%, var(--dark-100) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
    border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Header sticky con fondo sólido */
.site-header-wrapper {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: #ffffff;
    isolation: isolate;
}
.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid rgba(15, 23, 42, 0.10);
    transition: box-shadow var(--t-med);
}
.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.hero-tienda {
    background:
        radial-gradient(1200px 400px at 20% -10%, rgba(6,182,212,.18), transparent 60%),
        linear-gradient(115deg, var(--brand-700) 0%, var(--brand-900) 100%);
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(180deg, var(--accent-500) 0%, var(--accent-600) 100%);
    color: white;
    font-weight: 600;
    border-radius: 12px;
    padding: 12px 24px;
    box-shadow: 0 8px 20px -8px rgba(6, 182, 212, .55);
    transition: transform var(--t-fast), box-shadow var(--t-fast), filter var(--t-fast);
}
.btn-cta:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(6, 182, 212, .65); filter: brightness(1.08); }

.thumb-active { outline: 2px solid var(--accent-500); outline-offset: 2px; }

.divider-accent {
    height: 3px; width: 56px; border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-500), var(--accent-300));
}

@media (max-width: 640px) {
    .hero-title { font-size: 2.25rem; line-height: 1.1; }
}

/* Contraste entre secciones */
section.bg-white {
    border-bottom: 1px solid var(--dark-200);
}
section.bg-dark-50, section.bg-slate-50 {
    background-color: #eef2f7 !important;
}
.card-hover {
    border-color: var(--dark-300) !important;
}
section + section {
    box-shadow: inset 0 3px 8px -4px rgba(15, 23, 42, 0.08);
}

body > section,
body > div:not(.site-header-wrapper) > section {
    position: relative;
    z-index: 0;
    isolation: isolate;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], input[type="search"],
select, textarea {
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast);
}
input::placeholder, textarea::placeholder { color: var(--dark-400); }

.admin-row { transition: background-color var(--t-fast); }

.cart-drawer-handle {
    background: linear-gradient(180deg, var(--brand-700) 0%, var(--brand-900) 100%);
    color: white;
}

.fab-wa {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 999px;
    background: #25d366;
    box-shadow: 0 14px 30px -6px rgba(37, 211, 102, .55);
    z-index: 40;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Utility classes para "accent" (Tailwind CDN no las conoce) */
.text-accent-50  { color: var(--accent-50); }
.text-accent-100 { color: var(--accent-100); }
.text-accent-200 { color: var(--accent-200); }
.text-accent-300 { color: var(--accent-300); }
.text-accent-400 { color: var(--accent-400); }
.text-accent-500 { color: var(--accent-500); }
.text-accent-600 { color: var(--accent-600); }
.text-accent-700 { color: var(--accent-700); }
.bg-accent-50    { background-color: var(--accent-50); }
.bg-accent-100   { background-color: var(--accent-100); }
.bg-accent-200   { background-color: var(--accent-200); }
.bg-accent-400   { background-color: var(--accent-400); }
.bg-accent-500   { background-color: var(--accent-500); }
.bg-accent-600   { background-color: var(--accent-600); }
.hover\:bg-accent-500:hover { background-color: var(--accent-500); }
.hover\:bg-accent-600:hover { background-color: var(--accent-600); }
.hover\:text-accent-300:hover { color: var(--accent-300); }
.hover\:text-accent-500:hover { color: var(--accent-500); }
.hover\:text-accent-600:hover { color: var(--accent-600); }
.border-accent-100 { border-color: var(--accent-100); }
.border-accent-500 { border-color: var(--accent-500); }
.ring-accent-500 { --tw-ring-color: var(--accent-500); }
.bg-accent-gradient { background: linear-gradient(135deg, var(--accent-400) 0%, var(--accent-600) 100%); }

.step-dot {
    width: 28px; height: 28px;
    border-radius: 999px;
    background: var(--dark-200);
    color: var(--dark-500);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}
.step-dot.active { background: var(--accent-500); color: white; }
