/* ============================================================
   VARIABLES
   ============================================================ */

:root {
    --red: #df1726;
    --border: #d9dee3;
    --text: #202832;
    --soft: #f3f3f3;
}


/* ============================================================
   GENERAL
   ============================================================ */

* {
    box-sizing: border-box;
}


body {
    margin: 0;
    font: 16px Arial, sans-serif;
    color: var(--text);
    background: #fff;
}


.container {
    max-width: 760px;
    margin: auto;
    padding: 18px 16px 50px;
}


/* ============================================================
   LOGO
   ============================================================ */

.brand {
    text-align: center;
    padding: 0 0 30px;
}


.brand img {
    width: 230px;
    max-width: 75%;
}


/* ============================================================
   PESTAÑAS
   ============================================================ */

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    gap: 0;
}


.tab {
    background: white;
    border: 0;
    color: var(--red);
    font-size: 16px;
    padding: 12px 17px;
    cursor: pointer;
}


.tab.active {
    border: 1px solid var(--border);
    border-bottom-color: white;
    border-radius: 4px 4px 0 0;
    margin-bottom: -1px;
}


/* ============================================================
   PANELES
   ============================================================ */

.panel {
    display: none;
    padding-top: 16px;
}


.panel.active {
    display: block;
}


/* ============================================================
   GRID
   ============================================================ */

.grid.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}


/* ============================================================
   FORMULARIOS
   ============================================================ */

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    margin-bottom: 16px;
}


input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd3da;
    border-radius: 4px;
    background: #fff;
    font: inherit;
}


button,
.button-link {
    border: 0;
    background: var(--red);
    color: #fff;
    padding: 10px 14px;
    border-radius: 4px;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}


/* ============================================================
   BÚSQUEDA
   ============================================================ */

.search-row {
    display: flex;
    max-width: 330px;
    margin: auto;
}


.search-row input {
    border-radius: 4px 0 0 4px;
}


.search-row button {
    border-radius: 0 4px 4px 0;
}


.panel .search-row {
    max-width: 560px;
}


/* ============================================================
   TABLAS
   ============================================================ */

.table-wrap {
    overflow: auto;
    margin-top: 16px;
}


table {
    border-collapse: collapse;
    width: 100%;
    text-align: center;
}


th,
td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--border);
}


tbody tr:nth-child(odd) {
    background: #f2f2f2;
}


.link {
    background: none;
    color: #008e98;
    padding: 0;
}


/* ============================================================
   MENSAJES
   ============================================================ */

.error {
    color: #b00020;
}


.success {
    background: #e8f7ed;
    padding: 12px;
    border-radius: 4px;
}


.hint {
    color: #667085;
    font-size: 14px;
    line-height: 1.5;
}


.center {
    text-align: center;
}


.left {
    text-align: left;
    min-width: 280px;
}


/* ============================================================
   MODAL PRODUCTO
   ============================================================ */

dialog {
    width: min(800px, 94vw);
    border: 0;
    border-radius: 5px;
    padding: 0;
    box-shadow: 0 15px 60px #0008;
}


dialog::backdrop {
    background: #0007;
}


.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
}


.modal-head h2 {
    margin: 0;
    font-size: 20px;
}


.close {
    background: none;
    color: #777;
    font-size: 28px;
    padding: 0;
}


/* ============================================================
   DETALLE PRODUCTO
   ============================================================ */

/*
    ESTRUCTURA:

    ┌────────────────────┐  ┌────────────────────┐
    │                    │  │ DATOS PRODUCTO     │
    │       IMAGEN       │  │                    │
    │                    │  │ DIMENSIONES        │
    ├────────────────────┤  │                    │
    │ -  100%  +  RESET  │  │                    │
    └────────────────────┘  └────────────────────┘
*/

.wb-product-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
    gap: 25px;

    width: 100%;

    padding: 16px 30px;

    align-items: stretch;

    box-sizing: border-box;
}


/* ============================================================
   COLUMNA IZQUIERDA
   ============================================================ */

