/* =========================================================
   ADMIN - DETALLE DE PEDIDO
========================================================= */

.admin-order-page {
    width: 100%;
    padding: 35px 20px 60px;
    background: #f6f8fb;
}

.admin-order-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}


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

.order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 30px;
}

.order-header-label {
    display: block;
    margin-bottom: 7px;
    color: #048ABF;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

.order-header h1 {
    margin: 0;
    color: #17324d;
    font-size: 30px;
    font-weight: 700;
}

.order-header-subtitle {
    margin: 7px 0 0;
    color: #7b8794;
    font-size: 14px;
}

.order-header-status {
    flex-shrink: 0;
}


/* =========================================================
   SECCIONES
========================================================= */

.order-section,
.order-actions-section {
    margin-bottom: 28px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.section-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #e9f7fc;
    font-size: 19px;
}

.section-title h2 {
    margin: 0;
    color: #17324d;
    font-size: 18px;
    font-weight: 700;
}

.section-title p {
    margin: 3px 0 0;
    color: #8793a0;
    font-size: 13px;
}


/* =========================================================
   CLIENTE
========================================================= */

.customer-card {
    padding: 25px;
    background: #ffffff;
    border: 1px solid #e8edf2;
    border-radius: 16px;
    box-shadow: 0 5px 18px rgba(25, 55, 80, 0.05);
}

.customer-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.customer-info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-label {
    color: #8995a1;
    font-size: 12px;
    font-weight: 600;
}

.info-value {
    color: #263b50;
    font-size: 15px;
    font-weight: 500;
    word-break: break-word;
}

.customer-address {
    grid-column: span 2;
}

.customer-notes {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #edf0f3;
}

.customer-notes p {
    margin: 6px 0 0;
    color: #405568;
    font-size: 14px;
}

.customer-notes-empty p {
    color: #9aa5af;
}


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

.products-card {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e8edf2;
    border-radius: 16px;
    box-shadow: 0 5px 18px rgba(25, 55, 80, 0.05);
}

.products-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.products-table {
    margin: 0;
    min-width: 720px;
}

.products-table thead th {
    padding: 15px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e5eaf0;
    color: #6e7c89;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
}

.products-table tbody td {
    padding: 18px;
    border-bottom: 1px solid #edf0f3;
    color: #405568;
    vertical-align: middle;
}

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

.product-name {
    color: #20384e;
    font-size: 14px;
    font-weight: 600;
}

.product-options {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.product-option {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    background: #eef5f8;
    border-radius: 7px;
    color: #426174;
    font-size: 11px;
    font-weight: 600;
}

.product-price {
    color: #536675;
    font-size: 14px;
}

.product-quantity {
    display: inline-flex;
    min-width: 32px;
    height: 30px;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    background: #f2f5f7;
    border-radius: 7px;
    color: #30495d;
    font-size: 13px;
    font-weight: 700;
}

.product-subtotal {
    color: #17324d;
    font-size: 15px;
}


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

.order-total {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 25px;
    padding: 20px 25px;
    background: #f8fafc;
    border-top: 1px solid #e8edf2;
}

.order-total span {
    color: #71808d;
    font-size: 14px;
    font-weight: 600;
}

.order-total strong {
    color: #048ABF;
    font-size: 25px;
    font-weight: 800;
}


/* =========================================================
   PAGO + ESTADO
========================================================= */

.order-management-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

.management-card {
    padding: 25px;
    background: #ffffff;
    border: 1px solid #e8edf2;
    border-radius: 16px;
    box-shadow: 0 5px 18px rgba(25, 55, 80, 0.05);
}

.management-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid #edf0f3;
}

.management-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9f7fc;
    border-radius: 11px;
    font-size: 18px;
}

.management-card-header h2 {
    margin: 0;
    color: #17324d;
    font-size: 17px;
    font-weight: 700;
}

.management-card-header p {
    margin: 3px 0 0;
    color: #8995a1;
    font-size: 12px;
}


/* =========================================================
   PAGO
========================================================= */

.payment-info {
    display: flex;
    flex-direction: column;
}

.payment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 17px 0;
    border-bottom: 1px solid #edf0f3;
}

.payment-row:last-child {
    border-bottom: none;
}

.payment-row > span {
    color: #7d8a96;
    font-size: 13px;
}

.payment-row strong {
    color: #30485b;
    font-size: 14px;
    text-align: right;
}

.payment-action {
    margin-top: 18px;
}


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

.order-status,
.payment-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.status-pending,
.payment-pending {
    background: #fff3cd;
    color: #856404;
}

