/* ==========================================================================
   Celeste Core - Página de Confirmación de Pedido (Order Received)
   Estilo Moderno de 2 Columnas (Shopify Style)
   ========================================================================== */

.cel-order-received-page {
    width: 100%;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background-color: #f8fafc;
    min-height: 80vh;
    box-sizing: border-box;
}

.cel-order-page-wrapper {
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px 20px 80px 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1f2937;
}

.cel-order-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 48px;
    align-items: flex-start;
}

/* --------------------------------------------------------------------------
   COLUMNA IZQUIERDA: Encabezado y Tarjetas
   -------------------------------------------------------------------------- */
.cel-order-main-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Encabezado */
.cel-order-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 8px;
}

.cel-order-status-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--celeste-button_bg, #2563eb);
    border: 2px solid var(--celeste-button_bg, #2563eb);
    color: var(--celeste-button_text, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.cel-order-ref-number {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.cel-order-greeting {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}

/* Tarjetas Base */
.cel-order-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* Tarjeta 1: Mapa Interactivo y Confirmación */
.cel-order-map-banner-wrap {
    position: relative;
    width: 100%;
    height: 240px;
    background: #e2e8f0;
    overflow: hidden;
}

.cel-order-map-banner {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 1;
    background: #f1f5f9;
}

.cel-order-map-pin-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 400; /* Superpuesto a las capas de Leaflet sin tapar los controles de zoom */
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

.cel-order-map-badge-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border: 1px solid #e2e8f0;
    text-align: right;
}

.cel-order-map-badge-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cel-order-map-badge-city {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

/* Marcador interactivo Leaflet */
.cel-map-marker-container {
    background: transparent !important;
    border: none !important;
}

.cel-interactive-pin {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    animation: celPinBounce 1s ease-out;
}

.cel-pin-pulse {
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 6px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 50%;
}

@keyframes celPinBounce {
    0% { transform: translateY(-20px); opacity: 0; }
    60% { transform: translateY(4px); opacity: 1; }
    100% { transform: translateY(0); }
}

/* Ajustes de controles y atribución Leaflet */
.cel-order-map-banner .leaflet-control-attribution {
    font-size: 10px !important;
    background: rgba(255, 255, 255, 0.85) !important;
    color: #64748b !important;
    padding: 2px 6px !important;
    border-radius: 4px 0 0 0 !important;
}

.cel-order-map-banner .leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
    border-radius: 6px !important;
    overflow: hidden !important;
}

.cel-order-map-banner .leaflet-control-zoom a {
    background-color: #ffffff !important;
    color: #334155 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    width: 28px !important;
    height: 28px !important;
    line-height: 28px !important;
}

.cel-order-map-info {
    padding: 24px;
}

.cel-order-confirmed-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 10px 0;
}

.cel-order-instructions-text {
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
    margin: 0;
}

.cel-order-instructions-text p {
    margin: 0 0 8px 0;
}

.cel-order-instructions-text p:last-child {
    margin-bottom: 0;
}

/* Tarjeta 2: Detalles del Pedido */
.cel-order-details-card {
    padding: 24px;
}

.cel-order-card-heading {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.cel-order-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 20px;
}

.cel-order-grid-cell {
    font-size: 14px;
}

.cel-order-grid-cell-wide {
    grid-column: span 2;
}

.cel-order-cell-label {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.cel-order-cell-value {
    margin: 0;
    color: #475569;
    line-height: 1.5;
}

.cel-order-payment-method-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475569;
}

.cel-order-payment-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--celeste-link_color, var(--celeste-button_bg, #2563eb));
}

.cel-order-payment-amount {
    font-weight: 600;
    color: #0f172a;
}

.cel-order-address-box {
    font-style: normal;
    color: #475569;
    line-height: 1.5;
}

.cel-order-address-box p {
    margin: 0 0 3px 0;
}

.cel-order-address-box .cel-order-address-name {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}

/* Acciones Footer */
.cel-order-footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.cel-order-help-link-wrap {
    font-size: 14px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cel-order-help-link {
    color: var(--celeste-link_color, var(--celeste-button_bg, #2563eb));
    text-decoration: underline;
    font-weight: 500;
    transition: opacity 0.15s ease;
}

.cel-order-help-link:hover {
    opacity: 0.8;
    color: var(--celeste-link_color, var(--celeste-button_bg, #2563eb));
}

.cel-order-btn-continue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--celeste-button_bg, var(--wp--preset--color--primary, #2563eb)) !important;
    color: var(--celeste-button_text, #ffffff) !important;
    padding: 13px 26px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    transition: opacity 0.15s ease, transform 0.1s ease;
}

.cel-order-btn-continue:hover {
    opacity: 0.9;
    color: var(--celeste-button_text, #ffffff) !important;
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   COLUMNA DERECHA: Resumen de Pedido (Sidebar)
   -------------------------------------------------------------------------- */
.cel-order-sidebar-col {
    position: sticky;
    top: 24px;
}

.cel-order-summary-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Lista de Artículos */
.cel-order-items-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 0 20px 0 !important;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cel-order-item-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cel-order-item-thumb-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cel-order-item-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
}

.cel-order-item-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 20px;
    height: 20px;
    background-color: var(--celeste-button_bg, #0f172a);
    color: var(--celeste-button_text, #ffffff);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cel-order-item-info {
    flex: 1 1 auto;
    min-width: 0;
}

.cel-order-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 3px 0;
    line-height: 1.35;
    word-break: break-word;
}

.cel-order-item-meta {
    font-size: 12px;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cel-order-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    flex-shrink: 0;
    margin-left: 12px;
    white-space: nowrap;
}

/* Desglose de Totales */
.cel-order-totals-breakdown {
    padding-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cel-order-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #475569;
}

.cel-order-totals-value {
    font-weight: 600;
    color: #0f172a;
}

.cel-order-totals-row-final {
    margin-top: 6px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.cel-order-totals-value-total {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.cel-order-currency-code {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.cel-order-tax-note {
    font-size: 12px;
    color: #64748b;
    margin-top: -4px;
}

/* --------------------------------------------------------------------------
   ESTADO VACÍO / NO ENCONTRADO
   -------------------------------------------------------------------------- */
.cel-order-empty {
    max-width: 520px;
    margin: 80px auto;
    text-align: center;
    padding: 0 20px;
}

.cel-order-empty-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 48px 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.cel-order-icon-warning {
    color: #f59e0b;
    margin-bottom: 16px;
}

.cel-order-empty-card h2 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.cel-order-empty-card p {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 24px 0;
}

.cel-order-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--celeste-button_bg, var(--wp--preset--color--primary, #2563eb)) !important;
    color: var(--celeste-button_text, #ffffff) !important;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none !important;
    border: none !important;
    transition: opacity 0.15s ease, transform 0.1s ease;
}

.cel-order-btn-primary:hover {
    opacity: 0.9;
    color: var(--celeste-button_text, #ffffff) !important;
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   RESPONSIVE (Móviles y Tablets)
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .cel-order-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .cel-order-sidebar-col {
        position: static;
        order: -1; /* En móviles el resumen de artículos aparece arriba */
    }

    .cel-order-page-wrapper {
        padding: 24px 16px 60px 16px;
    }
}

@media (max-width: 600px) {
    .cel-order-grid-2col {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .cel-order-grid-cell-wide {
        grid-column: span 1;
    }

    .cel-order-footer-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        text-align: center;
        gap: 20px;
    }

    .cel-order-help-link-wrap {
        justify-content: center;
    }

    .cel-order-btn-continue {
        width: 100%;
        box-sizing: border-box;
    }
}

/* Ocultar elementos heredados/duplicados nativos de WooCommerce si existieran */
.woocommerce-order > .woocommerce-notice--success,
.woocommerce-order > ul.order_details,
.woocommerce-order > .woocommerce-customer-details,
.woocommerce-order > .woocommerce-order-details {
    display: none !important;
}

