/* --- 🎨 PROFESSIONAL BRANDED CONFIGURATION --- */
:root {
    /* Brand Colors - Deep & Trustworthy */
    --primary-color: #8c00ff;
    --primary-hover: #7200d1;
    --primary-light: #f4eaff;
    --accent-color: #a64dff;

    /* Backgrounds */
    --bg-color: #f8f9fa;
    /* Slightly cooler gray for pro feel */
    --card-bg: #ffffff;
    /* Typography */
    --text-primary: #1e293b;
    /* Slate-800 for high contrast but softer than black */
    --text-secondary: #535c68;
    /* Slate-500 */
    --text-tertiary: #94a3b8;
    /* UI Elements */
    --border-color: #e2e8f0;
    /* Slate-200 */
    --input-bg: #ffffff;
    --danger-color: #ef4444;
    --success-color: #eb0808;

    /* Refined Shadows & Radius */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', 'Poppins', -apple-system, system-ui, sans-serif;
    /* Inter is very pro */
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    padding-bottom: 60px;
    -webkit-font-smoothing: antialiased;
}

/* --- REFINED LAYOUT --- */
nav {
    position: relative !important;
}

.order-container {
    max-width: 1100px;
    /* Tighter width for readability */
    margin: 32px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (min-width: 1024px) {
    .order-container {
        display: grid;
        grid-template-columns: 64% 34%;
        /* Precise professional ratio */
        gap: 32px;
        align-items: start;
        padding: 0 40px;
    }
}

.card {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    /* Crisp border defines edges cleanly */
}

@media (min-width: 768px) {
    .card {
        padding: 32px 40px;
        /* More white space inside cards */
    }
}

.card-title {
    font-size: 1.125rem;
    /* 18px */
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: -0.01em;
}

/* --- HERO FILE UPLOAD (Professional) --- */
.file-upload-container {
    margin-bottom: 32px;
}

.file-upload-area {
    background-color: #fdf9f9;
    border: 2px dashed #9a4dff;
    border-radius: var(--radius-md);
    padding: 13px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

#upload-main-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.file-info {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

#file-input {
    display: none;
}


#file-list-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: box-shadow 0.2s;
}

.file-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: #cbd5e1;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 12px;
}

.file-status {
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 99px;
    letter-spacing: 0.02em;
}

.remove-file-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.25rem;
    margin-left: 12px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.remove-file-btn:hover {
    color: var(--danger-color);
}

/* --- PRINT FORM (Structure & Typography) --- */
.form-section {
    padding-top: 8px;
}

.form-section h2 {
    font-size: 1.2rem;
    text-transform: uppercase;
    color: var(--text-primary);
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}


.form-group {
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 22px;
}

.form-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text-primary);
    font-size: 1rem;
}

.input-helper-text {
    display: block !important;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 22px;
    font-weight: 400;
}


.choice-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 100px;
    max-width: 500px;
    margin: 0 auto;
}

