/* ==========================================================================
   Estilos Oficiales Portal Gameforge Metin2 (Azul Marino / Cian / Blanco)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800&family=Open+Sans:wght@400;600;700&display=swap');

:root {
    /* Paleta Oficial Gameforge Metin2 */
    --gf-bg-main: #0c1c2e;         /* Azul marino nocturno (Fondo General) */
    --gf-bg-card: #13273e;         /* Azul contenedor (Tarjetas y Tablas) */
    --gf-bg-header: #081321;       /* Azul marino muy oscuro (Encabezados y Navbar) */
    
    /* Acentos y Botones */
    --gf-cyan: #00a2ff;            /* Azul Cian Gameforge (Acción Principal / Botones) */
    --gf-cyan-hover: #0082cc;      /* Azul Cian Hover */
    --gf-gold: #f5c842;            /* Dorado clásico Metin2 para títulos destacados y Yang */
    
    /* Tipografía y Contraste de Lectura */
    --gf-text-white: #ffffff;      /* Blanco Puro para Títulos y Datos */
    --gf-text-light: #d1e2f3;      /* Azul Plomo Claro para textos de cuerpo */
    --gf-text-muted: #8ba2b8;      /* Texto secundario de alta legibilidad */
    --gf-border-cyan: #1d456a;     /* Bordes de tarjetas y contenedores */
    
    /* Slot de Inventario Metin2 */
    --gf-slot-bg: #070e17;
}

/* Base General */
body {
    background-color: var(--gf-bg-main);
    color: var(--gf-text-light);
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Encabezados y Títulos */
h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.5px;
    color: var(--gf-gold) !important;
}

/* Barra de Navegación (Navbar) */
.navbar {
    background-color: var(--gf-bg-header) !important;
    border-bottom: 2px solid var(--gf-cyan);
}

.navbar-brand {
    color: var(--gf-gold) !important;
    font-weight: 700;
}

.nav-link {
    color: var(--gf-text-light) !important;
    font-weight: 600;
}

.nav-link:hover, .nav-link.active {
    color: var(--gf-cyan) !important;
}

/* Tarjetas (Cards) */
.card {
    background-color: var(--gf-bg-card) !important;
    border: 1px solid var(--gf-border-cyan) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    overflow: hidden;
}

.card-header {
    background-color: var(--gf-bg-header) !important;
    color: var(--gf-gold) !important;
    border-bottom: 2px solid var(--gf-border-cyan) !important;
    padding: 0.75rem 1.25rem;
}

/* Formularios y Inputs */
.form-label {
    color: var(--gf-text-white) !important;
    font-weight: 600;
}

.form-control, .form-select {
    background-color: #081321 !important;
    color: var(--gf-text-white) !important;
    border: 1px solid var(--gf-border-cyan) !important;
    border-radius: 4px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--gf-cyan) !important;
    box-shadow: 0 0 0 0.25rem rgba(0, 162, 255, 0.25) !important;
}

/* Tablas con Corrección de Legibilidad Extrema */
.table {
    color: var(--gf-text-light) !important;
    border-color: var(--gf-border-cyan);
}

.table-black, .table thead th {
    background-color: var(--gf-bg-header) !important;
    color: var(--gf-gold) !important;
    font-family: 'Cinzel', serif;
    border-bottom: 2px solid var(--gf-cyan);
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--gf-text-white);
}

.table-hover>tbody>tr:hover>* {
    background-color: #1a3554 !important;
    color: var(--gf-text-white) !important;
}

/* Corrección para textos secundarios en tablas */
.text-muted, small.text-muted, .table td small {
    color: var(--gf-text-muted) !important;
    font-weight: 600;
}

/* ==========================================================================
   Estilos Oscuros para Modales (SweetAlert2)
   ========================================================================== */
.swal2-popup {
    background-color: var(--gf-bg-card) !important;
    color: var(--gf-text-light) !important;
    border: 2px solid var(--gf-border-cyan) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8) !important;
}

.swal2-title {
    color: var(--gf-gold) !important;
    font-family: 'Cinzel', serif !important;
}

.swal2-html-container {
    color: var(--gf-text-light) !important;
}

.swal2-popup .form-label, 
.swal2-popup label {
    color: var(--gf-text-white) !important;
}

