:root {
    /* Premium Palette: Onyx & Cyber Orange */
    --primary: #ff8c00;
    /* Cyber Orange */
    --primary-glow: rgba(255, 140, 0, 0.4);
    --secondary: #0a0a0b;
    /* Deep Onyx */
    --accent: #ff4500;
    /* Neon Orange */
    --bg-light: #0f0f12;
    /* Dark Surface */
    --bg-glass: rgba(15, 15, 18, 0.72);
    --card-bg: #1a1a1e;
    --text: #f5f5f7;
    /* Light Grayish White */
    --text-dim: #a1a1a6;
    /* Muted Gray */
    --border: rgba(255, 255, 255, 0.08);
    --white: #ffffff;
    --gradient-premium: linear-gradient(135deg, #ff8c00, #ff4500);
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-glass: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.015em;
}

body {
    background-color: var(--bg-light);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Header & Navigation */
header {
    background: var(--bg-glass);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 0 5%;
    height: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    transition: background 0.3s ease;
}

.top-bar {
    background: #000;
    color: #fff;
    font-size: 12px;
    text-align: center;
    padding: 8px 0;
    font-weight: 400;
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    font-weight: 400;
    opacity: 0.8;
}

.nav-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* ── Auth Button & User Dropdown (all pages) ── */
.btn-auth {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: .85rem;
    font-weight: 700;
    padding: .45rem 1.1rem;
    border-radius: 980px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .4rem;
    text-decoration: none;
    transition: .2s;
    white-space: nowrap;
}
.btn-auth:hover { background: rgba(255,255,255,0.1); border-color: var(--primary); color: var(--primary); }

.user-menu { position: relative; }

.user-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: .85rem;
    font-weight: 700;
    padding: .45rem 1.1rem;
    border-radius: 980px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .4rem;
    transition: .2s;
}
.user-btn:hover { background: rgba(255,255,255,0.1); border-color: var(--primary); color: var(--primary); }

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
    min-width: 190px;
    display: none;
    z-index: 2000;
    padding: .5rem 0;
    backdrop-filter: blur(20px);
}
.user-dropdown.open { display: block; animation: fadeIn 0.2s ease-out; }
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .75rem 1.4rem;
    color: var(--text);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 600;
    transition: .15s;
}
.user-dropdown a:hover { background: rgba(255,140,0,0.1); color: var(--primary); }
.user-dropdown a i { width: 16px; text-align: center; color: var(--primary); }

/* Search Bar */
.search-container {
    position: relative;
    width: 280px;
}

