/* =========================================================
   IPERHOST
   LISTADO DE PEDIDOS
   ========================================================= */


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

.page__text:has(.woocommerce-orders-table) {
    width: 100%;
    max-width: 1240px;

    margin: 0 auto;
    padding: 48px 32px 64px;

    box-sizing: border-box;
}


.page__text:has(.woocommerce-orders-table)
.woocommerce > div > .hp-row {
    align-items: flex-start;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.page__text:has(.woocommerce-orders-table)
.hp-page__sidebar {
    padding-right: 32px;
}


/* =========================================================
   CONTENIDO PRINCIPAL
   ========================================================= */

.page__text:has(.woocommerce-orders-table)
.hp-page__content {
    padding: 30px;

    border: 1px solid #e3e9ec;
    border-radius: 16px;

    background: #ffffff;

    box-shadow:
        0 6px 24px rgba(var(--iperhost-navy-rgb), 0.06);
}


/* =========================================================
   TÍTULO
   ========================================================= */

.page__text:has(.woocommerce-orders-table)
.hp-page__title {
    margin: 0 0 28px;

    color: var(--iperhost-navy-dark);

    font-size: 32px;
    line-height: 1.2;
    font-weight: 700;
}


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

.page__text:has(.woocommerce-orders-table)
.woocommerce-orders-table {
    width: 100%;

    margin: 0;

    border-collapse: separate;
    border-spacing: 0;

    overflow: hidden;

    border: 1px solid #e3e9ec;
    border-radius: 14px;

    background: #ffffff;
}


/* =========================================================
   HEADER
   ========================================================= */

.page__text:has(.woocommerce-orders-table)
.woocommerce-orders-table thead {
    background: #f6f9fa;
}


.page__text:has(.woocommerce-orders-table)
.woocommerce-orders-table thead th {
    padding: 16px 18px;

    border: 0;
    border-bottom: 1px solid #e2e8ea;

    color: #607078;

    font-size: 12px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.03em;

    text-align: left;
}


/* =========================================================
   FILAS
   ========================================================= */

.page__text:has(.woocommerce-orders-table)
.woocommerce-orders-table tbody tr {
    background: #ffffff;

    transition:
        background 0.2s ease,
        box-shadow 0.2s ease;
}


.page__text:has(.woocommerce-orders-table)
.woocommerce-orders-table tbody tr:hover {
    background: var(--iperhost-cream);
}


/* =========================================================
   CELDAS
   ========================================================= */

.page__text:has(.woocommerce-orders-table)
.woocommerce-orders-table tbody th,
.page__text:has(.woocommerce-orders-table)
.woocommerce-orders-table tbody td {
    padding: 19px 18px;

    border: 0;
    border-bottom: 1px solid #edf1f3;

    color: #526168;

    font-size: 14px;

    vertical-align: middle;
}


.page__text:has(.woocommerce-orders-table)
.woocommerce-orders-table tbody tr:last-child th,
.page__text:has(.woocommerce-orders-table)
.woocommerce-orders-table tbody tr:last-child td {
    border-bottom: 0;
}


/* =========================================================
   NÚMERO DE PEDIDO
   ========================================================= */

.page__text:has(.woocommerce-orders-table)
.woocommerce-orders-table__cell-order-number a {
    color: var(--iperhost-navy);

    font-size: 15px;
    font-weight: 700;

    text-decoration: none;
}


.page__text:has(.woocommerce-orders-table)
.woocommerce-orders-table__cell-order-number a:hover {
    text-decoration: underline;
}


/* =========================================================
   FECHA
   ========================================================= */

.page__text:has(.woocommerce-orders-table)
.woocommerce-orders-table__cell-order-date {
    color: #748187;
}


.page__text:has(.woocommerce-orders-table)
.woocommerce-orders-table__cell-order-date time {
    white-space: nowrap;
}


/* =========================================================
   ESTADOS
   ========================================================= */

.page__text:has(.woocommerce-orders-table)
.hp-order__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: auto;

    padding: 7px 11px;

    border-radius: 999px;

    font-size: 12px;
    line-height: 1;
    font-weight: 700;
}


/* Procesando */

.page__text:has(.woocommerce-orders-table)
.hp-status--wc-processing {
    background: #fff4d8;
    color: #926600;
}


/* En espera */

.page__text:has(.woocommerce-orders-table)
.hp-status--wc-on-hold {
    background: #eef1f8;
    color: #56678e;
}


/* Completado */

.page__text:has(.woocommerce-orders-table)
.hp-status--wc-completed {
    background: #e9f6ee;
    color: #34734a;
}


/* Pendiente */

.page__text:has(.woocommerce-orders-table)
.hp-status--wc-pending {
    background: #fff5dc;
    color: #8b6808;
}


/* Cancelado */

.page__text:has(.woocommerce-orders-table)
.hp-status--wc-cancelled {
    background: #fdecec;
    color: #b33c3c;
}


/* Fallido */

.page__text:has(.woocommerce-orders-table)
.hp-status--wc-failed {
    background: #fdecec;
    color: #a92f2f;
}


