.orders-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

h4.orders {
    margin: 0;
    font-size: 24px;
}

.orders-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 14px;
}

.orders-search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.orders-search-item {
    margin: 0 15px;
}

.orders-search-container input {
    height: 34px;
    padding: 5px 30px 5px 25px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.orders-search-icon {
    position: absolute;
    left: 6px;
    pointer-events: none;
    width: 16px;
    height: 16px;
    fill: #999;
    color: #999;
}

.orders-clear-btn {
    position: absolute;
    right: 6px;
    cursor: pointer;
    color: #999;
}

.orders-select-group {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.orders-select-group label {
    white-space: nowrap;
    font-size: 0.8rem;
}

span.orders-time-select {
    margin-right: 3px;
}

select.orders {
    height: 34px;
    padding: 5px;
    font-size: 14px;
    box-sizing: border-box;
}

table.orders {
    width: 100%;
    border-collapse: collapse;
    margin-top: 3rem;
}

th.orders, td.orders {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

th.orders {
    background-color: #f5f5f5;
}

th.orders-sortable {
    cursor: pointer;
    border-left: none;
    border-right: none;
    text-align: start;
    color: #7C8189;
    font-size: 14px;
    font-weight: 400;
    border-top: none;
}

th.orders-sort-asc::after {
    content: " ▲";
}

th.orders-sort-desc::after {
    content: " ▼";
}

th.orders-sort-none::after {
    content: "";
}

/**
 * Review order
 */
.orders-review-order {
    color: #404042;
}

.orders-review-order-items {
    max-width: none;
}

.orders-review-order-cart-items {
    max-height: 600px;
}

.orders-review-order-cart-item img {
    height: 75px;
    width: 75px;
}

.orders-review-order-cart-item p {
    color: #555
}

.orders-review-cart-item-price {
    font-size: 1rem;
}


.orders-review-last-order-content {
    display: flex;
    /* Mantener dos columnas en escritorio: no wrap */
    flex-wrap: nowrap;
    gap: 3rem;
    align-items: flex-start; /* evitar que el contenido estire y provoque wrap */
    height: 100%;
}

.orders-review-last-order-left {
    flex: 1 1 65%;
    order: 1; /* ensure left column stays first */
    min-width: 0; /* permitir que el flex item se encoja correctamente */
    overflow-y: auto;
    padding-right: 1rem;
}

.orders-review-last-order-right {
    /* Fijar ancho en escritorio para evitar que baje a una nueva fila */
    flex: 0 0 35%;
    order: 2; /* ensure right column stays second */
    min-width: 0; /* permitir que el flex item se encoja correctamente */
    max-width: 35%; /* asegurar que no ocupe más del 35% */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;

    background: #EDEFEE;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    color: #333;
}


@media (max-width: 768px) {
    .orders-review-last-order-right {
       width: 100%;
       max-width: 100%;
    }
}

.orders-review-cart-total {
    font-size: 1.2rem;
    font-weight: bold;
}
.orders-review-total-original span {
    font-size: 22px !important;
}
.orders-review-last-order-right span {
    font-size: 12px;
}
.orders-review-last-order-buttons {
    margin-top: 1rem;
}

.checkout-billing-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 12px;
    line-height: 10px;
    color: #5d4037;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.checkout-billing-warning a {
    color: #e65100;
    font-weight: 600;
    text-decoration: underline;
    display: inline;
}

.checkout-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.orders-review-shipping-address-section {
    width: 100%;
    border-radius: 10px;
    margin: 1rem auto;

    /* Center all children horizontally */
    display: flex;
    flex-direction: column;
    align-items: left;
    text-align: left;
}

.orders-review-address-select-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

/* Hide default select arrow */
.orders-review-address-select {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    padding: 0.75rem 2.0rem 0.75rem 1rem;;
    font-size: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Hover/focus styles */
.orders-review-address-select:hover {
    border-color: #888;
}

.orders-review-address-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

/* Custom arrow indicator */
.orders-review-address-select-wrapper::after {
    content: '▼';
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #555;
    pointer-events: none;
    transition: color 0.2s ease;
}

.orders-review-address-select:focus + .orders-review-address-select-wrapper::after {
    color: #0d6efd;
}

/* Centered "Add Address" button under the select */
.orders-review-add-address-button {
    display: block;
    margin: 0 auto;
    padding: 0.5rem 1.2rem;
    font-size: 0.8rem;
    background-color: transparent;
    color: #404042;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.orders-review-add-address-button:hover {
    color: #fff;
    background: #404042;
}

/* Estilos para el bloque de Código Promocional: ahora está dentro de la columna izquierda */
.orders-review-promo {
    display: flex;
    /* Colocar los inputs en una fila y el status debajo ocupando 100% */
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    width: 100%;
    margin-top: 1.25rem;
    box-sizing: border-box;
}

.orders-review-promo-label {
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    margin-right: 1rem;
}

.orders-review-promo-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 1 1 auto;
}

.orders-review-promo-input {
    flex: 1 1 auto;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.95rem;
}

.orders-review-promo-apply {
    /* Duplicado de las reglas de .tab-zone-data-button para asegurar estilo idéntico */
    text-decoration: none;
    color: #404042;
    border: solid 1px #727276;
    border-radius: 5px;
    font-size: 14px;
    line-height: 16px;
    font-weight: 600;
    display: inline-flex; /* igual que el display flex del botón original */
    align-items: center;
    padding: 11px 24px;
    transition: all 300ms ease-in-out;
    background: transparent; /* mantener fondo transparente por defecto */
    cursor: pointer;
}

.orders-review-promo-apply:hover {
    color: #fff;
    background: #404042;
}

.orders-review-promo-status {
    margin-top: 0;
    font-size: 0.95rem;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* dejar texto a la izquierda */
    position: relative; /* para posicionar el botón X */
    padding-right: 48px; /* espacio para el botón */
}

.orders-review-promo-remove {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #d0d0d0;
    color: #222;
    font-size: 14px;
    width: 34px;
    height: 34px;
    line-height: 1;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex; /* visible by default; server-side style controls hiding when needed */
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    z-index: 10;
}

.orders-review-promo-remove svg {
    width: 14px;
    height: 14px;
    display: block;
}

.orders-review-promo-remove:hover {
    background: #f5f5f5;
}

/* Visibility of the remove button is controlled server-side via inline style (rendered from Twig) */

.orders-review-promo-status--success {
    color: #0f5132;
    background: #d1e7dd;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

/* Ensure remove button is visible and contrasted inside success status */
.orders-review-promo-status--success .orders-review-promo-remove {
    display: inline-flex !important;
    opacity: 1 !important;
    background: #fff; /* white circle on green */
    border: 1px solid rgba(0,0,0,0.08);
    color: #0f5132; /* match success text color for contrast */
}

.orders-review-promo-status--error {
    color: #842029;
    background: #f8d7da;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

/* Slightly different for error state */
.orders-review-promo-status--error .orders-review-promo-remove {
    display: inline-flex !important;
    opacity: 1 !important;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    color: #842029;
}

.promo-applied .orders-review-promo-inputs {
    opacity: 0.8;
}

.orders-review-total-values {
    display: flex;
    flex-direction: column;
}

.orders-review-total-original {
    text-decoration: none; /* only strike-through when promo applied */
    color: #333;
}

/* When promo-applied is present on a parent container, strike through the original amount */
.promo-applied .orders-review-total-original {
    text-decoration: line-through;
}

.orders-review-total-discounted {
    margin-top: 0.25rem;
    display: block; /* visible by default, JS/Twig can hide if not applied */
}

.orders-review-total-discounted-value {
    font-weight: 700;
    color: #0f5132; /* success green */
    margin-right: 0.5rem;
}

.orders-review-total-savings {
    color: #0f5132;
    font-size: 0.85rem;
    margin-left: 6px;
}

@media (max-width: 768px) {
    .orders-review-last-order-content {
        flex-direction: column;
    }

    .orders-review-promo {
        /* En mobile, el promo se apila dentro de la columna izquierda */
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .orders-review-promo-label {
        white-space: normal;
    }

    .orders-review-promo-inputs {
        width: 100%;
    }
}