/*
|--------------------------------------------------------------------------
| MÓDULO TIENDA
|--------------------------------------------------------------------------
*/

.am-tienda-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 22px;
}

.am-tienda-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 15px;
    border: 1px solid #d8e1e8;
    border-radius: 10px;
    background: #ffffff;
    color: #091330;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: 0.2s;
}

.am-tienda-nav-link:hover {
    border-color: #0c9aaa;
    color: #0c9aaa;
}

.am-tienda-nav-link.activa {
    border-color: #0c9aaa;
    background: #0c9aaa;
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(12, 154, 170, 0.22);
}

/*
|--------------------------------------------------------------------------
| AVISOS
|--------------------------------------------------------------------------
*/

.am-tienda-aviso {
    margin: 0 0 20px;
    padding: 13px 16px;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    background: #f0fdf4;
    color: #166534;
    font-weight: 600;
}

.am-tienda-aviso-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

/*
|--------------------------------------------------------------------------
| CABECERA Y BOTONES
|--------------------------------------------------------------------------
*/

.am-tienda-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 20px;
}

.am-tienda-cabecera h2,
.am-tienda-panel h2 {
    margin: 0 0 7px;
    color: #091330;
    font-size: 21px;
}

.am-tienda-cabecera p,
.am-tienda-panel > p {
    margin: 0;
    color: #687786;
}

.am-tienda-boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 7px 13px;
    border: 1px solid #ccd7df;
    border-radius: 9px;
    background: #ffffff;
    color: #091330;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s;
}

.am-tienda-boton:hover:not(:disabled) {
    border-color: #0c9aaa;
    color: #0c9aaa;
}

.am-tienda-boton:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.am-tienda-boton-principal {
    border-color: #0c9aaa;
    background: #0c9aaa;
    color: #ffffff;
}

.am-tienda-boton-principal:hover:not(:disabled) {
    background: #087f8d;
    color: #ffffff;
}

.am-tienda-boton-peligro {
    border-color: #fecaca;
    background: #fff5f5;
    color: #b91c1c;
}

/*
|--------------------------------------------------------------------------
| PANELES Y FORMULARIOS
|--------------------------------------------------------------------------
*/

.am-tienda-panel {
    padding: 22px;
    border: 1px solid #e3e9ee;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 5px 18px rgba(9, 19, 48, 0.06);
}

.am-tienda-dos-columnas {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(380px, 1.2fr);
    gap: 20px;
    align-items: start;
}

.am-tienda-campo {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 20px 0 15px;
}

.am-tienda-campo span {
    color: #263345;
    font-size: 14px;
    font-weight: 700;
}

.am-tienda-campo input,
.am-tienda-campo select,
.am-tienda-campo textarea {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #ccd7df;
    border-radius: 9px;
    background: #ffffff;
    color: #091330;
    font-family: inherit;
    font-size: 15px;
    outline: none;
}

.am-tienda-campo textarea {
    min-height: 110px;
    resize: vertical;
}

.am-tienda-campo input:focus,
.am-tienda-campo select:focus,
.am-tienda-campo textarea:focus {
    border-color: #0c9aaa;
    box-shadow: 0 0 0 3px rgba(12, 154, 170, 0.12);
}

.am-tienda-ayuda {
    margin: -5px 0 16px;
    color: #7b8794;
    font-size: 13px;
}

/*
|--------------------------------------------------------------------------
| LISTAS DE MARCAS, CATEGORÍAS Y PAPELERA
|--------------------------------------------------------------------------
*/

.am-tienda-lista {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 18px;
}

.am-tienda-lista-fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid #e5ebef;
    border-radius: 11px;
    background: #f9fbfc;
}

.am-tienda-lista-fila > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.am-tienda-lista-fila strong {
    color: #091330;
}

.am-tienda-lista-fila span {
    color: #748291;
    font-size: 13px;
}

.am-tienda-lista-acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/*
|--------------------------------------------------------------------------
| CATÁLOGO DE PRODUCTOS
|--------------------------------------------------------------------------
*/

.am-tienda-productos-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.am-tienda-producto {
    overflow: hidden;
    border: 1px solid #e0e7ec;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(9, 19, 48, 0.06);
    transition: 0.2s;
}

.am-tienda-producto:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 22px rgba(9, 19, 48, 0.11);
}

.am-tienda-producto.agotado {
    opacity: 0.74;
}

.am-tienda-producto-imagen {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #eef3f6;
    color: #7c8995;
    font-size: 13px;
}

.am-tienda-producto-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.am-tienda-etiqueta-agotado {
    position: absolute;
    top: 9px;
    right: 9px;
    padding: 5px 7px;
    border-radius: 7px;
    background: #991b1b;
    color: #ffffff;
    font-size: 10px;
    letter-spacing: 0.4px;
}

.am-tienda-producto-datos {
    padding: 13px;
}

.am-tienda-producto-datos h3 {
    margin: 0 0 5px;
    color: #091330;
    font-size: 16px;
    line-height: 1.25;
}

.am-tienda-producto-datos p {
    margin: 5px 0;
    color: #4f5d6c;
    font-size: 13px;
}

.am-tienda-producto-marca {
    color: #0c9aaa !important;
    font-weight: 700;
}

.am-tienda-producto-acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

/*
|--------------------------------------------------------------------------
| ESTADOS VACÍOS Y FUNCIONES PENDIENTES
|--------------------------------------------------------------------------
*/

.am-tienda-vacio {
    padding: 42px 24px;
    border: 2px dashed #ccd7df;
    border-radius: 16px;
    background: #ffffff;
    text-align: center;
}