/* Reembolsado */

.page__text:has(.woocommerce-orders-table)
.hp-status--wc-refunded {
    background: #edf1f3;
    color: #647279;
}


/* =========================================================
   TOTAL
   ========================================================= */

.page__text:has(.woocommerce-orders-table)
.woocommerce-orders-table__cell-order-total {
    color: #7a878c;

    font-size: 12px;
}


.page__text:has(.woocommerce-orders-table)
.woocommerce-orders-table__cell-order-total
.woocommerce-Price-amount {
    color: var(--iperhost-navy-dark);

    font-size: 15px;
    font-weight: 700;
}


/* =========================================================
   BOTÓN VER
   ========================================================= */

.page__text:has(.woocommerce-orders-table)
.woocommerce-orders-table__cell-order-actions
.button.view {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 38px;

    padding: 0 16px;

    border: 1px solid var(--iperhost-navy);
    border-radius: 9px;

    background: transparent;

    color: var(--iperhost-navy);

    font-size: 13px;
    font-weight: 700;

    text-decoration: none;

    box-shadow: none !important;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}


.page__text:has(.woocommerce-orders-table)
.woocommerce-orders-table__cell-order-actions
.button.view:hover {
    background: var(--iperhost-navy);

    color: #ffffff;

    transform: translateY(-1px);
}


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

@media (max-width: 1024px) {

    .page__text:has(.woocommerce-orders-table) {
        padding: 38px 28px 54px;
    }


    .page__text:has(.woocommerce-orders-table)
    .hp-page__sidebar {
        padding-right: 22px;
    }


    .page__text:has(.woocommerce-orders-table)
    .hp-page__content {
        padding: 24px;
    }


    .page__text:has(.woocommerce-orders-table)
    .hp-page__title {
        font-size: 29px;
    }


    .page__text:has(.woocommerce-orders-table)
    .woocommerce-orders-table thead th,
    .page__text:has(.woocommerce-orders-table)
    .woocommerce-orders-table tbody th,
    .page__text:has(.woocommerce-orders-table)
    .woocommerce-orders-table tbody td {
        padding-left: 13px;
        padding-right: 13px;
    }

}


/* =========================================================
   MÓVIL
   WooCommerce convierte la tabla en cards
   ========================================================= */

@media (max-width: 767px) {

    .page__text:has(.woocommerce-orders-table) {
        padding: 24px 18px 42px;
    }


    .page__text:has(.woocommerce-orders-table)
    .woocommerce > div > .hp-row {
        display: flex;
        flex-direction: column;
    }


    /* Sidebar */

    .page__text:has(.woocommerce-orders-table)
    .hp-page__sidebar {
        width: 100%;

        padding-right: 0;

        margin-bottom: 24px;
    }


    /* Contenido */

    .page__text:has(.woocommerce-orders-table)
    .hp-page__content {
        width: 100%;

        padding: 20px 16px;
    }


    .page__text:has(.woocommerce-orders-table)
    .hp-page__title {
        font-size: 26px;
    }


    /* WooCommerce responsive */

    .page__text:has(.woocommerce-orders-table)
    .woocommerce-orders-table {
        border: 0;

        background: transparent;
    }


    .page__text:has(.woocommerce-orders-table)
    .woocommerce-orders-table thead {
        display: none;
    }


    /* Cada pedido se convierte en card */

    .page__text:has(.woocommerce-orders-table)
    .woocommerce-orders-table tbody tr {
        display: block;

        margin-bottom: 16px;

        overflow: hidden;

        border: 1px solid #e2e8ea;
        border-radius: 13px;

        background: #ffffff;

        box-shadow:
            0 4px 15px rgba(var(--iperhost-navy-rgb), 0.05);
    }


    .page__text:has(.woocommerce-orders-table)
    .woocommerce-orders-table tbody th,
    .page__text:has(.woocommerce-orders-table)
    .woocommerce-orders-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;

        gap: 16px;

        width: 100%;

        padding: 13px 15px;

        box-sizing: border-box;

        text-align: right;

        border-bottom: 1px solid #edf1f3;
    }


    /* Labels generados por data-title */

    .page__text:has(.woocommerce-orders-table)
    .woocommerce-orders-table tbody td::before,
    .page__text:has(.woocommerce-orders-table)
    .woocommerce-orders-table tbody th::before {
        content: attr(data-title);

        color: #748187;

        font-size: 12px;
        font-weight: 600;

        text-align: left;
    }


    /* Número */

    .page__text:has(.woocommerce-orders-table)
    .woocommerce-orders-table__cell-order-number {
        background: #f7fafb;
    }


    /* Última celda */

    .page__text:has(.woocommerce-orders-table)
    .woocommerce-orders-table tbody tr > *:last-child {
        border-bottom: 0;
    }


    /* Botón Ver */

    .page__text:has(.woocommerce-orders-table)
    .woocommerce-orders-table__cell-order-actions
    .button.view {
        min-width: 90px;
    }

}