/* Basic Setup */
:root {
    --primary: #1e1e1e;
    --border: #e0e0e0;
    --accent: #d4af37; /* Gold accent often used in luxury */
}

/* Checkout Page Layout */
.checkout-page {
    background: #fdfdfd;
}

.checkout-main {
    padding: 120px 0 80px;
    min-height: 80vh;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 60px;
}

/* Form Column */
.checkout-form-col {
    padding-right: 20px;
    border-right: 1px solid var(--border);
}

.checkout-section {
    margin-bottom: 40px;
}

.checkout-section:first-of-type {
    margin-top: 32px;
}

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

.checkout-section .section-header h2 {
    margin-bottom: 0;
    white-space: nowrap;
}

.checkout-section h2 {
    font-size: 18px;
    font-family: var(--font-serif);
    margin-bottom: 20px;
    font-weight: 500;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
    position: relative;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group.half {
    flex: 1;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    font-size: 14px;
    font-family: var(--font-sans);
    color: #1E1E1E;
    background-color: #fff;
    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease;
    accent-color: #1E1E1E;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="tel"]::placeholder {
    color: #999;
}

input:focus,
select:focus {
    border-color: #1E1E1E;
    outline: none;
    box-shadow: 0 0 0 1px #1E1E1E;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    margin-top: 10px;
}
.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    gap: 8px;
}

/* Shipping Options */
.shipping-options {
    border: 1px solid #d9d9d9;
    border-radius: 5px;
    overflow: hidden;
}

.shipping-option {
    display: flex;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    border-bottom: 1px solid #d9d9d9;
    transition: background 0.2s;
}

.shipping-option:last-child {
    border-bottom: none;
}

.shipping-option:hover {
    background: #f9f9f9;
}

.option-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 10px;
}

.option-name {
    font-size: 14px;
    font-weight: 500;
}

.option-time {
    font-size: 12px;
    color: #666;
}

.option-price {
    font-weight: 600;
    font-size: 14px;
}

/* Payment Icons */
.payment-icons {
    display: flex;
    gap: 5px;
    margin-left: auto;
}
.payment-icons img {
    height: 24px;
}

/* Summary Column */
.checkout-summary-col {
    position: sticky;
    top: 100px; /* Adjust based on header height */
    height: fit-content;
    padding-left: 20px;
}

.summary-card {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
}

.summary-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.item-image {
    position: relative;
    width: 60px;
    height: 60px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    padding: 2px;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.item-qty {
    /* position: absolute; */
    /* top: -8px;
    right: -8px; */
    /* background: #666; */
    color: #666;
    font-size: 11px;
    /* width: 18px; */
    height: 18px;
    /* border-radius: 50%; */
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-details h4 {
    font-size: 13px;
    margin: 0 0 4px;
    font-weight: 500;
}

.item-details .variant {
    font-size: 12px;
    color: #777;
    margin: 0;
}

.item-price {
    margin-left: auto;
    font-size: 14px;
    font-weight: 500;
}

.discount-code {
    margin: 25px 0;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.pricing-summary .price-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #555;
}

.pricing-summary .total {
    font-size: 18px;
    font-weight: 600;
    color: #1E1E1E;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-pay {
    margin-top: 25px;
    height: 55px; /* Match product detail btn height */
    font-size: 13px;
    letter-spacing: 0.15em; /* Match product detail tracking */
    width: 100%;
    border-radius: 0; /* Square corners */
    text-transform: uppercase;
    font-weight: 600;
    background: #1E1E1E;
    color: #fff;
    border: 1px solid #1E1E1E;
}

.btn-step {
    height: 55px;
    font-size: 13px;
    letter-spacing: 0.15em;
    border-radius: 0;
    text-transform: uppercase;
    font-weight: 600;
    background: #1E1E1E;
    color: #fff;
    border: 1px solid #1E1E1E;
    padding: 0 30px;
    width: 100%; /* Ensure full width on mobile or responsive */
}

/* Success Page Styles */
.success-page {
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.success-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 140px 20px 80px;
}

.success-container {
    text-align: center;
    max-width: 500px;
    width: 100%;
    margin: auto;
    opacity: 1; /* JS handles fade in */
    transform: translateY(20px);
}

.success-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
}

/* Checkmark Animation */
.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #4bb71b;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
    stroke: #4bb71b;
    stroke-width: 3;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

.success-title {
    font-family: var(--font-serif);
    font-size: 36px; /* Big title */
    margin-bottom: 10px;
    color: #1E1E1E;
}

.success-subtitle {
    color: #666;
    margin-bottom: 40px;
}

.order-details-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 40px;
    border: 1px solid #eee;
}

.order-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.order-number {
    font-weight: 700;
    letter-spacing: 0.05em;
}

.order-message p {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.success-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.success-actions .btn {
    height: 50px;
    padding: 0 30px;
    font-size: 12px;
    letter-spacing: 0.15em;
    min-width: 180px; /* Consistent width */
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    font-weight: 600;
}

/* Responsive */
.mobile-sticky-bar {
    display: none;
}

@media (max-width: 900px) {
    .checkout-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .checkout-main,
    .success-main {
        padding: 80px 0 0px;
    }
    .success-main {
        padding-bottom: 80px;
    }

    .checkout-form-col {
        border-right: none;
        order: 1;
        padding-right: 0;
    }

    .checkout-summary-col {
        position: static;
        order: 2;
        padding-left: 0;
        margin-bottom: 30px;
        border-bottom: 1px solid #eee;
        padding-bottom: 20px;
    }

    .summary-card {
        padding: 20px;
    }

    /* Hide duplicate pay button in summary on mobile */
    .summary-card .btn-pay {
        display: none;
    }

    /* Sticky Mobile Pay Button Container */
    .mobile-sticky-bar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        background: #fff;
        z-index: 1000 !important; /* Above content, below WhatsApp (3000) */
        padding: 15px 20px calc(15px + env(safe-area-inset-bottom));
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
        border-top: 1px solid #eee;
        display: flex !important; /* Force display flex */
        flex-direction: column;
        gap: 12px;
    }

    .sticky-total-row {
        display: flex;
        justify-content: space-between;
        font-size: 14px;
        color: #555;
    }

    .sticky-price {
        font-weight: 600;
        color: #1E1E1E;
        font-size: 16px;
    }

    .btn-pay-mobile {
        width: 100%;
        height: 55px;
        border-radius: 0;
        margin: 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        text-transform: uppercase;
        font-weight: 600;
        letter-spacing: 0.15em;
        background: #1E1E1E;
        color: #fff;
        border: 1px solid #1E1E1E;
    }

    /* Success Page Mobile Buttons */
    .success-actions {
        gap: 10px;
        padding: 0 20px;
    }

    .success-actions .btn {
        height: auto; /* Allow height to grow */
        min-height: 45px;
        font-size: 11px;
        padding: 5px 5px; /* Tighter padding */
        letter-spacing: 0.05em; /* Reduce tracking */
        flex: 1;
        white-space: normal; /* Allow wrapping */
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1.1;
        text-align: center;
    }
}
