/**
 * Order Confirmation Widget Styles
 * Super-fast, beautiful thank you page layouts for WooCommerce
 *
 * @package Storedash
 * @since 3.4.0
 */

/* ============================================
   Base Container
   ============================================ */

.storedash-order-confirmation {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ============================================
   Thank You Section
   ============================================ */

.order-thank-you-section {
    text-align: center;
    padding: 48px 20px;
    margin-bottom: 48px;
}

.order-thank-you-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    font-size: 64px;
    color: #4CAF50;
    animation: successPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.order-thank-you-icon svg {
    width: 64px;
    height: 64px;
}

.order-thank-you-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px;
    line-height: 1.2;
}

.order-thank-you-subtitle {
    font-size: 18px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* ============================================
   Order Information Grid
   ============================================ */

.order-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    padding: 32px;
    background: #f9fafb;
    border-radius: 16px;
    margin-bottom: 40px;
}

.order-info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-info-label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-info-value {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.order-total-item .order-info-value {
    font-size: 24px;
    color: #E65500;
}

.order-status-processing {
    color: #f59e0b !important;
}

.order-status-completed {
    color: #10b981 !important;
}

.order-status-on-hold {
    color: #6b7280 !important;
}

.order-status-pending {
    color: #ef4444 !important;
}

/* ============================================
   Order Items Section
   ============================================ */

.order-items-section {
    margin-bottom: 40px;
}

.order-items-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.order-items-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.order-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.order-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

.order-item-image {
    width: 80px;
    height: 80px;
}

.order-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.order-item-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.order-item-name {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
}

.order-item-quantity {
    font-size: 14px;
    color: #666;
}

.order-item-quantity strong {
    color: #1a1a1a;
    font-weight: 600;
}

.order-item-price {
    font-size: 16px;
    font-weight: 600;
    color: #E65500;
}

/* ============================================
   Order Totals Summary
   ============================================ */

.order-totals-summary {
    padding: 24px;
    background: #f9fafb;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    color: #1a1a1a;
}

.order-total-row span:first-child {
    font-weight: 500;
    color: #666;
}

.order-total-row span:last-child {
    font-weight: 600;
}

.order-total-final {
    padding-top: 12px;
    border-top: 2px solid #e5e7eb;
    font-size: 20px !important;
    margin-top: 8px;
}

.order-total-final span {
    font-weight: 700;
    color: #1a1a1a;
}

.order-total-final span:last-child {
    color: #E65500;
    font-size: 24px;
}

/* ============================================
   Customer Details Section
   ============================================ */

.customer-details-section {
    margin-top: 40px;
}

.customer-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.customer-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.customer-detail-card {
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.customer-detail-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

.customer-detail-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px;
}

.customer-address {
    font-size: 15px;
    line-height: 1.6;
    color: #1a1a1a;
    font-style: normal;
    margin: 0;
}

.customer-info {
    font-size: 15px;
    color: #1a1a1a;
    margin: 0;
}

/* ============================================
   Modern Card Layout
   ============================================ */

.storedash-order-confirmation.layout-modern {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.layout-modern .order-thank-you-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 20px 20px 0 0;
    margin-bottom: 32px;
}

/* ============================================
   Classic Layout
   ============================================ */

.storedash-order-confirmation.layout-classic {
    background: #ffffff;
    border: 2px solid #1a1a1a;
    padding: 48px;
}

.layout-classic .order-thank-you-section {
    border-bottom: 2px solid #1a1a1a;
    padding-bottom: 32px;
    margin-bottom: 32px;
}

.layout-classic .order-info-grid {
    background: #ffffff;
    border: 2px solid #1a1a1a;
    border-radius: 0;
}

/* ============================================
   Minimal Layout
   ============================================ */

.storedash-order-confirmation.layout-minimal {
    background: transparent;
    padding: 24px;
}

.layout-minimal .order-info-grid {
    background: transparent;
    padding: 0;
    gap: 32px;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    padding: 32px 0;
}

.layout-minimal .customer-detail-card {
    background: transparent;
    border: none;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

.layout-minimal .customer-detail-card:last-child {
    border-bottom: none;
}

/* ============================================
   Error States
   ============================================ */

.storedash-no-order,
.storedash-access-denied {
    text-align: center;
    padding: 80px 20px;
}

.no-order-message,
.access-denied-message {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 16px;
}

.no-order-message p,
.access-denied-message p {
    font-size: 18px;
    color: #991b1b;
    margin: 0;
}

/* ============================================
   Elementor Editor Preview
   ============================================ */

.elementor-editor-preview {
    opacity: 0.8;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .storedash-order-confirmation {
        padding: 24px;
    }

    .order-thank-you-section {
        padding: 32px 16px;
        margin-bottom: 32px;
    }

    .order-thank-you-title {
        font-size: 24px;
    }

    .order-thank-you-subtitle {
        font-size: 16px;
    }

    .order-info-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        padding: 20px;
    }

    .order-info-item {
        gap: 4px;
    }

    .order-info-label {
        font-size: 12px;
    }

    .order-info-value {
        font-size: 16px;
    }

    .order-total-item .order-info-value {
        font-size: 20px;
    }

    .order-items-title,
    .customer-section-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .order-item {
        grid-template-columns: 60px 1fr;
        gap: 16px;
        padding: 16px;
    }

    .order-item-image {
        width: 60px;
        height: 60px;
    }

    .order-item-name {
        font-size: 16px;
    }

    .order-item-quantity,
    .order-item-price {
        font-size: 14px;
    }

    .customer-details-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .customer-detail-card {
        padding: 20px;
    }

    .order-totals-summary {
        padding: 20px;
    }

    .order-total-row {
        font-size: 14px;
    }

    .order-total-final {
        font-size: 18px !important;
    }

    .order-total-final span:last-child {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .storedash-order-confirmation {
        padding: 16px;
    }

    .order-info-grid {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 12px;
    }

    .order-thank-you-icon {
        font-size: 48px;
        width: 60px;
        height: 60px;
        margin-bottom: 16px;
    }

    .order-thank-you-icon svg {
        width: 48px;
        height: 48px;
    }

    .order-thank-you-title {
        font-size: 20px;
    }

    .order-thank-you-subtitle {
        font-size: 14px;
    }
}

/* ============================================
   Performance Optimizations
   ============================================ */

.storedash-order-confirmation * {
    box-sizing: border-box;
}

/* Reduce paint operations */
.order-item,
.customer-detail-card,
.order-info-grid {
    will-change: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Smooth animations */
.order-item:hover,
.customer-detail-card:hover {
    transform: translateY(-2px);
}