.wb-image-column {
    display: grid;

    /*
        FILA 1 = imagen
        FILA 2 = controles
    */

    grid-template-rows: minmax(0, 1fr) 55px;

    width: 100%;
    min-width: 0;

    /*
        Misma altura aproximada que
        la información derecha.
    */

    height: 575px;

    margin: 0;
    padding: 0;

    background: #fff;

    box-sizing: border-box;
}


/* ============================================================
   VISOR DE IMAGEN
   ============================================================ */

.wb-image-viewer {
    position: relative;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    min-width: 0;
    min-height: 0;

    margin: 0;
    padding: 0;

    overflow: hidden;

    background: #fff;

    box-sizing: border-box;
}


/* ============================================================
   IMAGEN PRODUCTO
   ============================================================ */

.wb-image-viewer > img {
    display: block;

    width: auto;
    height: auto;

    max-width: 92%;
    max-height: 92%;

    margin: auto;

    object-fit: contain;

    user-select: none;
    -webkit-user-drag: none;

    transform-origin: center center;

    transition: transform 0.10s ease-out;
}


/* ============================================================
   BARRA DE ZOOM
   ============================================================ */

/*
    Esta barra pertenece exclusivamente
    a la columna de la imagen.

    Resultado:

    [ - ] [ 100% ] [ + ] [ Restablecer ]
*/

.wb-zoom-bar {
    display: grid !important;

    grid-template-columns:
        38px
        90px
        38px
        110px !important;

    grid-template-rows: 36px !important;

    justify-content: center !important;
    align-content: center !important;
    align-items: center !important;

    column-gap: 8px !important;

    width: 100% !important;
    height: 55px !important;

    min-width: 0 !important;

    margin: 0 !important;
    padding: 8px 0 !important;

    position: static !important;

    float: none !important;
    clear: both !important;

    background: #fff !important;

    box-sizing: border-box !important;
}


/* ============================================================
   BOTONES - Y +
   ============================================================ */

.wb-zoom-button {
    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;

    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;

    margin: 0 !important;
    padding: 0 !important;

    position: static !important;
    float: none !important;

    border: 1px solid var(--red) !important;
    border-radius: 4px !important;

    background: var(--red) !important;
    color: #fff !important;

    font-size: 20px !important;
    font-weight: bold !important;

    line-height: 1 !important;

    cursor: pointer !important;

    box-sizing: border-box !important;
}


.wb-zoom-button:hover {
    background: #bd111e !important;
}


/* ============================================================
   PORCENTAJE DE ZOOM
   ============================================================ */

.wb-zoom-percent {
    display: block !important;

    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;

    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;

    margin: 0 !important;

    padding: 0 8px !important;

    position: static !important;
    float: none !important;

    border: 1px solid #cbd3da !important;
    border-radius: 4px !important;

    background: #fff !important;
    color: var(--text) !important;

    font-size: 14px !important;

    cursor: pointer !important;

    box-sizing: border-box !important;
}


/* ============================================================
   BOTÓN RESTABLECER
   ============================================================ */

.wb-zoom-reset {
    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;

    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;

    margin: 0 !important;

    padding: 0 10px !important;

    position: static !important;
    float: none !important;

    border: 1px solid var(--red) !important;
    border-radius: 4px !important;

    background: var(--red) !important;
    color: #fff !important;

    font-size: 14px !important;
    font-weight: normal !important;

    line-height: 1 !important;

    white-space: nowrap !important;

    cursor: pointer !important;

    box-sizing: border-box !important;
}


.wb-zoom-reset:hover {
    background: #bd111e !important;
}


/* ============================================================
   COLUMNA DERECHA
   ============================================================ */

.wb-product-info {
    width: 100%;
    min-width: 0;

    box-sizing: border-box;
}


/* ============================================================
   DATOS DEL PRODUCTO
   ============================================================ */

.facts {
    margin: 0 0 15px;

    border-top: 3px solid var(--border);
}


.facts div {
    display: grid;

    grid-template-columns: 145px 1fr;

    background: #f1f1f1;

    border-bottom: 1px solid var(--border);

    padding: 14px;
}