.swal2-popup .form-control, 
.swal2-popup .form-select {
    background-color: #081321 !important;
    color: var(--gf-text-white) !important;
    border: 1px solid var(--gf-border-cyan) !important;
}

.swal2-popup .table {
    color: var(--gf-text-light) !important;
}

.swal2-popup .table th {
    color: var(--gf-gold) !important;
    border-bottom-color: var(--gf-cyan) !important;
}

.swal2-popup .table td {
    border-bottom-color: var(--gf-border-cyan) !important;
}

/* Ventana de Tienda e Inventario (Modo In-Game) */
.metin2-window {
    width: 210px;
    background-color: #09121c;
    border: 2px solid var(--gf-cyan);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    padding: 8px;
    user-select: none;
}

.metin2-header {
    background: linear-gradient(180deg, #13273e 0%, #081321 100%);
    color: var(--gf-gold);
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 5px;
    border-bottom: 1px solid var(--gf-cyan);
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* Grid de 5 columnas x 8 filas (40 Slots) */
.metin2-grid {
    display: grid;
    grid-template-columns: repeat(5, 36px);
    grid-template-rows: repeat(8, 36px);
    gap: 2px;
    justify-content: center;
}

.metin2-slot {
    width: 36px;
    height: 36px;
    background-color: var(--gf-slot-bg);
    border: 1px solid #1a334d;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease-in-out;
}

.metin2-slot:hover {
    border-color: var(--gf-cyan);
    box-shadow: inset 0 0 6px rgba(0, 162, 255, 0.6);
}

.metin2-slot.occupied {
    background-color: #102438;
}

.metin2-slot.sold {
    background-color: rgba(220, 53, 69, 0.35);
    border-color: #dc3545;
}

.metin2-slot.sold::after {
    content: "✕";
    position: absolute;
    color: #dc3545;
    font-size: 22px;
    font-weight: bold;
    text-shadow: 0 0 3px #000;
}

.metin2-badge {
    position: absolute;
    bottom: 1px;
    right: 2px;
    font-size: 0.65rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 1px 1px 2px #000, -1px -1px 2px #000;
}

/* Botones con Azul Cian Gameforge */
.btn-warning, .btn-primary {
    background-color: var(--gf-cyan) !important;
    border-color: var(--gf-cyan-hover) !important;
    color: #ffffff !important;
    font-weight: 700;
}

.btn-warning:hover, .btn-primary:hover {
    background-color: var(--gf-cyan-hover) !important;
    border-color: #006bb0 !important;
    color: #ffffff !important;
}

/* Moneda y Valores */
.text-warning, .text-gold {
    color: var(--gf-gold) !important;
}

.text-success {
    color: #00ff88 !important; /* Verde Neón para montos y ganancias */
}

.text-info {
    color: var(--gf-cyan) !important;
}
.img-item {
    display: inline-block;
    width: auto;
    height: auto;
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
    image-rendering: pixelated;
    vertical-align: middle;
}

/* Variantes por tamaño máximo */
.img-item-sm { max-width: 24px; max-height: 24px; }
.img-item-md { max-width: 36px; max-height: 36px; }
.img-item-lg { max-width: 64px; max-height: 64px; }

/* ==========================================================================
   SELECT2 (tema oscuro coherente con Gameforge)
   ========================================================================== */

/* Caja del select (una sola línea) */
.select2-container--default .select2-selection--single {
    background-color: #081321 !important;
    color: var(--gf-text-white) !important;
    border: 1px solid var(--gf-border-cyan) !important;
    border-radius: 4px !important;
    height: 38px !important;
    padding: 4px 8px;
    display: flex;
    align-items: center;
}

/* Texto seleccionado */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--gf-text-white) !important;
    line-height: normal !important;
    padding-left: 0 !important;
}

/* Placeholder (cuando no hay nada seleccionado) */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--gf-text-muted) !important;
}

/* Flecha a la derecha */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
    top: 0 !important;
    right: 4px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--gf-cyan) transparent transparent transparent !important;
}

/* Foco */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--gf-cyan) !important;
    box-shadow: 0 0 0 0.25rem rgba(0, 162, 255, 0.25) !important;
}

/* Dropdown */
.select2-container--default .select2-dropdown {
    background-color: #081321 !important;
    color: var(--gf-text-white) !important;
    border: 1px solid var(--gf-border-cyan) !important;
    border-radius: 4px !important;
}

