/* Grimorio TCG - Estilos compartidos */

/* Tailwind CDN se carga antes que este archivo */

/* ------------------------------------------------------------------
   Base
   ------------------------------------------------------------------ */
body {
    background-color: #0d1117;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
}

body.gradient-bg {
    background: radial-gradient(ellipse at top, #1a0a2e 0%, #0d1117 60%);
    min-height: 100vh;
}

/* ------------------------------------------------------------------
   Tipografía
   ------------------------------------------------------------------ */
.title-cinzel {
    font-family: 'Cinzel', serif;
    font-weight: 700;
}

.text-rajdhani {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.text-inter {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

/* ------------------------------------------------------------------
   Navbar
   ------------------------------------------------------------------ */
.navbar-figma {
    font-family: 'Cinzel', serif;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(13, 17, 23, 0.97);
    backdrop-filter: blur(12px);
}

.navbar-bg {
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(10px);
}

.navbar-link {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: #6b7280;
    transition: color 0.2s ease;
}

.navbar-link:hover {
    color: #f97316;
}

.navbar-icon-btn {
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s ease;
    color: #6b7280;
}

.navbar-icon-btn:hover {
    background: #1a2030;
}

.navbar-search-input {
    font-family: 'Inter', sans-serif;
    background: #1a2030;
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #e8e8f0;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    width: 200px;
    outline: none;
}

/* Dropdown del avatar en desktop: soporte táctil */
.avatar-dropdown:focus-within .avatar-menu,
.avatar-dropdown:hover .avatar-menu {
    display: block;
}

/* ------------------------------------------------------------------
   Cards y contenedores
   ------------------------------------------------------------------ */
.card-bg {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all 0.3s ease;
}

.card-bg:hover {
    border-color: rgba(249, 115, 22, 0.4);
}

.input-bg {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
}

.input-bg:focus {
    outline: none;
    border-color: #f97316;
}

.glow-btn {
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.4);
    transition: all 0.3s ease;
}

.glow-btn:hover {
    box-shadow: 0 0 35px rgba(249, 115, 22, 0.7);
    transform: scale(1.02);
}

.section-title {
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

/* ------------------------------------------------------------------
   Botones de carrito en cards
   ------------------------------------------------------------------ */
.boton-agregar-novedad,
.boton-agregar-catalogo {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: 0.8rem;
    border: 1px solid rgba(34, 197, 94, 0.35);
    background: linear-gradient(135deg, #22c55e, #14b8a6);
    color: #f8fafc;
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.boton-agregar-novedad:hover,
.boton-agregar-catalogo:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #4ade80, #2dd4bf);
    box-shadow: 0 12px 28px rgba(34, 197, 94, 0.24);
}

.boton-agotado-novedad,
.boton-agotado-catalogo {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: 0.8rem;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #fff;
    cursor: not-allowed;
}

/* ------------------------------------------------------------------
   Etiquetas de disponibilidad en esquina
   ------------------------------------------------------------------ */
.etiqueta-preventa,
.etiqueta-agotado {
    position: absolute;
    top: 14px;
    right: -32px;
    z-index: 5;
    width: 130px;
    padding: 5px 0;
    text-align: center;
    transform: rotate(45deg);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 0.1em;
    font-size: 0.7rem;
    color: #fff;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.35);
}

.etiqueta-preventa {
    background: linear-gradient(90deg, #10b981, #059669);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.7), 0 0 4px rgba(5, 150, 105, 0.6);
    animation: pulso-preventa 2s ease-in-out infinite;
}

.etiqueta-agotado {
    background: linear-gradient(90deg, #ef4444, #b91c1c);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.7), 0 0 4px rgba(185, 28, 28, 0.6);
}

@media (max-width: 640px) {
    .etiqueta-preventa,
    .etiqueta-agotado {
        width: 110px;
        right: -28px;
        font-size: 0.6rem;
        top: 10px;
    }
}

@keyframes pulso-preventa {
    0%, 100% {
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.6), 0 0 4px rgba(5, 150, 105, 0.5);
    }
    50% {
        box-shadow: 0 0 18px rgba(16, 185, 129, 0.9), 0 0 8px rgba(5, 150, 105, 0.8);
    }
}

/* ------------------------------------------------------------------
   Cards específicas
   ------------------------------------------------------------------ */
.carta-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all 0.3s ease;
}

.carta-card:hover {
    border-color: rgba(249, 115, 22, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.2);
}

.torneo-card {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    transition: all 0.3s ease;
}

.torneo-card:hover {
    border-color: rgba(249, 115, 22, 0.4);
    transform: translateY(-2px);
}

.carta-agotada {
    opacity: 0.55;
}

/* ------------------------------------------------------------------
   Sidebar / menú lateral
   ------------------------------------------------------------------ */
.sidebar-bg {
    background: rgba(255, 255, 255, 0.03);
    border-right: 1px solid rgba(139, 92, 246, 0.2);
}

.categoria-item,
.menu-item {
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
}

.categoria-item:hover,
.menu-item:hover,
.menu-item.active {
    border-left-color: #f97316;
    color: #f97316;
    padding-left: 12px;
}

/* ------------------------------------------------------------------
   Perfil / órdenes
   ------------------------------------------------------------------ */
.orden-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(139, 92, 246, 0.15);
    transition: all 0.3s ease;
}

.orden-card:hover {
    border-color: rgba(249, 115, 22, 0.3);
}

.estado-badge {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 8px;
    white-space: nowrap;
}

.estado-pendiente {
    color: #facc15;
    background: rgba(250, 204, 21, 0.1);
    border: 1px solid rgba(250, 204, 21, 0.3);
}

.estado-vendido {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.estado-cancelado {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

/* ------------------------------------------------------------------
   Admin
   ------------------------------------------------------------------ */
.admin-tab {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 12px 20px;
    border-radius: 10px 10px 0 0;
    color: #9ca3af;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.admin-tab:hover {
    color: #e8e8f0;
    background: rgba(255, 255, 255, 0.03);
}

.admin-tab.activo {
    color: #f97316;
    background: rgba(249, 115, 22, 0.08);
    border-bottom-color: #f97316;
}

.admin-seccion {
    display: none;
}

.admin-seccion.activo {
    display: block;
}

.carta-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(139, 92, 246, 0.15);
    transition: all 0.3s ease;
}

.carta-row:hover {
    border-color: rgba(249, 115, 22, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.filtro-orden-btn.activo {
    color: #f97316;
    border-color: rgba(249, 115, 22, 0.5);
    background: rgba(249, 115, 22, 0.1);
}

.disp-agotado {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.disp-preventa {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.3);
}

/* ------------------------------------------------------------------
   Botón flotante del carrito
   ------------------------------------------------------------------ */
#carrito-float-btn {
    animation: float-btn-in 0.4s ease-out;
}

#carrito-float-btn:hover {
    box-shadow: 0 12px 40px rgba(249, 115, 22, 0.5);
}

@keyframes float-btn-in {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ------------------------------------------------------------------
   Drawer del carrito
   ------------------------------------------------------------------ */
#drawer-panel {
    background: #0d1117;
    border-left: 1px solid rgba(139, 92, 246, 0.3);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

@media (max-width: 640px) {
    #drawer-panel {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (min-width: 641px) {
    #drawer-panel {
        width: 26rem !important;
    }
}

/* ------------------------------------------------------------------
   Utilidades
   ------------------------------------------------------------------ */
.safe-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Scrollbar oscura para WebKit */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0d1117;
}

::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}
