/* ==========================================================================
   SUMDAWNG BAZAR - Checkout, Cart & Order Tracking Stylesheet (checkout.css)
   Dedicated styles for /checkout, /cart, and /track pages
   ========================================================================== */

/* Page Wrapper & Common Breadcrumbs */
.page-container {
    padding-top: 24px;
    padding-bottom: 54px;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 18px;
}

.crumb-link {
    color: var(--text-muted, #64748b);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.crumb-link:hover {
    color: var(--primary-green-dark, #059669);
}

.crumb-separator {
    color: #cbd5e1;
}

.crumb-current {
    color: var(--text-main, #0f172a);
    font-weight: 600;
}

/* Page Header Row */
.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main, #0f172a);
    letter-spacing: -0.4px;
    line-height: 1.25;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted, #64748b);
    margin-top: 4px;
}

/* Common Content Card */
.content-card {
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-lg, 12px);
    padding: 24px 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-secondary-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-sm, 6px);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main, #0f172a);
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-secondary-link:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--primary-green-dark, #059669);
}

/* Form Section Heading */
.form-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main, #0f172a);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

/* Form controls */
.form-row-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.825rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm, 6px);
    font-size: 0.9rem;
    font-family: inherit;
    color: #0f172a;
    background-color: #ffffff;
    outline: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

/* ----------------------------------------------------
   Checkout 2-Column Grid
   ---------------------------------------------------- */
.checkout-layout-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 28px;
    align-items: start;
}

.payment-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 14px;
}

.payment-choice-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-choice-card:hover {
    border-color: #10b981;
    background: #f8fafc;
}

.payment-choice-card input[type="radio"] {
    margin-top: 3px;
    accent-color: #10b981;
    width: 18px;
    height: 18px;
}

.choice-content strong {
    display: block;
    font-size: 0.875rem;
    color: #0f172a;
    margin-bottom: 4px;
}

.choice-content span {
    display: block;
    font-size: 0.775rem;
    color: #64748b;
    line-height: 1.4;
}

/* Checkout Item Rows Preview */
.checkout-items-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
    max-height: 280px;
    overflow-y: auto;
}

.checkout-item-preview-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.checkout-preview-thumb {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.checkout-preview-info {
    flex: 1;
}

.checkout-preview-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.checkout-preview-qty {
    font-size: 0.75rem;
    color: #64748b;
}

.checkout-preview-price {
    font-size: 0.9rem;
    font-weight: 800;
    color: #059669;
}

/* Summary Cards (Checkout & Cart) */
.summary-card {
    background: #ffffff;
    position: sticky;
    top: 90px;
}

.summary-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 14px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #475569;
    margin-bottom: 10px;
}

.summary-val {
    font-weight: 700;
    color: #0f172a;
}

.summary-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 14px 0;
}

.summary-total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    padding-top: 4px;
}

.summary-total-amount {
    font-size: 1.25rem;
    color: #059669;
}

.summary-savings-strip,
.safe-payment-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.775rem;
    font-weight: 600;
    color: #065f46;
    margin-top: 14px;
}

.cart-action-box {
    margin-top: 18px;
}

/* ----------------------------------------------------
   Dedicated Cart Page (/cart)
   ---------------------------------------------------- */
.cart-layout-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 28px;
    align-items: start;
}

.card-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.card-section-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

.btn-text-danger {
    background: transparent;
    border: none;
    color: #ef4444;
    font-weight: 700;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn-text-danger:hover {
    text-decoration: underline;
}

.page-cart-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-cart-item-row {
    display: flex;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.page-cart-thumb {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    object-fit: cover;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.page-cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.page-cart-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 4px;
}

.page-cart-item-category {
    font-size: 0.725rem;
    font-weight: 700;
    color: #059669;
    text-transform: uppercase;
}

.page-cart-item-pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 6px;
}

.page-cart-controls-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 8px;
}

.btn-page-remove {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ----------------------------------------------------
   Live Order Tracking (/track)
   ---------------------------------------------------- */
.track-page-container {
    padding-top: 24px;
    padding-bottom: 60px;
}

.track-form-grid {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.btn-track-submit {
    padding: 12px 24px;
    white-space: nowrap;
}

.track-result-card {
    margin-top: 24px;
}

.track-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.order-code-badge {
    display: inline-block;
    background: #0f172a;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.order-status-pill {
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 800;
    text-transform: uppercase;
}

.status-confirmed {
    background: #eff6ff;
    color: #2563eb;
}

.status-processing {
    background: #fef3c7;
    color: #d97706;
}

.status-shipped {
    background: #e0e7ff;
    color: #4338ca;
}

.status-delivered {
    background: #ecfdf5;
    color: #059669;
}

/* Order Stepper Progress */
.order-stepper-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 32px 0 28px 0;
    position: relative;
}

.stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-weight: 800;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stepper-step.active .step-circle {
    background: #f59e0b;
    color: #0f172a;
}

.stepper-step.completed .step-circle {
    background: #10b981;
    color: #ffffff;
}

.step-label {
    font-size: 0.775rem;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
}

.stepper-step.completed .step-label,
.stepper-step.active .step-label {
    color: #0f172a;
}

.stepper-line {
    flex: 1;
    height: 3px;
    background: #e2e8f0;
    margin: 0 -8px 24px -8px;
    z-index: 1;
}

.stepper-line.completed {
    background: #10b981;
}

/* Info Grid */
.track-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.info-block-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
}

.info-block p {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.6;
}

.badge-payment {
    display: inline-block;
    background: #ecfdf5;
    color: #059669;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Track Items List */
.track-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.track-item-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
}

.track-item-img {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.track-item-details {
    flex: 1;
}

.track-item-title {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
}

.track-item-qty {
    display: block;
    font-size: 0.775rem;
    color: #64748b;
    margin-top: 2px;
}

.track-item-subtotal {
    font-size: 0.95rem;
    font-weight: 800;
    color: #059669;
}

/* Responsive */
@media (max-width: 900px) {
    .checkout-layout-grid,
    .cart-layout-grid {
        grid-template-columns: 1fr;
    }
    .payment-options-grid {
        grid-template-columns: 1fr;
    }
    .track-info-grid {
        grid-template-columns: 1fr;
    }
}