/* Caja de búsqueda dentro del dropdown */
.select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: #0c1c2e !important;
    color: var(--gf-text-white) !important;
    border: 1px solid var(--gf-border-cyan) !important;
    border-radius: 4px !important;
    padding: 6px 8px;
}
.select2-container--default .select2-search--dropdown .select2-search__field::placeholder {
    color: var(--gf-text-muted) !important;
}

/* Opciones del dropdown */
.select2-container--default .select2-results__option {
    color: var(--gf-text-light) !important;
    padding: 6px 10px;
}
.select2-container--default .select2-results__option--highlighted {
    background-color: var(--gf-cyan) !important;
    color: #000 !important;
}
.select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: #1a3554 !important;
    color: var(--gf-text-white) !important;
}

/* Mensaje de "buscando..." / "no hay resultados" */
.select2-container--default .select2-results__message {
    color: var(--gf-text-muted) !important;
    padding: 6px 10px;
}

/* Ícono dentro del dropdown (si usas templateResult con imagen) */
.select2-container--default .select2-results__option img {
    vertical-align: middle;
    margin-right: 8px;
    border-radius: 3px;
}

/* ==========================================================================
   PÁGINAS DE AUTENTICACIÓN (login.php / registro.php)
   ========================================================================== */

.auth-page {
    background-color: var(--gf-bg-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-wrapper {
    width: 100%;
    max-width: 1000px;
}

.auth-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background-color: var(--gf-bg-card);
    border: 1px solid var(--gf-border-cyan);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    min-height: 620px;
}

/* -------- Columna izquierda: portada -------- */
.auth-cover {
    position: relative;
    background: linear-gradient(160deg, #0c1c2e 0%, #13273e 60%, #1d456a 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
}

.auth-cover-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    pointer-events: none;
}

.auth-cover-text {
    position: relative;
    z-index: 2;
}

.auth-cover-title {
    font-family: 'Cinzel', serif;
    color: var(--gf-gold) !important;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.auth-cover-subtitle {
    color: var(--gf-text-light);
    font-size: 0.95rem;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

/* -------- Columna derecha: formulario -------- */
.auth-form {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    background-color: var(--gf-bg-card);
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--gf-border-cyan);
}

.auth-tab {
    padding: 0.65rem 1rem;
    color: var(--gf-text-muted) !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.auth-tab:hover {
    color: var(--gf-cyan) !important;
}

.auth-tab.active {
    color: var(--gf-cyan) !important;
    border-bottom-color: var(--gf-cyan);
}

/* Alertas */
.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid;
}
.auth-alert-error {
    background-color: rgba(220, 53, 69, 0.15);
    border-color: #dc3545;
    color: #ff7a85;
}
.auth-alert-success {
    background-color: rgba(0, 255, 136, 0.1);
    border-color: #00ff88;
    color: #00ff88;
}

/* Cuerpo del formulario */
.auth-form-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    flex: 1;
}

.auth-form-scroll {
    overflow-y: auto;
    max-height: 520px;
    padding-right: 4px;
}

/* Campos */
.auth-field {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #081321;
    border: 1px solid var(--gf-border-cyan);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.auth-field:focus-within {
    border-color: var(--gf-cyan);
    box-shadow: 0 0 0 0.2rem rgba(0, 162, 255, 0.25);
}

.auth-field-highlight {
    border-color: var(--gf-gold);
}
.auth-field-highlight:focus-within {
    border-color: var(--gf-gold);
    box-shadow: 0 0 0 0.2rem rgba(245, 200, 66, 0.25);
}

.auth-field-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    color: var(--gf-text-muted);
    flex-shrink: 0;
}

.auth-field input,
.auth-field select {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--gf-text-white);
    padding: 0.75rem 0.75rem 0.75rem 0;
    font-size: 0.95rem;
    outline: none;
    width: 100%;
}

.auth-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%2300a2ff'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.auth-field input::placeholder {
    color: var(--gf-text-muted);
}

.auth-field select option {
    background-color: #081321;
    color: var(--gf-text-white);
}

/* Toggle mostrar/ocultar contraseña */
.auth-toggle-pwd {
    background: transparent;
    border: none;
    color: var(--gf-text-muted);
    cursor: pointer;
    padding: 0 0.75rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.auth-toggle-pwd:hover {
    opacity: 1 !important;
    color: var(--gf-cyan);
}

/* Fila de 2 columnas */
.auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

/* Divisor con texto */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0;
    color: var(--gf-text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--gf-border-cyan);
}