.choice-btn {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 16px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1rem;
    height: 100%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.choice-btn:hover {
    border-color: #cbd5e1;
    background-color: #fcfcfc;
}

.choice-btn.active {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 500;
    box-shadow: 0 0 0 1px var(--primary-color) inset;
    transform: translateY(-1px);
}

.choice-btn svg {
    width: 28px;
    height: 28px;
    margin-bottom: 5px;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.choice-btn.active svg {
    opacity: 1;
    stroke: var(--primary-color);
}

.quantity-selector {
    display: flex;
    align-items: center;
    width: 140px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    background-color: white;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

.quantity-btn:hover {
    background-color: #f8fafc;
}

#quantity-decrease {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

#quantity-increase {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

#quantity-input {
    width: 60px;
    height: 40px;
    text-align: center;
    font-weight: 600;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-left: none;
    border-right: none;
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
}

/* Binding Toggle */
.toggle-btn {
    width: 100%;
    padding: 14px;
    background-color: whitesmoke;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.toggle-btn:hover {
    border-color: #cbd5e1;
}

.toggle-btn.active {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

/* --- SIDEBAR SUMMARY --- */
.order-summary {
    background: white;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

@media (min-width: 1024px) {
    .order-summary {
        position: sticky;
        top: 24px;
        z-index: 10;
        margin-top: 0;
    }
}

/* Summary Typography */
.summary-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    align-items: center;
}

.summary-item span:first-child {
    color: var(--text-secondary);
}

.summary-item span:last-child {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

/* Cost Section */
.cost-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.cost-item.discount {
    color: var(--success-color);
    font-weight: 500;
}

.cost-item.grand-total {
    margin-top: 8px;
    font-size: 1.25rem;
    /* 20px */
    font-weight: 700;
    color: var(--text-primary);
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
}

.cost-item.grand-total span:last-child {
    color: var(--primary-color);
}

/* Input Fields (Coupons & Delivery) */
input[type="text"],
input[type="tel"],
select {
    width: 100%;
    padding: 10px 14px;
    /* Refined padding */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    background-color: var(--input-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(140, 0, 255, 0.1);
}

/* Placeholder Styling */
input::placeholder,
textarea::placeholder {
    color: #a0aec0;
    /* Lighter gray for better UX */
    opacity: 0.8;
    /* Firefox fix */
}

/* Coupon Row */
.coupon-section {
    display: flex;
    gap: 8px;
    /* Gap instead of connected inputs for modern feel */
    margin-bottom: 20px;
}

#coupon-input {
    border-radius: var(--radius-md);
    height: 42px;
    flex: 1;
}

#coupon-apply {
    height: 42px;
    padding: 0 20px;
    background-color: var(--text-primary);
    color: white;
    border: none;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    transition: opacity 0.2s;
}

#coupon-apply:hover {
    opacity: 0.9;
}

/* Delivery Section */
.delivery-details-section {
    background-color: #f8fafc;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.delivery-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.delivery-field-group {
    margin-bottom: 14px;
}

.delivery-field-group:last-child {
    margin-bottom: 0;
}

.delivery-field-group label {
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: var(--text-secondary);
    display: block;
}

/* Pay Button */
.pay-button {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 16px;
    /* Slightly less tall */
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(140, 0, 255, 0.25);
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}

.pay-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(140, 0, 255, 0.3);
}

.pay-button:active {
    transform: translateY(0);
}

.pay-button:disabled {
    background-color: #cbd5e1;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Utilities */
.hidden-on-zero {
    display: none !important;
}

.total-pages-input {
    display: none;
}

/* Payment Mode Buttons */
.payment-btn {
    height: auto;
    padding: 15px;
    border-radius: var(--radius-md);
    background-color: #fff;
}

.payment-btn i {
    transition: transform 0.2s;
}

.payment-btn:hover i {
    transform: scale(1.1);
}

.payment-btn.active {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color) inset;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Custom Dropdown Styles --- */
.custom-dropdown {
    position: relative;
    width: 100%;
    outline: none;
}

.dropdown-trigger {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    transition: all 0.2s;
    user-select: none;
}

.custom-dropdown.selected .dropdown-trigger {
    color: var(--text-primary);
    font-weight: 500;
}

.custom-dropdown:focus .dropdown-trigger,
.custom-dropdown.active .dropdown-trigger {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(140, 0, 255, 0.1);
}

.dropdown-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    max-height: 250px;
    overflow-y: auto;
    animation: fadeIn 0.1s ease-out;
}

.custom-dropdown.active .dropdown-options {
    display: block;
}

.dropdown-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.1s;
    font-size: 0.95rem;
    color: var(--text-primary);
    border-bottom: 1px solid #f1f5f9;
}

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

.dropdown-option:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

/* --- TOAST NOTIFICATION --- */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background-color: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-notification.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-notification.error {
    background-color: var(--danger-color);
}

.toast-notification.success {
    background-color: var(--success-color);
}

/* Mobile Optimization: Show Toast at Top */
@media (max-width: 768px) {
    .toast-notification {
        top: 80px;
        /* Below navbar */
        bottom: auto;
        width: 90%;
        text-align: center;
        justify-content: center;
        transform: translateX(-50%) translateY(-20px);
    }

    .toast-notification.visible {
        transform: translateX(-50%) translateY(0);
    }
}

/* --- UPLOAD MODAL --- */
.upload-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.upload-modal-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}