.search-container input {
    width: 100%;
    padding: 6px 12px 6px 36px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 8px;
    color: var(--text);
    outline: none;
    font-size: 14px;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-container input:focus {
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

/* Hero Section */
.hero-promo {
    background: #000;
    color: #fff;
    padding: 60px 5% 100px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.hero-promo h1 {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 0;
}

.hero-promo p {
    font-size: 28px;
    font-weight: 400;
    color: #fff;
    margin: 0;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-content h1 span {
    color: var(--primary);
}

.hero-content p {
    font-size: 1.1rem;
    color: #e2e8f0;
    margin-bottom: 2rem;
}

/* Featured Badges */
.featured-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    border-radius: 50px;
    margin-bottom: 1rem;
}

/* Categories Bar */
.categories-container {
    background: #fff;
    padding: 1.5rem 5%;
    position: sticky;
    top: 70px;
    z-index: 900;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.categories {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    justify-content: center;
}

.category-pill {
    padding: 0.6rem 1.5rem;
    background: #f1f5f9;
    border: 1px solid transparent;
    color: var(--text-dim);
    border-radius: 50px;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
    font-weight: 600;
    font-size: 0.9rem;
}

.category-pill:hover,
.category-pill.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
    transform: translateY(-1px);
}

/* Product Grid */
.catalog-section {
    padding: 4rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title i {
    color: var(--primary);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* E-commerce Card */
.card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 24px;
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: var(--shadow-glass);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: scale(1.03) translateY(-5px);
    box-shadow: var(--shadow-soft);
    border-color: rgba(0, 0, 0, 0.08);
}

.card-img-placeholder {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-img-placeholder img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-dim);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 10;
}

.super-promo-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #ef4444;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.price-container {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.card-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.card-old-price {
    font-size: 1rem;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: var(--primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-buy {
    background: var(--primary);
    color: white;
    padding: 10px 24px;
    border-radius: 980px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-buy:hover {
    background: #0077ed;
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-buy:active {
    transform: scale(0.95);
}

.btn-secondary {
    background: transparent;
    color: #0071e3;
    padding: 8px 16px;
    border: none;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
}

.btn-secondary:hover {
    text-decoration: underline;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100%;
    background: var(--bg-glass);
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    z-index: 2000;
    transition: transform 0.6s cubic-bezier(0.8, 0, 0.2, 1);
    padding: 32px;
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
}

.cart-sidebar.open {
    transform: translateX(-450px);
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.close-btn {
    font-size: 1.5rem;
    color: var(--text-dim);
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    transition: 0.2s;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text);
}

.cart-item {
    background: rgba(255,255,255,.04);
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-glass);
    transition: 0.2s;
}

.cart-item:hover {
    background: rgba(255,255,255,.07);
    border-color: rgba(255,140,0,.3);
    transform: translateY(-2px);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #fff;
    padding: 2.5rem;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    text-align: left;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-content h2 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.modal-content input,
.modal-content select {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    font-size: 0.95rem;
}

.modal-content input:focus,
.modal-content select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 69, 0, 0.1);
}

/* Floating WhatsApp */
.floating-wa {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
    z-index: 500;
    transition: 0.3s;
    cursor: pointer;
}

.floating-wa:hover {
    transform: scale(1.1);
}

/* Formulario Crédito Banner */
.credit-banner {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    border-radius: 24px;
    padding: 3rem;
    margin: 4rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.credit-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 69, 0, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.credit-info h2 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    line-height: 1.1;
    color: var(--primary);
}

.credit-info p {
    color: #cbd5e1;
    font-size: 1.1rem;
    max-width: 500px;
    margin-bottom: 2rem;
}

.btn-credit {
    background: #fff;
    color: #0f172a;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-credit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Footer & Legal */
footer {
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 4rem 5% 2rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h3 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.footer-col p,
.footer-col a {
    color: var(--text-dim);
    font-size: 0.95rem;
    text-decoration: none;
    display: block;
    margin-bottom: 0.8rem;
    transition: 0.2s;
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Responsive Layouts */
@media (max-width: 1024px) {
    .search-container {
        width: 300px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .search-container {
        width: 100%;
        order: 3;
    }

    .nav-actions {
        width: 100%;
        justify-content: space-between;
    }

    .hero {
        margin-top: 140px;
        /* space for taller header */
        height: auto;
        padding: 3rem 0;
    }

    .hero-content {
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-img {
        display: none;
        /* Hide 3D element on small mobile or shrink it */
    }

    .scene-3d {
        display: none;
        /* Hide 3D item on small mobile for better performance/layout */
    }

    .categories-container {
        top: 140px;
        /* space for taller header */
        padding: 1rem;
    }

    .categories {
        justify-content: flex-start;
        padding-bottom: 0.5rem;
    }

    .credit-banner {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
        margin: 2rem 1rem;
    }

    .credit-banner::before {
        width: 200px;
        height: 200px;
        right: -20%;
        top: -20%;
    }

    .cart-sidebar {
        width: 100%;
        border-radius: 0;
        padding: 1.5rem;
    }

    .modal-content {
        padding: 1.5rem;
        width: 95%;
        margin-top: 10vh;
        max-height: 85vh;
        overflow-y: auto;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .footer-grid {
        gap: 2rem;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .upload-zone {
        padding: 1.5rem;
    }

    .table-responsive {
        border: 0;
    }

    table {
        min-width: 800px;
        /* force scroll on mobile */
    }
}

@media (max-width: 480px) {

    .btn-buy,
    .btn-secondary,
    .btn-credit {
        width: 100%;
    }

    .nav-actions button {
        font-size: 0.85rem;
        padding: 0.5rem;
    }
}