/* Botón principal */
.auth-submit {
    margin-top: 0.5rem;
    padding: 0.85rem;
    background-color: var(--gf-cyan);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    letter-spacing: 0.5px;
}
.auth-submit:hover {
    background-color: var(--gf-cyan-hover);
}
.auth-submit:active {
    transform: scale(0.98);
}

/* Footer */
.auth-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--gf-text-muted);
}
.auth-footer a {
    color: var(--gf-cyan);
    font-weight: 700;
    text-decoration: none;
    margin-left: 0.25rem;
}
.auth-footer a:hover {
    text-decoration: underline;
}

/* Responsive: en pantallas pequeñas, se oculta la portada */
@media (max-width: 860px) {
    .auth-card {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .auth-cover {
        min-height: 180px;
        padding: 1.5rem;
    }
    .auth-cover-title {
        font-size: 1.4rem;
    }
    .auth-cover-subtitle {
        font-size: 0.85rem;
    }
    .auth-form {
        padding: 1.5rem;
    }
    .auth-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   RESPONSIVE UNIFICADO — Ajustes para móvil y tablet
   Cubre: navbar, tablas, cuadrícula Metin2, cards, filtros, modales, pestañas
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. NAVBAR — ajustes para pantallas pequeñas
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .navbar {
        padding: 0.5rem 0.75rem;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .navbar-nav {
        margin-top: 0.5rem;
    }

    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.95rem;
    }

    /* Dropdown de usuario a la derecha, alineado con el resto */
    .navbar-nav.ms-auto {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--gf-border-cyan);
    }
}

@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1rem;
    }

    .navbar-text {
        font-size: 0.85rem;
    }
}

/* --------------------------------------------------------------------------
   2. TABLAS — forzar scroll horizontal cuando hacen falta
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    /* Cualquier tabla envuelta en table-responsive ya lo hace,
       pero aquí reforzamos el comportamiento para las que no lo estén */
    .card-body > .table,
    .card-body > table.table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.5rem;
        white-space: nowrap;
    }

    /* DataTables: el buscador y el selector de longitud se apilan */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: left;
        margin-bottom: 0.5rem;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: center;
        margin-top: 0.5rem;
    }
}

/* --------------------------------------------------------------------------
   3. CUADRÍCULA METIN2 — escalar en móvil
   -------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    /* Reducir tamaño de ventana y slots */
    .metin2-window {
        width: 100%;
        max-width: 200px;
        padding: 6px;
    }

    .metin2-header {
        font-size: 0.75rem;
        padding: 4px;
    }

    .metin2-grid {
        grid-template-columns: repeat(5, 32px);
        grid-template-rows: repeat(8, 32px);
        gap: 1px;
    }

    .metin2-slot {
        width: 32px;
        height: 32px;
    }

    .metin2-slot img {
        max-width: 26px;
        max-height: 26px;
    }

    .metin2-badge {
        font-size: 0.55rem;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    /* Tablet pequeña: un poco más grandes que móvil, pero no full */
    .metin2-grid {
        grid-template-columns: repeat(5, 34px);
        grid-template-rows: repeat(8, 34px);
    }

    .metin2-slot {
        width: 34px;
        height: 34px;
    }
}

/* --------------------------------------------------------------------------
   4. CARDS — paddings y headers más cómodos en móvil
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .card-header {
        padding: 0.6rem 0.9rem;
        font-size: 0.95rem;
    }

    .card-header h4,
    .card-header h5 {
        font-size: 1rem;
    }

    .card-body {
        padding: 0.9rem;
    }

    /* Headers con contenido en fila: que se apilen si no caben */
    .card-header.d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Botones grandes: reducir tamaño en móvil */
    .btn-lg {
        font-size: 0.95rem;
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 575.98px) {
    .card-body {
        padding: 0.75rem;
    }

    /* Badges y textos grandes: reducir un poco */
    .badge {
        font-size: 0.7rem;
    }

    .fs-3, .fs-4 {
        font-size: 1.1rem !important;
    }

    .fs-5 {
        font-size: 0.95rem !important;
    }

    .display-6 {
        font-size: 1.6rem !important;
    }
}