.am-tienda-vacio h3 {
    margin: 0 0 8px;
    color: #091330;
}

.am-tienda-vacio p {
    max-width: 570px;
    margin: 0 auto 18px;
    color: #697786;
}

.am-tienda-vacio-acciones {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
}

.am-tienda-pendiente {
    margin-top: 20px;
    padding: 22px;
    border: 2px dashed #b9c9d4;
    border-radius: 13px;
    background: #f6f9fb;
    color: #687786;
    text-align: center;
}

/*
|--------------------------------------------------------------------------
| RESPONSIVE
|--------------------------------------------------------------------------
*/

@media (max-width: 1350px) {
    .am-tienda-productos-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1000px) {
    .am-tienda-productos-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .am-tienda-dos-columnas {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .am-tienda-cabecera {
        align-items: stretch;
        flex-direction: column;
    }

    .am-tienda-cabecera .am-tienda-boton {
        width: 100%;
    }

    .am-tienda-productos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .am-tienda-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 6px;
    }

    .am-tienda-nav-link {
        flex: 0 0 auto;
        min-height: 44px;
    }
}

@media (max-width: 390px) {
    .am-tienda-productos-grid {
        grid-template-columns: 1fr;
    }

    .am-tienda-panel {
        padding: 16px;
    }

    .am-tienda-lista-fila {
        align-items: stretch;
        flex-direction: column;
    }

    .am-tienda-lista-acciones .am-tienda-boton {
        width: 100%;
    }
}

.am-tienda-form-producto {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.am-tienda-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
}

.am-tienda-categorias-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 18px 0;
}

.am-tienda-categoria-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    border: 1px solid #d8e1e8;
    border-radius: 9px;
    background: #f9fbfc;
    cursor: pointer;
}

.am-tienda-categoria-check input {
    width: 17px;
    height: 17px;
    margin: 0;
}

.am-tienda-imagenes-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    margin-top: 18px;
}

.am-tienda-imagen-selector {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.am-tienda-imagen-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px dashed #bdcbd5;
    border-radius: 12px;
    background: #f3f7f9;
    color: #778593;
}

.am-tienda-imagen-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.am-tienda-variantes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.am-tienda-variante-fila {
    display: grid;
    grid-template-columns: 42px minmax(180px, 1fr) 160px auto;
    gap: 12px;
    align-items: end;
    padding: 12px;
    border: 1px solid #e2e9ee;
    border-radius: 12px;
    background: #f9fbfc;
}

.am-tienda-variante-fila .am-tienda-campo {
    margin: 0;
}

.am-tienda-variante-numero {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-bottom: 5px;
    border-radius: 50%;
    background: #0c9aaa;
    color: #ffffff;
    font-weight: 700;
}

.am-tienda-form-acciones {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-bottom: 25px;
}

@media (max-width: 900px) {
    .am-tienda-form-grid {
        grid-template-columns: 1fr;
    }

    .am-tienda-variante-fila {
        grid-template-columns: 40px minmax(0, 1fr) 130px;
    }

    .am-tienda-variante-fila .am-tienda-boton-peligro {
        grid-column: 2 / 4;
    }
}

@media (max-width: 600px) {
    .am-tienda-imagenes-grid {
        grid-template-columns: 1fr;
    }

    .am-tienda-variante-fila {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .am-tienda-variante-fila .am-tienda-campo {
        grid-column: 2;
    }

    .am-tienda-variante-fila .am-tienda-boton-peligro {
        grid-column: 2;
        width: 100%;
    }

    .am-tienda-form-acciones {
        flex-direction: column-reverse;
    }

    .am-tienda-form-acciones .am-tienda-boton {
        width: 100%;
    }
}

/*
|--------------------------------------------------------------------------
| FORMULARIO DE PRODUCTO
|--------------------------------------------------------------------------
*/

.am-tienda-categorias-selector {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 18px 0;
}

.am-tienda-categoria-opcion {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 43px;
    padding: 9px 12px;
    border: 1px solid #dce5eb;
    border-radius: 10px;
    background: #f9fbfc;
    cursor: pointer;
}

.am-tienda-categoria-opcion input {
    width: 18px;
    height: 18px;
}

.am-tienda-imagenes-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.am-tienda-imagen-campo {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 155px;
    padding: 16px;
    border: 2px dashed #c7d4dc;
    border-radius: 13px;
    background: #f9fbfc;
}

.am-tienda-imagen-campo input[type="file"] {
    width: 100%;
}

.am-tienda-variantes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.am-tienda-variante-fila {
    display: grid;
    grid-template-columns: 42px minmax(180px, 1fr) 150px auto;
    gap: 12px;
    align-items: end;
    padding: 12px;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    background: #f9fbfc;
}

.am-tienda-variante-fila .am-tienda-campo {
    margin: 0;
}

.am-tienda-variante-numero {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-bottom: 5px;
    border-radius: 50%;
    background: #0c9aaa;
    color: #ffffff;
    font-weight: 700;
}

.am-tienda-form-acciones {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

@media (max-width: 800px) {
    .am-tienda-imagenes-grid {
        grid-template-columns: 1fr;
    }

    .am-tienda-variante-fila {
        grid-template-columns: 38px 1fr;
    }

    .am-tienda-variante-fila .am-tienda-boton {
        grid-column: 1 / -1;
    }
}

@media (max-width: 500px) {
    .am-tienda-categorias-selector {
        grid-template-columns: 1fr;
    }

    .am-tienda-form-acciones {
        flex-direction: column-reverse;
    }

    .am-tienda-form-acciones .am-tienda-boton {
        width: 100%;
    }
}