.status-confirmed {
    background: #e7f0ff;
    color: #2455a4;
}

.status-processing {
    background: #e4f7fb;
    color: #167187;
}

.status-completed,
.payment-paid {
    background: #e5f7ed;
    color: #237746;
}

.status-cancelled,
.payment-rejected {
    background: #fde8e8;
    color: #b42318;
}

.current-order-status {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}


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

.btn-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 10px 17px;
    border: none;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s ease;
}

.btn-order:hover {
    transform: translateY(-1px);
}

.btn-approve {
    background: #198754;
    color: #ffffff;
}

.btn-approve:hover {
    background: #157347;
}

.btn-primary-order {
    background: #048ABF;
    color: #ffffff;
}

.btn-primary-order:hover {
    background: #03779f;
}

.btn-complete {
    background: #198754;
    color: #ffffff;
}

.btn-complete:hover {
    background: #157347;
}


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

.order-actions-section {
    padding: 25px;
    background: #ffffff;
    border: 1px solid #e8edf2;
    border-radius: 16px;
    box-shadow: 0 5px 18px rgba(25, 55, 80, 0.05);
}

.order-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 23px;
}

.cancel-order-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 22px;
    border-top: 1px solid #edf0f3;
}

.cancel-order-area strong {
    display: block;
    color: #475b6b;
    font-size: 13px;
}

.cancel-order-area p {
    margin: 4px 0 0;
    color: #9aa5ae;
    font-size: 12px;
}

.btn-cancel-order {
    flex-shrink: 0;
    padding: 9px 15px;
    border: 1px solid #e4bcbc;
    border-radius: 8px;
    background: #ffffff;
    color: #b42318;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s ease;
}

.btn-cancel-order:hover {
    background: #fde8e8;
    border-color: #d99a9a;
}


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

.cancel-modal {
    overflow: hidden;
    border: none;
    border-radius: 16px;
}

.cancel-modal .modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 22px;
    border-bottom: 1px solid #edf0f3;
}

.cancel-modal .modal-title {
    color: #263d50;
    font-size: 18px;
    font-weight: 700;
}

.modal-warning-icon {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fde8e8;
    color: #b42318;
    font-weight: 800;
}

.cancel-modal .modal-body {
    padding: 24px 22px;
}

.cancel-modal .modal-body p {
    margin: 0 0 15px;
    color: #4b5f70;
    font-size: 14px;
    line-height: 1.6;
}

.modal-warning-message {
    padding: 12px 14px;
    border-radius: 9px;
    background: #fff7e5;
    color: #856404;
    font-size: 12px;
    line-height: 1.5;
}

.cancel-modal .modal-footer {
    padding: 15px 22px;
    border-top: 1px solid #edf0f3;
}

.btn-modal-secondary,
.btn-modal-danger {
    padding: 9px 15px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.btn-modal-secondary {
    border: 1px solid #dce2e7;
    background: #ffffff;
    color: #536675;
}

.btn-modal-danger {
    border: none;
    background: #dc3545;
    color: #ffffff;
}


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

@media (max-width: 900px) {

    .customer-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .customer-address {
        grid-column: span 2;
    }

    .order-management-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 650px) {

    .admin-order-page {
        padding: 25px 12px 45px;
    }

    .order-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
    }

    .order-header h1 {
        font-size: 25px;
    }

    .customer-card,
    .management-card,
    .order-actions-section {
        padding: 18px;
    }

    .customer-info-grid {
        grid-template-columns: 1fr;
        gap: 17px;
    }

    .customer-address {
        grid-column: span 1;
    }

    .order-total {
        align-items: flex-end;
        flex-direction: column;
        gap: 5px;
        padding: 18px;
    }

    .order-total strong {
        font-size: 23px;
    }

    .payment-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .payment-row strong {
        text-align: left;
    }

    .current-order-status {
        min-height: 90px;
    }

    .order-actions {
        flex-direction: column;
    }

    .order-actions form,
    .order-actions .btn-order {
        width: 100%;
    }

    .cancel-order-area {
        align-items: flex-start;
        flex-direction: column;
    }

    .btn-cancel-order {
        width: 100%;
    }

}


@media (max-width: 480px) {

    .order-header-label {
        font-size: 11px;
    }

    .section-icon,
    .management-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .section-title h2 {
        font-size: 16px;
    }

    .section-title p {
        font-size: 12px;
    }

    .products-table thead th,
    .products-table tbody td {
        padding: 13px;
    }

}