html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow:
        0 0 0 0.1rem white,
        0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
    background: #ffffff;
}


/* ==========================================
   NAVEGACIÓN GENERAL
   ========================================== */

.repuestos-navbar {
    min-height: 72px;
}

.repuestos-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #212529 !important;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #0d6efd;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
}

.navbar-nav .nav-link {
    border-radius: 8px;
    padding: 9px 12px !important;
    font-weight: 600;
    color: #343a40 !important;
}

.navbar-nav .nav-link:hover {
    background: #f1f5f9;
    color: #0d6efd !important;
}

.app-container {
    width: 100%;
}

.repuestos-footer {
    padding: 18px 0;
    font-size: 13px;
}


/* ==========================================
   LOGIN
   ========================================== */

.login-page {
    min-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f4f6f8;
    padding: 30px 15px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    padding: 40px;
    border-radius: 18px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12);
}

.logo-circle {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #0d6efd;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
}

.login-card h1 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 8px;
}

.subtitle {
    text-align: center;
    color: #6c757d;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #0d6efd;
}

.login-card button {
    width: 100%;
    padding: 14px;
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.login-card button:hover {
    background: #0b5ed7;
}

.footer-text {
    text-align: center;
    margin-top: 25px;
    color: #999;
    font-size: 13px;
}


/* ==========================================
   PRINCIPAL / HERO
   ========================================== */

.principal-page {
    padding: 30px 0 60px;
}

.hero {
    background: #0d6efd;
    color: white;
    padding: 35px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
    margin-bottom: 25px;
}

.hero > div {
    min-width: 0;
}

.eyebrow {
    font-weight: bold;
    margin-bottom: 5px;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.hero-text {
    margin: 0;
    opacity: 0.9;
}

.hero-badge {
    background: white;
    color: #0d6efd;
    padding: 14px 22px;
    border-radius: 30px;
    font-weight: bold;
    flex-shrink: 0;
}


/* ==========================================
   BUSCADOR
   ========================================== */

.buscador-section {
    display: flex;
    gap: 10px;
    margin-bottom: 35px;
    width: 100%;
}

.buscador-section form {
    width: 100%;
}

.buscador-section input {
    flex: 1;
    min-width: 0;
    padding: 14px;
    border: 1px solid #ced4da;
    border-radius: 10px;
}

.buscador-section select {
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 10px;
    background: white;
}

.buscador-section button {
    padding: 14px 25px;
    border: none;
    border-radius: 10px;
    background: #0d6efd;
    color: white;
    font-weight: bold;
}


/* ==========================================
   CATEGORÍAS Y PRODUCTOS
   ========================================== */

.categorias h2,
.productos-section h2 {
    margin-bottom: 18px;
}

.categorias-grid,
.productos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.categoria-card,
.producto-card {
    background: white;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.categoria-card {
    margin-bottom: 35px;
}

.producto-imagen {
    height: 130px;
    background: #e9ecef;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: #6c757d;
}

.stock {
    color: #198754;
    font-weight: bold;
}

.precio {
    font-size: 22px;
    font-weight: bold;
}

.producto-card button {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 8px;
    background: #0d6efd;
    color: white;
    font-weight: bold;
}


/* ==========================================
   PÁGINAS DE CATEGORÍA
   ========================================== */

.categoria-page {
    padding: 30px 0 60px;
}

.categoria-header {
    background: #0d6efd;
    color: white;
    padding: 30px;
    border-radius: 18px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.categoria-header > div {
    min-width: 0;
}

.categoria-header h1 {
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.categoria-header p {
    margin-bottom: 0;
}

.volver-btn {
    background: white;
    color: #0d6efd;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: bold;
    flex-shrink: 0;
    text-align: center;
}

.volver-btn:hover {
    color: #0b5ed7;
}

.categoria-link {
    text-decoration: none;
    color: inherit;
}

.categoria-link .categoria-card {
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    cursor: pointer;
}

.categoria-link .categoria-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}


/* ==========================================
   CONFIRMAR PEDIDO
   ========================================== */

.confirmar-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
}

.datos-pedido,
.resumen-pedido {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    min-width: 0;
}

.datos-pedido h2,
.resumen-pedido h2 {
    margin-bottom: 20px;
}

.datos-pedido select,
.datos-pedido textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 16px;
}

.resumen-item {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.resumen-item p {
    margin: 5px 0 0;
    color: #6c757d;
}

.resumen-total {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    font-size: 24px;
    margin-top: 20px;
}


/* ==========================================
   PAGO
   ========================================== */

.pago-opcion {
    border: 1px solid #dee2e6;
    border-radius: 12px;
    margin-bottom: 15px;
    transition: 0.2s;
}

.pago-opcion:hover {
    border-color: #0d6efd;
    background: #f8f9fa;
}

.pago-opcion label {
    width: 100%;
    padding: 18px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.pago-opcion input {
    margin: 15px 0 0 15px;
}

.pago-opcion label strong {
    font-size: 18px;
}

.pago-opcion label span {
    color: #6c757d;
    margin-top: 4px;
}

.qr-practica {
    text-align: center;
    margin: 25px 0;
}

.qr-cuadricula {
    width: 240px;
    height: 240px;
    margin: auto;
    background:
        repeating-linear-gradient(
            45deg,
            #111 0px,
            #111 7px,
            white 7px,
            white 14px
        );
    border: 12px solid white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    position: relative;
}

.qr-esquina {
    position: absolute;
    width: 55px;
    height: 55px;
    background: white;
    border: 10px solid #111;
    top: 12px;
    left: 12px;
}

.qr-esquina.derecha {
    left: auto;
    right: 12px;
}

.qr-esquina.abajo {
    top: auto;
    bottom: 12px;
}

.qr-centro {
    position: absolute;
    width: 55px;
    height: 55px;
    background: #0d6efd;
    color: white;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.qr-aviso {
    margin-top: 12px;
    color: #dc3545;
    font-weight: bold;
}

.alias-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alias-box strong {
    font-size: 24px;
    color: #0d6efd;
}

.tarjeta-simulada {
    background: #212529;
    color: white;
    border-radius: 18px;
    padding: 25px;
    margin: 25px 0;
    min-height: 170px;
}


/* ==========================================
   TABLET
   ========================================== */

@media (max-width: 991px) {

    .categorias-grid,
    .productos-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .categoria-header {
        align-items: flex-start;
    }

    .confirmar-grid {
        gap: 20px;
    }
}


/* ==========================================
   CELULAR
   ========================================== */

@media (max-width: 767px) {

    html {
        font-size: 14px;
    }

    body {
        margin-bottom: 30px;
        overflow-x: hidden;
    }

    .container {
        max-width: 100%;
        padding-left: 14px;
        padding-right: 14px;
    }


    /* MENU MÓVIL */

    .repuestos-navbar {
        min-height: 64px;
    }

    .repuestos-brand {
        font-size: 19px;
    }

    .brand-logo {
        width: 34px;
        height: 34px;
    }

    .navbar-collapse {
        margin-top: 12px;
        padding-top: 10px;
        padding-bottom: 10px;
        border-top: 1px solid #e9ecef;
    }

    .navbar-nav {
        gap: 4px;
    }

    .navbar-nav .nav-link {
        width: 100%;
        padding: 12px !important;
        background: #f8f9fa;
    }


    /* ESPACIADO GENERAL */

    .principal-page,
    .categoria-page {
        padding-top: 18px;
        padding-bottom: 35px;
    }


    /* HERO PRINCIPAL */

    .hero {
        padding: 24px 20px;
        border-radius: 18px;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }

    .hero h1 {
        font-size: 30px;
        line-height: 1.12;
    }

    .hero-text {
        font-size: 17px;
        line-height: 1.5;
    }

    .hero-badge {
        align-self: flex-start;
        padding: 11px 18px;
    }


    /* HEADER CATEGORÍAS */

    .categoria-header {
        padding: 22px 20px;
        border-radius: 18px;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }

    .categoria-header h1 {
        font-size: 28px;
        line-height: 1.12;
        margin-bottom: 10px;
    }

    .categoria-header p {
        font-size: 16px;
        line-height: 1.45;
    }

    /*
       Cualquier botón/link que esté al costado
       del encabezado pasa debajo del texto.
    */

    .categoria-header .volver-btn,
    .categoria-header > a {
        width: 100%;
        display: block;
        text-align: center;
        padding: 13px 15px;
    }

    /*
       Si dentro del header hay más de un botón,
       no se superponen con el título.
    */

    .categoria-header > div + div {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }


    /* BUSCADOR */

    .buscador-section {
        display: block;
        margin-bottom: 25px;
    }

    .buscador-section form {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .buscador-section input,
    .buscador-section select,
    .buscador-section button,
    .buscador-section .btn {
        width: 100% !important;
        min-width: 0 !important;
    }

    .buscador-section input {
        font-size: 16px;
    }

    .buscador-section button {
        padding: 13px 18px;
    }


    /* CATEGORÍAS Y PRODUCTOS */

    .categorias-grid,
    .productos-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .categoria-card,
    .producto-card {
        padding: 18px;
        border-radius: 15px;
    }

    .producto-imagen {
        height: 160px;
    }

    .precio {
        font-size: 21px;
    }


    /* CARRITO */

    .producto-card h2,
    .producto-card h3 {
        overflow-wrap: anywhere;
    }

    .producto-card .btn {
        max-width: 100%;
    }


    /* CONFIRMAR PEDIDO / RESUMEN */

    .confirmar-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .datos-pedido,
    .resumen-pedido {
        padding: 18px;
    }

    .resumen-item {
        gap: 10px;
        align-items: flex-start;
    }

    .resumen-item > * {
        min-width: 0;
    }

    .resumen-total {
        font-size: 20px;
        gap: 10px;
    }


    /* PAGO */

    .pago-opcion label {
        padding: 15px;
    }

    .qr-cuadricula {
        width: min(240px, 85vw);
        height: min(240px, 85vw);
    }

    .alias-box strong {
        font-size: 19px;
        overflow-wrap: anywhere;
    }

    .tarjeta-simulada {
        padding: 18px;
    }


    /* TABLAS ADMINISTRATIVAS */

    table {
        font-size: 13px;
    }


    /* BOTONES */

    .btn {
        white-space: normal;
    }

    button,
    .btn,
    a.volver-btn {
        min-height: 44px;
    }
}


/* ==========================================
   CELULARES MUY ANGOSTOS
   ========================================== */

@media (max-width: 420px) {

    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .hero,
    .categoria-header {
        padding: 20px 16px;
    }

    .hero h1,
    .categoria-header h1 {
        font-size: 26px;
    }

    .categoria-card,
    .producto-card,
    .datos-pedido,
    .resumen-pedido {
        padding: 16px;
    }

    .login-card {
        padding: 25px 18px;
    }

    .login-card h1 {
        font-size: 27px;
    }
}