/* =========================================
   ADMIN - PRODUCTOS
========================================= */

.admin-products-container {
    max-width: 1250px;
    margin: 45px auto 80px;
    padding: 0 25px;
}


/* =========================================
   ENCABEZADO
========================================= */

.admin-page-header {
    margin-bottom: 30px;
}

.admin-page-header span {
    display: block;

    margin-bottom: 6px;

    color: #048ABF;

    font-size: .75rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.admin-page-header h1 {
    margin: 0;

    color: #004A91;

    font-size: 2rem;
    font-weight: 700;
}

.admin-page-header p {
    margin: 7px 0 0;

    color: #777;
}


/* =========================================
   BUSCADOR
========================================= */

.admin-search-card {
    background-color: #fff;

    padding: 25px;

    border-radius: 16px;

    margin-bottom: 25px;

    border: 1px solid #eeeeee;

    box-shadow: 0 7px 22px rgba(0, 0, 0, .07);
}

.admin-search-header {
    display: flex;
    align-items: center;

    gap: 13px;

    margin-bottom: 22px;
}

.admin-search-icon {
    width: 42px;
    height: 42px;

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

    border-radius: 10px;

    background-color: #eaf7fb;

    color: #048ABF;

    font-size: 1.1rem;
}

.admin-search-header h3 {
    margin: 0;

    color: #222;

    font-size: 1.05rem;
}

.admin-search-header p {
    margin: 3px 0 0;

    color: #777;

    font-size: .85rem;
}


/* =========================================
   FORMULARIO BUSCADOR
========================================= */

.admin-search-form {
    display: grid;

    grid-template-columns: 1fr 1fr auto;

    align-items: end;

    gap: 18px;
}

.search-field label {
    display: block;

    margin-bottom: 7px;

    color: #444;

    font-size: .85rem;
    font-weight: 600;
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;

    left: 13px;
    top: 50%;

    transform: translateY(-50%);

    color: #999;

    pointer-events: none;
}

.input-icon input,
.input-icon select {
    width: 100%;

    height: 44px;

    padding: 8px 12px 8px 38px;

    border: 1px solid #ddd;

    border-radius: 8px;

    background-color: #fff;

    color: #333;

    outline: none;

    transition: border-color .2s, box-shadow .2s;
}

.input-icon input:focus,
.input-icon select:focus {
    border-color: #048ABF;

    box-shadow: 0 0 0 3px rgba(4, 138, 191, .10);
}


/* =========================================
   BOTONES BUSCADOR
========================================= */

.search-actions {
    display: flex;
    gap: 8px;
}

.admin-search-button,
.admin-clear-button {
    height: 44px;

    padding: 0 20px;

    border-radius: 8px;

    display: inline-flex;

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

    gap: 7px;

    text-decoration: none;

    font-size: .9rem;
    font-weight: 600;

    transition: .2s ease;
}

.admin-search-button {
    border: none;

    background-color: #048ABF;

    color: #fff;

    cursor: pointer;
}

.admin-search-button:hover {
    background-color: #004A91;

    transform: translateY(-1px);
}

.admin-clear-button {
    background-color: #f2f5f7;

    color: #555;

    border: 1px solid #e2e5e7;
}

.admin-clear-button:hover {
    background-color: #e7ecef;

    color: #004A91;
}


/* =========================================
   RESULTADOS
========================================= */

.search-result-info {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 15px 18px;

    margin-bottom: 20px;

    border-radius: 10px;

    background-color: #f1f8fb;

    color: #555;
}

.search-result-info > i {
    color: #048ABF;

    font-size: 1.2rem;
}

.search-result-info div {
    display: flex;
    flex-direction: column;

    gap: 2px;
}

.search-result-info strong {
    color: #004A91;
}

.search-result-info span {
    font-size: .85rem;
}


/* =========================================
   TARJETA TABLA
========================================= */

.admin-products-card {
    background-color: #fff;

    border-radius: 16px;

    border: 1px solid #eeeeee;

    box-shadow: 0 7px 22px rgba(0, 0, 0, .07);

    overflow: hidden;
}

.products-table-header {
    padding: 23px 25px;

    border-bottom: 1px solid #eeeeee;
}

.products-table-header h2 {
    margin: 0;

    color: #222;

    font-size: 1.15rem;
    font-weight: 600;
}

.products-table-header p {
    margin: 4px 0 0;

    color: #888;

    font-size: .8rem;
}


/* =========================================
   TABLA
========================================= */

.products-table-wrapper {
    width: 100%;

    overflow-x: auto;
}

.admin-products-table {
    width: 100%;

    border-collapse: collapse;

    margin: 0;
}

.admin-products-table thead {
    background-color: #f7f9fa;
}

.admin-products-table th {
    padding: 15px 20px;

    color: #666;

    font-size: .75rem;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: .4px;

    white-space: nowrap;

    border-bottom: 1px solid #e9ecef;
}

.admin-products-table td {
    padding: 17px 20px;

    color: #444;

    vertical-align: middle;

    border-bottom: 1px solid #eeeeee;
}

.admin-products-table tbody tr {
    transition: background-color .2s ease;
}

.admin-products-table tbody tr:hover {
    background-color: #fafcfd;
}

.admin-products-table tbody tr:last-child td {
    border-bottom: none;
}


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

.product-name {
    display: flex;
    align-items: center;

    gap: 12px;

    min-width: 220px;
}

.product-table-icon {
    width: 38px;
    height: 38px;

    flex-shrink: 0;

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

    border-radius: 9px;

    background-color: #eaf7fb;

    color: #048ABF;
}

.product-name strong {
    color: #222;

    font-size: .9rem;
}


/* =========================================
   CÓDIGO
========================================= */

.product-code {
    font-family: monospace;

    padding: 5px 8px;

    border-radius: 6px;

    background-color: #f4f5f6;

    color: #555;

    font-size: .8rem;
}

.no-data {
    color: #999;

    font-size: .8rem;
}


/* =========================================
   PRECIO
========================================= */

.product-price {
    color: #004A91;

    white-space: nowrap;
}


/* =========================================
   CATEGORÍA
========================================= */

.category-badge {
    display: inline-block;

    padding: 5px 10px;

    border-radius: 20px;

    background-color: #eef7fa;

    color: #048ABF;

    font-size: .75rem;

    font-weight: 600;

    white-space: nowrap;
}


/* =========================================
   ESTADO
========================================= */

.status-badge {
    display: inline-flex;

    align-items: center;

    gap: 5px;

    padding: 5px 10px;

    border-radius: 20px;

    font-size: .75rem;

    font-weight: 600;

    white-space: nowrap;
}

.status-badge.active {
    background-color: #eaf8ef;

    color: #198754;
}

.status-badge.inactive {
    background-color: #fceeee;

    color: #dc3545;
}


/* =========================================
   ACCIONES
========================================= */

.actions-column {
    text-align: center;
}

.product-actions {
    display: flex;

    justify-content: center;

    gap: 7px;
}

.action-button {
    width: 35px;
    height: 35px;

    display: inline-flex;

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

    border-radius: 8px;

    text-decoration: none;

    transition: .2s ease;
}

.action-button.view {
    background-color: #eef7fa;

    color: #048ABF;
}

.action-button.edit {
    background-color: #fff6df;

    color: #c58a00;
}

.action-button.delete {
    background-color: #fceeee;

    color: #dc3545;
}

.action-button:hover {
    transform: translateY(-2px);
    filter: brightness(.95);
}


/* =========================================
   PAGINACIÓN
========================================= */

.admin-pagination {
    padding: 20px 25px;

    border-top: 1px solid #eeeeee;
}

.admin-pagination nav {
    display: flex;

    justify-content: center;
}


/* =========================================
   SIN PRODUCTOS
========================================= */

.empty-products {
    text-align: center;

    padding: 70px 20px;
}

.empty-products-icon {
    width: 70px;
    height: 70px;

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

    margin: 0 auto 20px;

    border-radius: 50%;

    background-color: #eef7fa;

    color: #048ABF;

    font-size: 1.8rem;
}

.empty-products h3 {
    margin-bottom: 8px;

    color: #333;

    font-size: 1.15rem;
}

.empty-products p {
    margin-bottom: 20px;

    color: #777;

    font-size: .9rem;
}


/* =========================================
   TABLET
========================================= */

@media (max-width: 991px) {

    .admin-products-container {
        margin-top: 30px;
    }

    .admin-search-form {
        grid-template-columns: 1fr 1fr;
    }

    .search-actions {
        grid-column: 1 / -1;

        justify-content: flex-start;
    }

}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 767px) {

    .admin-products-container {
        margin-top: 25px;

        padding: 0 15px;
    }

    .admin-page-header h1 {
        font-size: 1.7rem;
    }

    .admin-search-card {
        padding: 20px;
    }

    .admin-search-form {
        grid-template-columns: 1fr;

        gap: 15px;
    }

    .search-actions {
        grid-column: auto;

        width: 100%;
    }

    .admin-search-button {
        flex: 1;
    }

    .admin-clear-button {
        padding-left: 18px;
        padding-right: 18px;
    }

    .products-table-header {
        padding: 20px;
    }

    /*
       La tabla mantiene su estructura
       y permite desplazamiento horizontal.
    */

    .products-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-products-table {
        min-width: 850px;
    }

    .admin-products-table th,
    .admin-products-table td {
        padding: 14px 15px;
    }

    .admin-pagination {
        padding: 18px 15px;
    }

}


/* =========================================
   MOBILE PEQUEÑO
========================================= */

@media (max-width: 480px) {

    .admin-products-container {
        padding: 0 12px;
    }

    .admin-page-header {
        margin-bottom: 22px;
    }

    .admin-page-header h1 {
        font-size: 1.5rem;
    }

    .admin-search-header {
        align-items: flex-start;
    }

    .search-result-info {
        align-items: flex-start;
    }

    .empty-products {
        padding: 55px 15px;
    }

}
