/* ==================== ORDER CONFIRMATION STYLES ==================== */
:root {
    --primary: #2e7d32;
    --primary-light: #4caf50;
    --primary-dark: #1b5e20;
    --secondary: #ff9800;
    --white: #ffffff;
    --off-white: #f5f5f5;
    --gray-100: #f0f0f0;
    --gray-200: #e0e0e0;
    --gray-400: #9e9e9e;
    --gray-600: #616161;
    --black: #212121;
    --accent-red: #e53935;
    --gradient-primary: linear-gradient(135deg, #2e7d32 0%, #66bb6a 100%);
    --gradient-secondary: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50%;
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c8e6c9;
    border-radius: 3px;
}

/* ==================== BACKGROUND ==================== */
.success-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(46, 125, 50, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 152, 0, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 50% 50%, rgba(46, 125, 50, 0.05) 0%, transparent 50%);
}

/* ==================== CONTAINER ==================== */
.confirmation-container {
    max-width: 500px;
    width: 100%;
    text-align: center;
}

/* ==================== SUCCESS ICON ==================== */
.success-icon {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto 25px;
}

.icon-circle {
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(46, 125, 50, 0.4);
    animation: scaleIn 0.5s ease forwards;
}

.icon-circle i {
    font-size: 2.8rem;
    color: var(--white);
    animation: checkmark 0.5s ease 0.3s forwards;
    opacity: 0;
    transform: scale(0);
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

@keyframes checkmark {
    from { 
        opacity: 0;
        transform: scale(0) rotate(-45deg);
    }
    to { 
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.ripple {
    position: absolute;
    inset: -10px;
    border: 3px solid var(--primary-light);
    border-radius: var(--radius-full);
    animation: ripple 1.5s ease infinite;
}

.ripple.delay {
    animation-delay: 0.5s;
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ==================== TITLES ==================== */
.success-title {
    font-size: 1.6rem;
    color: var(--primary-dark);
    margin-bottom: 8px;
    animation: fadeInUp 0.5s ease 0.3s forwards;
    opacity: 0;
}

.success-subtitle {
    color: var(--gray-600);
    margin-bottom: 25px;
    font-size: 0.9rem;
    animation: fadeInUp 0.5s ease 0.4s forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== ORDER CARD ==================== */
.order-card {
    background: var(--white);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    animation: fadeInUp 0.5s ease 0.5s forwards;
    opacity: 0;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
}

.order-id-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.order-id-section .label {
    font-size: 0.72rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-id {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    word-break: break-all;
}

.payment-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(46, 125, 50, 0.1);
    border-radius: 50px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.payment-badge.cod {
    background: rgba(255, 152, 0, 0.1);
    color: var(--secondary);
}

/* Order Details */
.order-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.detail-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-600);
}

.detail-label i {
    color: var(--primary);
    width: 16px;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.detail-value {
    font-weight: 600;
    color: var(--black);
}

/* Delivery Estimate */
.delivery-estimate {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 14px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 12px;
}

.estimate-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.estimate-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 0;
}

.estimate-label {
    font-size: 0.72rem;
    color: var(--gray-600);
}

.estimate-time {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
}

/* ==================== STATUS TIMELINE ==================== */
.status-timeline {
    background: var(--white);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
    animation: fadeInUp 0.5s ease 0.6s forwards;
    opacity: 0;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
}

.timeline-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: var(--radius-full);
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.timeline-item.active .timeline-icon {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 3px 10px rgba(46, 125, 50, 0.25);
}

.timeline-item.completed .timeline-icon {
    background: var(--primary);
    color: var(--white);
}

.timeline-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.timeline-title {
    font-weight: 600;
    color: var(--black);
    font-size: 0.88rem;
}

.timeline-item.active .timeline-title {
    color: var(--primary);
}

.timeline-time {
    font-size: 0.72rem;
    color: var(--gray-400);
}

.timeline-line {
    width: 3px;
    height: 22px;
    background: var(--gray-200);
    margin-left: 17px;
    border-radius: 2px;
    transition: background 0.3s ease;
}

.timeline-item.active + .timeline-line,
.timeline-item.completed + .timeline-line {
    background: var(--primary);
}

/* ==================== ACTION BUTTONS ==================== */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    animation: fadeInUp 0.5s ease 0.7s forwards;
    opacity: 0;
}

/* ===== Primary & Secondary Buttons - Matched ===== */
.btn-primary,
.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 13px 16px;
    min-width: 130px;
    border: none;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    cursor: pointer;
}

.btn-primary:active,
.btn-secondary:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, #2e7d32, #66bb6a);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.2);
}

/* ==================== HELP SECTION ==================== */
.help-section {
    animation: fadeInUp 0.5s ease 0.8s forwards;
    opacity: 0;
}

.help-section p {
    color: var(--gray-600);
    font-size: 0.82rem;
}

.help-section a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.help-section a:hover {
    text-decoration: underline;
}

/* ==================== LOADING ==================== */
.loading {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.spinner {
    width: 42px;
    height: 42px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== RESPONSIVE - TABLET ==================== */
/* ==================== RESPONSIVE - TABLET ==================== */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .success-icon {
        width: 95px;
        height: 95px;
        margin-bottom: 20px;
    }

    .icon-circle i {
        font-size: 2.3rem;
    }

    .success-title {
        font-size: 1.4rem;
    }

    .success-subtitle {
        font-size: 0.85rem;
    }

    .order-card {
        padding: 18px;
    }

    .delivery-estimate {
        gap: 10px;
        padding: 12px;
    }
}

/* ==================== RESPONSIVE - SMALL MOBILE ==================== */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .confirmation-container {
        padding: 0;
    }

    .success-icon {
        width: 85px;
        height: 85px;
        margin-bottom: 18px;
    }

    .icon-circle i {
        font-size: 2rem;
    }

    .success-title {
        font-size: 1.2rem;
    }

    .success-subtitle {
        font-size: 0.82rem;
        margin-bottom: 20px;
    }

    .order-card {
        padding: 16px;
        border-radius: 12px;
    }

    /* FIXED: Order header stacks on mobile */
    .order-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .payment-badge {
        align-self: flex-start;
    }

    .order-id {
        font-size: 0.9rem;
    }

    /* FIXED: Detail rows wrap properly */
    .detail-row {
        font-size: 0.8rem;
        gap: 8px;
    }

    .detail-label {
        gap: 6px;
        font-size: 0.78rem;
    }

    .detail-label i {
        font-size: 0.72rem;
    }

    .detail-value {
        font-size: 0.8rem;
        text-align: right;
        word-break: break-word;
    }

    /* FIXED: Delivery estimate compact */
    .delivery-estimate {
        gap: 10px;
        padding: 12px;
    }

    .estimate-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
        font-size: 1rem;
    }

    .estimate-time {
        font-size: 0.9rem;
    }

    .estimate-label {
        font-size: 0.68rem;
    }

    /* FIXED: Timeline compact */
    .status-timeline {
        padding: 16px;
        border-radius: 12px;
    }

    .timeline-item {
        gap: 10px;
        padding: 8px 0;
    }

    .timeline-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 0.78rem;
    }

    .timeline-title {
        font-size: 0.82rem;
    }

    .timeline-time {
        font-size: 0.68rem;
    }

    .timeline-line {
        height: 18px;
        margin-left: 15px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 12px 14px;
        font-size: 0.82rem;
        min-width: unset;
    }

    .help-section p {
        font-size: 0.78rem;
    }
}

