/* 
  TheSixthColor - Frontend Styles
  Paleta: Oscura con acentos cálidos (MTG Premium)
*/

:root {
    --bg-primary: #0b0c12;
    --bg-surface: #161724;
    --bg-surface-light: #232333;
    --accent-primary: #c89b3c;
    --accent-secondary: #4a90d9;
    --text-primary: #e8e8ec;
    --text-secondary: #9fa0b4;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow: 0 32px 90px rgba(0, 0, 0, 0.28);
    --success: #2ecc71;
    --danger: #e74c3c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

button,
input,
select {
    font: inherit;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: radial-gradient(circle at top left, rgba(200, 155, 60, 0.16), transparent 25%),
        radial-gradient(circle at bottom right, rgba(74, 144, 217, 0.14), transparent 22%),
        linear-gradient(180deg, #0f1118 0%, #090a10 60%, #05060a 100%);
}

/* ─────────────────────────────────────────────────────── */
/* TIPOGRAFÍA */
/* ─────────────────────────────────────────────────────── */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

/* ─────────────────────────────────────────────────────── */
/* HEADER */
/* ─────────────────────────────────────────────────────── */

header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 13, 19, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo img {
    height: 88px;
    width: auto;
    display: block;
}

nav {
    display: flex;
    gap: 1.75rem;
    align-items: center;
}

/* ── Widget de moneda ─────────────────────────────────────────────── */
.currency-widget {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .5rem;
    border: 1px solid var(--border-color, rgba(255,255,255,.08));
    border-radius: 20px;
    font-size: .8rem;
}

.cw-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: .15rem .45rem;
    border-radius: 12px;
    color: var(--text-secondary, #9fa0b4);
    font-weight: 600;
    font-size: .78rem;
    transition: all .15s;
}
.cw-btn:hover  { color: var(--accent-primary, #c89b3c); }
.cw-btn.active { background: var(--accent-primary, #c89b3c); color: #000; }

.cw-type-sel {
    background: transparent;
    border: 1px solid var(--border-color, rgba(255,255,255,.1));
    border-radius: 8px;
    color: var(--text-secondary, #9fa0b4);
    font-size: .75rem;
    padding: .1rem .3rem;
    cursor: pointer;
}
.cw-type-sel option { background: #161724; }

.cw-rate {
    color: var(--accent-primary, #c89b3c);
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Precios con moneda doble */
.price-main { font-weight: 700; }
.price-sub  {
    display: block;
    font-size: .75rem;
    color: var(--text-secondary, #888);
    font-weight: 400;
    margin-top: .1rem;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
    letter-spacing: 0.04em;
    font-size: 0.95rem;
}

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

.cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.35rem;
}

.cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background-color: var(--danger);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ─────────────────────────────────────────────────────── */
/* CONTENEDOR PRINCIPAL */
/* ─────────────────────────────────────────────────────── */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

/* ─────────────────────────────────────────────────────── */
/* GRID DE PRODUCTOS */
/* ─────────────────────────────────────────────────────── */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min-width, 220px), 1fr));
    gap: var(--card-gap, 1.5rem);
    margin-top: 1rem;
}

/* Tamaños de miniaturas */
.products-grid.size-xs  { --card-min-width: 130px; --card-gap: 0.75rem; }
.products-grid.size-sm  { --card-min-width: 170px; --card-gap: 1rem; }
.products-grid.size-md  { --card-min-width: 220px; --card-gap: 1.5rem; }
.products-grid.size-lg  { --card-min-width: 280px; --card-gap: 1.75rem; }
.products-grid.size-xl  { --card-min-width: 340px; --card-gap: 2rem; }

/* En tamaños pequeños, compactar la info */
.products-grid.size-xs .card-info,
.products-grid.size-sm .card-info { padding: 0.75rem; }
.products-grid.size-xs .card-name { font-size: 0.78rem; }
.products-grid.size-sm .card-name { font-size: 0.88rem; }
.products-grid.size-xs .card-set,
.products-grid.size-sm .card-set  { font-size: 0.72rem; margin-bottom: 0.4rem; }
.products-grid.size-xs .card-price,
.products-grid.size-sm .card-price { font-size: 0.9rem; }
.products-grid.size-xs .card-button,
.products-grid.size-sm .card-button { padding: 0.4rem 0.7rem; font-size: 0.78rem; }

.card-product {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 26px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.card-product:hover {
    transform: translateY(-6px);
    border-color: rgba(200, 155, 60, 0.45);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.28);
}

.card-image-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: linear-gradient(180deg, rgba(20, 22, 34, 0.95), rgba(10, 12, 18, 0.95));
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

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

.card-info {
    padding: 1.6rem;
}

.card-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-set,
.card-stock {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.card-price {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.card-condition {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background-color: rgba(74, 144, 217, 0.14);
    color: var(--accent-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.card-button {
    width: 100%;
    padding: 0.95rem;
    border-radius: 999px;
    font-weight: 700;
    background-color: rgba(200, 155, 60, 0.95);
    color: var(--bg-primary);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.card-button:hover {
    background-color: #d1a75a;
    transform: translateY(-1px);
}

.card-button:active {
    transform: scale(0.98);
}

.hero-section {
    position: relative;
    overflow: hidden;
    padding: 5rem 0 3rem;
}

.hero-decor {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(200, 155, 60, 0.16), transparent 24%),
        radial-gradient(circle at 88% 20%, rgba(74, 144, 217, 0.16), transparent 20%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 42%);
    pointer-events: none;
}

.hero-copy {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.hero-copy p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin: 1.25rem auto 2rem;
    max-width: 640px;
    line-height: 1.8;
}

.hero-cta {
    display: inline-flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-hero {
    border-radius: 999px;
    padding: 1rem 1.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.btn-hero.btn-secondary {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-hero:hover {
    transform: translateY(-2px);
}

/* ─────────────────────────────────────────────────────── */
/* PÁGINA DE PRODUCTO */
/* ─────────────────────────────────────────────────────── */

.product-page {
    padding: 2rem 0;
}

.product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.product-image-wrapper {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    position: relative;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.product-image-wrapper:hover img {
    transform: scale(1.1);
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-header h1 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.product-meta {
    display: flex;
    gap: 2rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.product-price-section {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.price-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

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

/* ─────────────────────────────────────────────────────── */
/* TABS DE CONDICIÓN */
/* ─────────────────────────────────────────────────────── */

.condition-selector {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.condition-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.condition-tabs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.condition-tab {
    flex: 1;
    min-width: 100px;
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.condition-tab:hover {
    border-color: var(--accent-secondary);
    background-color: var(--bg-surface-light);
}

.condition-tab.active {
    border-color: var(--accent-primary);
    background-color: rgba(200, 155, 60, 0.1);
}

.condition-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

.condition-qty {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* ─────────────────────────────────────────────────────── */
/* SELECTOR DE CANTIDAD */
/* ─────────────────────────────────────────────────────── */

.quantity-selector {
    display: flex;
    gap: 1rem;
    align-items: center;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.quantity-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background-color: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
}

.quantity-input {
    width: 50px;
    text-align: center;
    background-color: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

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

/* ─────────────────────────────────────────────────────── */
/* BOTONES */
/* ─────────────────────────────────────────────────────── */

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

.btn-primary:hover {
    background-color: #d9ab4d;
}

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

.btn-secondary:hover {
    background-color: #5b9fee;
}

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

/* ─────────────────────────────────────────────────────── */
/* MODAL */
/* ─────────────────────────────────────────────────────── */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);           /* desenfoque del fondo */
    -webkit-backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;                  /* unificado con bottom sheets */
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

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

.modal-close {
    float: right;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    background: none;
    border: none;
    padding: 0;
}

.modal-close:hover {
    color: var(--accent-primary);
}

/* ─────────────────────────────────────────────────────── */
/* CARRITO — drawer lateral derecho                         */
/* ─────────────────────────────────────────────────────── */

/* ── Cart push — el contenido se corre cuando el drawer abre ──────── */
header, main, footer {
    transition: margin-right .3s cubic-bezier(.4,0,.2,1);
}
body.cart-open > header,
body.cart-open > main,
body.cart-open > footer { margin-right: 420px; }

/* Mobile: sin push (el cart es bottom sheet) */
@media (max-width: 640px) {
    body.cart-open > header,
    body.cart-open > main,
    body.cart-open > footer { margin-right: 0; }
}

/* Drawer lateral — sin overlay, sin blur, página 100% navegable */
.cart-modal {
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    pointer-events: none;          /* toda la página sigue siendo clickeable */
    justify-content: flex-end !important;
    align-items: stretch !important;
    padding: 0 !important;
}

.cart-modal .modal-content {
    pointer-events: auto;          /* solo el drawer intercepta clicks */
    max-width: 420px;
    width: 420px;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border-right: none;
    border-top: none;
    border-bottom: none;
    border-left: 1px solid var(--border-color);
    box-shadow: -8px 0 32px rgba(0,0,0,.35);
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    animation: none !important;
}
.cart-modal.active .modal-content {
    transform: translateX(0);
}

/* Items usan el espacio disponible */
.cart-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
    max-height: none;
    overflow-y: auto;
}

/* Mobile: el carrito vuelve a ser bottom sheet */
@media (max-width: 640px) {
    .cart-modal {
        pointer-events: none;
        align-items: flex-end !important;
        justify-content: stretch !important;
    }
    .cart-modal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 90vh;
        border-radius: 18px 18px 0 0 !important;
        border-left: none !important;
        border-top: 1px solid var(--border-color) !important;
        transform: translateY(100%) !important;
        transition: transform .3s cubic-bezier(.4,0,.2,1) !important;
    }
    .cart-modal.active .modal-content {
        transform: translateY(0) !important;
    }
    .cart-items { max-height: calc(90vh - 220px); }
}

.cart-item {
    display: flex;
    gap: 1rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
}

.cart-item-image {
    width: 80px;
    height: 110px;
    background-color: var(--bg-surface);
    border-radius: 4px;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-condition {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.cart-item-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.cart-item-qty {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.cart-summary {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cart-total-amount {
    color: var(--accent-primary);
}

/* ─────────────────────────────────────────────────────── */
/* RESPONSIVE */
/* ─────────────────────────────────────────────────────── */

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

    .header-container {
        padding: 0 1rem;
    }

    .container {
        padding: 1rem;
    }

    nav {
        gap: 1rem;
        font-size: 0.9rem;
    }

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

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .product-price-section,
    .condition-selector,
    .quantity-selector {
        padding: 1rem;
    }

    .condition-tabs {
        gap: 0.5rem;
    }

    .condition-tab {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
}
/* ─── Auth Widget & Modal ──────────────────────────────────────────────────── */
.auth-widget { margin-left: auto; display: flex; align-items: center; }
.auth-login-btn {
    background: var(--accent-primary); color: #000; border: none;
    padding: 0.4rem 1rem; border-radius: 6px; cursor: pointer;
    font-weight: 700; font-size: 0.82rem;
}
.auth-login-btn:hover { filter: brightness(1.15); }

.auth-user-menu { position: relative; }
.auth-user-btn {
    display: flex; align-items: center; gap: 0.4rem;
    background: var(--bg-surface-light); border: 1px solid var(--border-color);
    color: var(--text-primary); padding: 0.35rem 0.75rem; border-radius: 6px;
    cursor: pointer; font-size: 0.82rem;
}
.auth-user-btn:hover { border-color: var(--accent-primary); }
.auth-avatar {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--accent-primary); color: #000;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.75rem;
}
.auth-username { font-weight: 600; }
.auth-caret { color: var(--text-secondary); font-size: 0.65rem; }
.vip-badge  { background: linear-gradient(135deg,#c89b3c,#e8c97a); color:#000; padding:0.1rem 0.4rem; border-radius:4px; font-size:.65rem; font-weight:800; }
.admin-badge{ background:#e74c3c; color:#fff; padding:0.1rem 0.4rem; border-radius:4px; font-size:.65rem; font-weight:800; }

.auth-dropdown {
    position: absolute; right: 0; top: calc(100% + 6px);
    background: var(--bg-surface); border: 1px solid var(--border-color);
    border-radius: 8px; min-width: 200px; z-index: 1000;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.auth-dd-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.6rem 1rem; color: var(--text-primary); text-decoration: none;
    font-size: 0.85rem; border: none; background: none; width: 100%; text-align: left;
    cursor: pointer; transition: background 0.15s;
}
.auth-dd-item:hover { background: var(--bg-surface-light); }
.auth-dd-logout { color: #e74c3c; }
.listing-count { font-size: .72rem; color: var(--text-secondary); }

/* Modal overlay */
.auth-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.7);
    display: none; align-items: center; justify-content: center; z-index: 2000;
}
.auth-modal {
    background: var(--bg-surface); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 2rem; width: min(420px, 92vw);
    position: relative; max-height: 90vh; overflow-y: auto;
}
.auth-modal-close {
    position: absolute; top: 1rem; right: 1rem;
    background: none; border: none; color: var(--text-secondary);
    font-size: 1.4rem; cursor: pointer; line-height: 1;
}
.auth-modal-tabs { display: flex; gap: 0; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); }
.auth-modal-tab {
    flex: 1; background: none; border: none; color: var(--text-secondary);
    padding: 0.6rem 1rem; cursor: pointer; font-size: 0.9rem;
    border-bottom: 2px solid transparent; transition: all 0.15s;
}
.auth-modal-tab.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); font-weight: 700; }
.auth-field { margin-bottom: 1rem; }
.auth-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.auth-field label { display: block; font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 0.3rem; }
.auth-field input {
    width: 100%; padding: 0.5rem 0.75rem; background: var(--bg-primary);
    border: 1px solid var(--border-color); border-radius: 6px;
    color: var(--text-primary); font-size: 0.9rem; box-sizing: border-box;
}
.auth-field input:focus { border-color: var(--accent-primary); outline: none; }
.auth-submit-btn {
    width: 100%; padding: 0.65rem; background: var(--accent-primary);
    color: #000; border: none; border-radius: 6px; font-weight: 700;
    font-size: 0.95rem; cursor: pointer; margin-top: 0.5rem;
}
.auth-submit-btn:hover { filter: brightness(1.1); }
.auth-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-error { color: #e74c3c; font-size: 0.85rem; min-height: 1.2em; margin-bottom: 0.5rem; }
.auth-hint { font-size: 0.78rem; color: var(--text-secondary); margin: 0.75rem 0; }

.etched-tag { font-size:.65rem; background:linear-gradient(135deg,#636363,#c0b090); color:#fff; padding:.1rem .35rem; border-radius:3px; }

/* ─── Two-button auth ─────────────────────────────────────────────────────── */
.auth-btns { display: flex; gap: 0.5rem; align-items: center; }
.auth-btn-outline {
    background: none; color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.38rem 0.9rem; border-radius: 6px; cursor: pointer;
    font-size: 0.82rem; transition: border-color 0.15s, color 0.15s;
}
.auth-btn-outline:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.auth-btn-solid {
    background: var(--accent-primary); color: #000; border: none;
    padding: 0.38rem 0.9rem; border-radius: 6px; cursor: pointer;
    font-weight: 700; font-size: 0.82rem; transition: filter 0.15s;
}
.auth-btn-solid:hover { filter: brightness(1.12); }
.mass-entry-nav-btn {
    background: var(--bg-surface-light); color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.85rem; border-radius: 6px; font-size: 0.82rem;
    text-decoration: none; transition: border-color 0.15s, color 0.15s;
}
.mass-entry-nav-btn:hover { border-color: var(--accent-primary); color: var(--accent-primary); }

/* ─── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    padding: 2.5rem 0 1.5rem;
    font-size: .85rem;
    color: var(--text-secondary);
}
.footer-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
    display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2.5rem;
}
.footer-brand img  { height: 36px; margin-bottom: .75rem; opacity: .85; }
.footer-brand p    { line-height: 1.6; font-size: .82rem; max-width: 240px; }
.footer-col h4     { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em;
                     color: var(--text-primary); font-weight: 700; margin-bottom: .75rem; }
.footer-col a      { display: block; color: var(--text-secondary); text-decoration: none;
                     margin-bottom: .45rem; transition: color .15s; }
.footer-col a:hover { color: var(--accent-primary); }
.footer-bottom {
    max-width: 1200px; margin: 1.75rem auto 0; padding: 1rem 1.5rem 0;
    border-top: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: .5rem; font-size: .78rem;
}
@media (max-width: 640px) {
    .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer-bottom { flex-direction: column; text-align: center; }
}

/* ─── Notificaciones ──────────────────────────────────────────────────────── */
.notif-bell {
    position: relative;
    display: flex;
    align-items: center;
}
.notif-bell-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    position: relative;
    padding: 0.25rem 0.4rem;
    border-radius: 8px;
    transition: background 0.15s;
    line-height: 1;
    color: inherit;
}
.notif-bell-btn:hover { background: rgba(255,255,255,0.07); }
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    pointer-events: none;
    line-height: 1;
}
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: -8px;
    width: 320px;
    background: var(--bg-surface, #161724);
    border: 1px solid var(--border-color, #333);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.notif-dropdown.open { display: flex; }
.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color, #333);
    font-size: 0.85rem;
    font-weight: 600;
}
.notif-mark-all {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--accent-primary, #c89b3c);
    font-size: 0.78rem;
    padding: 0;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-list {
    max-height: 360px;
    overflow-y: auto;
}
.notif-empty {
    text-align: center;
    color: var(--text-secondary, #888);
    padding: 1.5rem;
    font-size: 0.85rem;
    margin: 0;
}
.notif-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color, #333);
    cursor: pointer;
    transition: background 0.15s;
    background: rgba(200, 155, 60, 0.06);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255,255,255,0.04); }
.notif-item.read {
    background: transparent;
    opacity: 0.7;
}
.notif-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 0.82rem; font-weight: 600; margin-bottom: 0.2rem; }
.notif-msg {
    font-size: 0.8rem;
    color: var(--text-secondary, #888);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-time { font-size: 0.72rem; color: var(--text-secondary, #888); margin-top: 0.2rem; }

/* ─── Tier badges ─────────────────────────────────────────────────────────── */
.tier-badge {
    display: inline-block;
    padding: .15rem .6rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}
/* ○ Common — sin badge (usuario normal) */
.tier-uncommon { background: rgba(74,144,217,.15);  color: #4a90d9; border: 1px solid rgba(74,144,217,.3); }
.tier-rare     { background: rgba(200,155,60,.15);  color: #c89b3c; border: 1px solid rgba(200,155,60,.3); }
.tier-mythic   { background: rgba(231,76,60,.15);   color: #ff6b4a; border: 1px solid rgba(231,76,60,.3); }
.tier-admin    { background: rgba(155,89,182,.15);  color: #9b59b6; border: 1px solid rgba(155,89,182,.3); }

/* ─── Visual polish — de mobile a desktop ────────────────────────────────── */

/* Backdrop blur en TODOS los overlays (filtros, vista, nav mobile) */
#navOverlay, #filterOverlay, #vistaOverlay {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Handle indicator en bottom sheets */
#filterPanel::before,
#vistaPanel::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,.18);
    border-radius: 2px;
    margin: 0 auto 1.25rem;
}

/* Auth modal border-radius unificado */
.auth-modal { border-radius: 16px !important; }

/* Pub modal border-radius unificado (desktop) */
.pub-modal { border-radius: 16px; }

/* ─── Fase 6 — Pulido general mobile ─────────────────────────────────────── */

@media (max-width: 768px) {
    /* Touch targets mínimos 44px en botones críticos */
    .btn, .btn-primary, .btn-secondary,
    .card-add-btn, .card-button,
    .auth-btn-outline, .auth-btn-solid,
    .save-btn, .pub-submit {
        min-height: 44px;
    }

    /* Main padding reducido */
    main { padding: 0 .75rem; }

    /* Admin panel: tablas con scroll horizontal */
    .listings-table, .users-table, .dash-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Footer más compacto */
    .footer-inner { gap: 1.5rem; }
}

/* ─── Mobile modales — Fase 4 ────────────────────────────────────────────── */

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

@media (max-width: 640px) {
    /* ── Cart modal — bottom sheet ── */
    .cart-modal.active {
        align-items: flex-end;
    }
    .cart-modal .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        border-radius: 18px 18px 0 0;
        padding: 1.25rem 1rem;
        animation: slideUp 0.3s ease;
    }
    /* Items usan el espacio disponible */
    .cart-items {
        max-height: calc(90vh - 220px);
    }

    /* ── Auth modal — bottom sheet ── */
    .auth-modal-overlay {
        align-items: flex-end !important;
    }
    .auth-modal {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 18px 18px 0 0 !important;
        max-height: 92vh;
        padding: 1.5rem 1.25rem !important;
        animation: slideUp 0.3s ease;
    }
    /* Campos en columna simple */
    .auth-field-row {
        grid-template-columns: 1fr !important;
    }

    /* ── Modal de publicación — bottom sheet ── */
    .pub-modal-overlay {
        align-items: flex-end !important;
    }
    .pub-modal {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 18px 18px 0 0 !important;
        max-height: 92vh;
        padding: 1.25rem !important;
        animation: slideUp 0.3s ease;
    }
}

/* ─── Mobile nav — Fase 1 ─────────────────────────────────────────────────── */

/* Header-actions: cart + hamburger, siempre visibles en mobile */
.header-actions {
    display: none;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Botón hamburguesa */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--border-color, rgba(255,255,255,.1));
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.nav-toggle .bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary, #eee);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}

/* Botón cerrar dentro del drawer */
.nav-close {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary, #aaa);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    border-radius: 6px;
}
.nav-close:hover { color: var(--text-primary, #eee); background: rgba(255,255,255,.07); }

/* Overlay oscuro detrás del drawer */
#navOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 199;
    backdrop-filter: blur(2px);
}
#navOverlay.active { display: block; }

/* Bloquear scroll del body cuando drawer abierto */
body.nav-locked { overflow: hidden; }

@media (max-width: 768px) {
    /* Mostrar header-actions y hamburguesa */
    .header-actions { display: flex; }
    .nav-toggle     { display: flex; }
    .nav-close      { display: block; }

    /* Logo más pequeño */
    .logo img { height: 52px; }

    /* Header container más compacto */
    .header-container { padding: 0.6rem 1rem; }

    /* Nav → drawer lateral derecho */
    nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(300px, 85vw);
        background: var(--bg-surface, #161724);
        border-left: 1px solid var(--border-color, rgba(255,255,255,.08));
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 4rem 1.5rem 2rem;
        gap: 0;
        z-index: 200;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        overflow-x: hidden;
    }

    nav.nav-open {
        transform: translateX(0);
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
    }

    /* Links dentro del drawer */
    nav a, nav .nav-link {
        display: block;
        width: 100%;
        padding: 0.85rem 0;
        border-bottom: 1px solid var(--border-color, rgba(255,255,255,.05));
        font-size: 1rem;
        color: var(--text-primary, #eee);
        text-decoration: none;
    }
    nav a:hover { color: var(--accent-primary, #c89b3c); }
    nav a:last-of-type { border-bottom: none; }

    /* Currency widget dentro del drawer */
    .currency-widget {
        margin-top: 1rem;
        width: 100%;
        justify-content: flex-start;
        border-radius: 8px;
        padding: 0.5rem 0.75rem;
    }

    /* Auth widget dentro del drawer */
    .auth-widget {
        width: 100%;
        margin-top: 0.5rem;
    }
    .auth-user-menu, .auth-btns {
        width: 100%;
    }
    .auth-btns {
        flex-direction: column;
        gap: 0.5rem;
    }
    .auth-btn-outline, .auth-btn-solid {
        width: 100%;
        text-align: center;
        padding: 0.65rem;
    }
    /* Dropdown del usuario en mobile → sin position absolute */
    .auth-dropdown {
        position: static !important;
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin-top: 0.25rem;
        display: flex !important;
        flex-direction: column;
        width: 100%;
    }

    /* Notif bell en el drawer */
    .notif-bell { width: 100%; margin-top: 0.5rem; }
    .notif-bell-btn { width: 100%; text-align: left; padding: 0.85rem 0; font-size: 1rem; border-radius: 0; }
}