/* --------------------------------------------------------------------------
   5. FORMULARIOS Y FILTROS — inputs más cómodos en móvil
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .form-label {
        font-size: 0.85rem;
    }

    .form-control,
    .form-select {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }

    /* Filas con múltiples columnas: ya colapsan por Bootstrap,
       pero aseguramos el espaciado vertical */
    .row.g-3 > [class*="col-"] {
        margin-bottom: 0.25rem;
    }
}

/* --------------------------------------------------------------------------
   6. MODALES — adaptación a móvil
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-body {
        padding: 0.9rem;
    }

    .modal-header,
    .modal-footer {
        padding: 0.6rem 0.9rem;
    }

    /* El modal de "Ver ítems" en móvil: full width */
    #modalItemsTienda .modal-dialog {
        max-width: calc(100% - 1rem);
    }

    #modalItemsTienda .modal-footer {
        flex-direction: column;
        align-items: stretch;
    }

    #modalItemsTienda .modal-footer small {
        text-align: center;
    }

    /* Tablas dentro de modales: scroll */
    .modal-body-scroll {
        max-height: 60vh;
    }
}

/* --------------------------------------------------------------------------
   7. PESTAÑAS DE HISTORIAL — íconos + texto apilables
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .nav-tabs .nav-item {
        flex: 0 0 auto;
    }

    .nav-tabs .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
    }

    .nav-tabs .nav-link i {
        margin-right: 0.25rem;
    }
}

@media (max-width: 575.98px) {
    .nav-tabs .nav-link {
        font-size: 0.75rem;
        padding: 0.45rem 0.6rem;
    }
}

/* --------------------------------------------------------------------------
   8. TIENDA PRIVADA — layout en móvil
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    /* La cuadrícula y el panel de totales se apilan */
    .row.align-items-center > .col-md-6 {
        margin-bottom: 1rem;
    }

    /* El bloque de totales: reducir padding */
    .p-4.bg-black.border {
        padding: 1rem !important;
    }

    /* El botón de cierre: menos grande */
    .btn-lg.w-100 {
        font-size: 0.9rem;
        padding: 0.6rem 0.75rem;
    }
}

/* --------------------------------------------------------------------------
   9. AJUSTES GENERALES — tipografía y espaciado
   -------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    body {
        font-size: 0.9rem;
    }

    h1, h2, h3 {
        font-size: 1.1rem;
    }

    h4, h5 {
        font-size: 1rem;
    }

    .container,
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .row.mb-4 {
        margin-bottom: 0.75rem !important;
    }
}

/* --------------------------------------------------------------------------
   10. FORMULARIOS DE LOGIN Y REGISTRO — refinamiento móvil
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
    .auth-cover-img {
        opacity: 0.5;
    }

    .auth-cover-text {
        position: relative;
        z-index: 3;
    }

    .auth-form-scroll {
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }

    .auth-tabs {
        justify-content: center;
    }

    .auth-tab {
        flex: 1;
        text-align: center;
        padding: 0.55rem 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 575.98px) {
    .auth-wrapper {
        padding: 0;
    }

    .auth-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .auth-cover {
        min-height: 140px;
        padding: 1rem;
    }

    .auth-cover-title {
        font-size: 1.15rem;
    }

    .auth-form {
        padding: 1.25rem;
    }

    .auth-field input,
    .auth-field select {
        font-size: 0.9rem;
        padding: 0.65rem 0.5rem 0.65rem 0;
    }

    .auth-submit {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
}

/* --------------------------------------------------------------------------
   Íconos con tamaño natural estricto: cada imagen se muestra a su tamaño real
   - 32x32 se ve 32x32
   - 32x64 se ve 32x64 (sin recortes, sin escalado, sin deformación)
   -------------------------------------------------------------------------- */
.img-item-natural {
    display: inline-block;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    image-rendering: pixelated;
    vertical-align: middle;
}

/* ==========================================================================
   Botón inferior: ir a EpicGuild (login.php / registro.php)
   ========================================================================== */
.auth-epicguild {
    margin-top: 1rem;
    text-align: center;
}

.auth-epicguild-btn {
    display: inline-block;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gf-gold) !important;
    background-color: transparent;
    border: 1px solid var(--gf-gold);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.auth-epicguild-btn:hover {
    background-color: var(--gf-gold);
    color: #000 !important;
    text-decoration: none;
}