/* ==================== RESPONSIVE - VERY SMALL ==================== */
@media (max-width: 340px) {
    body {
        padding: 8px;
    }

    .success-icon {
        width: 72px;
        height: 72px;
        margin-bottom: 14px;
    }

    .icon-circle i {
        font-size: 1.7rem;
    }

    .ripple {
        inset: -6px;
        border-width: 2px;
    }

    .success-title {
        font-size: 1.05rem;
    }

    .success-subtitle {
        font-size: 0.75rem;
        margin-bottom: 16px;
    }

    .order-card {
        padding: 12px;
        border-radius: 10px;
    }

    .order-id-section .label {
        font-size: 0.65rem;
    }

    .order-id {
        font-size: 0.82rem;
    }

    .payment-badge {
        padding: 4px 10px;
        font-size: 0.7rem;
    }

    .detail-row {
        font-size: 0.75rem;
    }

    .detail-label {
        font-size: 0.72rem;
        gap: 5px;
    }

    .detail-label i {
        font-size: 0.68rem;
        width: 14px;
    }

    .delivery-estimate {
        padding: 10px;
        gap: 8px;
        border-radius: 10px;
    }

    .estimate-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 0.88rem;
    }

    .estimate-time {
        font-size: 0.82rem;
    }

    .estimate-label {
        font-size: 0.62rem;
    }

    .status-timeline {
        padding: 12px;
        border-radius: 10px;
    }

    .timeline-item {
        gap: 8px;
        padding: 6px 0;
    }

    .timeline-icon {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 0.7rem;
    }

    .timeline-title {
        font-size: 0.75rem;
    }

    .timeline-time {
        font-size: 0.62rem;
    }

    .timeline-line {
        height: 14px;
        margin-left: 13px;
        width: 2px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 10px;
        font-size: 0.75rem;
        min-width: unset;
    }

    .help-section p {
        font-size: 0.72rem;
    }

    .action-buttons {
        gap: 8px;
    }
}

/* ==================== PRINT ==================== */
@media print {
    .action-buttons,
    .help-section,
    .loading,
    .success-bg {
        display: none !important;
    }

    body {
        background: var(--white);
    }

    .order-card,
    .status-timeline {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}