.facts dt {
    font-weight: bold;

    text-align: right;

    padding-right: 15px;
}


.facts dd {
    margin: 0;
}


.facts .title {
    display: block;

    text-align: center;
}


/* ============================================================
   APLICACIONES PRINCIPALES
   ============================================================ */

.applications {
    display: block;

    width: 100%;

    clear: both;

    padding: 0 30px 24px;

    margin-top: 15px;
}


.applications h2 {
    margin-bottom: 8px;
}


.applications p {
    line-height: 1.6;
}


/* ============================================================
   LOGIN
   ============================================================ */

.login-page {
    min-height: 100vh;

    display: grid;

    place-items: center;

    background: #f4f5f7;
}


.login-card {
    width: min(380px, 92vw);

    max-width: 380px;

    margin: 8vh auto;

    padding: 30px;

    background: #fff;

    border: 1px solid #ddd;

    border-radius: 8px;

    box-shadow: 0 8px 28px #0001;

    text-align: center;
}


.login-card img {
    display: block;

    width: 180px;

    max-width: 180px;

    margin: auto;
}


.login-card label {
    text-align: left;
}


.login-card form {
    display: grid;

    gap: 14px;
}


.login-card button {
    width: 100%;

    margin-bottom: 15px;
}


/* ============================================================
   ADMINISTRACIÓN
   ============================================================ */

.adminbar {
    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 15px 25px;

    background: #222;

    color: #fff;
}


.adminbar nav {
    display: flex;

    align-items: center;

    gap: 15px;
}


.adminbar a {
    color: #fff;

    text-decoration: none;
}


.adminbar form {
    margin: 0;
}


.adminbar button {
    padding: 7px 10px;
}


.admin-main {
    max-width: 1100px;

    margin: auto;

    padding: 30px;
}


.cards {
    display: flex;

    gap: 20px;
}


.card {
    display: flex;

    flex-direction: column;

    gap: 8px;

    padding: 24px;

    border: 1px solid var(--border);

    border-radius: 6px;

    text-decoration: none;

    color: inherit;
}


/* ============================================================
   FORMULARIO ADMIN
   ============================================================ */

.form-grid {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px 24px;
}


.form-grid label {
    text-align: left;
}


.form-grid .wide {
    grid-column: 1 / -1;
}


.check {
    flex-direction: row;

    align-items: center;
}


.check input {
    width: auto;
}


.admin-form {
    max-width: 760px;

    margin: 20px auto;

    display: grid;

    gap: 14px;
}


.admin-form textarea {
    width: 100%;

    box-sizing: border-box;

    border: 1px solid #bbb;

    border-radius: 4px;

    padding: 10px;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 650px) {

    .grid.two,
    .form-grid {
        grid-template-columns: 1fr;
    }


    .tabs {
        overflow: auto;
    }


    .tab {
        white-space: nowrap;

        padding: 11px;
    }


    .facts div {
        grid-template-columns: 1fr 1fr;
    }


    .adminbar {
        align-items: flex-start;

        gap: 15px;
    }


    .adminbar nav {
        flex-wrap: wrap;
    }


    .form-grid .wide {
        grid-column: auto;
    }


    /* ========================================================
       PRODUCTO EN CELULAR
       ======================================================== */

    .wb-product-grid {
        grid-template-columns: 1fr;

        gap: 20px;

        padding: 15px;
    }


    .wb-image-column {
        height: 430px;
    }


    .wb-zoom-bar {
        grid-template-columns:
            36px
            78px
            36px
            96px !important;

        column-gap: 5px !important;
    }


    .wb-zoom-button {
        width: 36px !important;

        min-width: 36px !important;

        max-width: 36px !important;
    }


    .wb-zoom-percent {
        width: 78px !important;

        min-width: 78px !important;

        max-width: 78px !important;
    }


    .wb-zoom-reset {
        width: 96px !important;

        min-width: 96px !important;

        max-width: 96px !important;

        padding: 0 5px !important;

        font-size: 13px !important;
    }


    .applications {
        padding: 0 15px 24px;
    }
}