/* =========================================
   REVOLUTIONARY CHECKOUT DESIGN SYSTEM
   FlorianBD - Next-Gen E-Commerce Experience
   Modern • Minimal • Magical
   ========================================= */

/* --- IMPORTS --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* --- CSS VARIABLES --- */
:root {
    --primary: #00D084;
    --primary-dark: #00A86B;
    --secondary: #6366F1;
    --accent: #F59E0B;
    --success: #10B981;
    --error: #EF4444;

    --bg-primary: #FAFBFC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F3F4F6;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #94A3B8;

    --border-light: #E2E8F0;
    --border-medium: #CBD5E1;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- RESET --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- ANIMATIONS --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-total {
    display: none;
    font-weight: 500;
    opacity: 0.9;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* --- BODY & BASE --- */
body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- NAVIGATION --- */
.top-nav {
    background: var(--bg-secondary);
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(20px, 5vw, 60px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    animation: slideInRight var(--transition-slow);
}

.nav-left .back-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: all var(--transition-base);
}

.nav-left .back-icon:hover {
    opacity: 1;
    transform: translateX(-4px);
}

.nav-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.secure-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(0, 208, 132, 0.1), rgba(99, 102, 241, 0.1));
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

/* --- MAIN CONTENT --- */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: clamp(20px, 4vw, 48px) clamp(20px, 5vw, 60px) 200px;
}

.checkout-container {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: clamp(24px, 4vw, 48px);
    align-items: start;
}

.checkout-forms {
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 3vw, 32px);
}

/* --- SECTIONS --- */
.order-summary-section,
.shipping-section,
.payment-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-2xl);
    padding: clamp(24px, 4vw, 40px);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    animation: fadeInUp var(--transition-slow) backwards;
}

.order-summary-section {
    animation-delay: 0.1s;
}

.shipping-section {
    animation-delay: 0.2s;
}

.payment-section {
    animation-delay: 0.3s;
}

.order-summary-section:hover,
.shipping-section:hover,
.payment-section:hover,
.terms-section:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
    border-color: var(--primary);
}

.terms-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-2xl);
    padding: clamp(20px, 3vw, 24px);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    animation: fadeInUp var(--transition-slow) backwards;
    animation-delay: 0.4s;
}

.checkout-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkout-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkout-checkbox label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkout-checkbox label a {
    color: var(--primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.checkout-checkbox label a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* --- SECTION HEADERS --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(20px, 3vw, 32px);
    padding-bottom: clamp(16px, 2vw, 24px);
    border-bottom: 2px solid var(--bg-tertiary);
}

.section-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(20px, 2.5vw, 26px);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 14px;
    letter-spacing: -0.01em;
}

.section-header h2 i {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(0, 208, 132, 0.3);
    transition: all var(--transition-bounce);
}

.section-header h2 i:hover {
    transform: rotate(-10deg) scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 208, 132, 0.4);
}

.edit-cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.edit-cart-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* --- ORDER ITEMS --- */
.order-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.order-item:hover {
    background: white;
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.order-item-image {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 2px solid var(--border-light);
}

.order-item-details {
    flex: 1;
}

.order-item-name {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 16px;
}

.order-item-price {
    color: var(--text-tertiary);
    font-size: 14px;
    font-weight: 500;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: white;
}



.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.quantity-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.quantity-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.quantity-input {
    width: 48px;
    height: 36px;
    border: none;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.order-item-total {
    font-weight: 800;
    color: var(--primary);
    font-size: 18px;
}

/* --- TOTALS --- */
.order-totals {
    border-top: 2px solid var(--bg-tertiary);
    padding-top: 20px;
    margin-top: 12px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 600;
}

.total-row.final-total {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    border-top: 2px solid var(--bg-tertiary);
    padding-top: 16px;
    margin-top: 16px;
}

.total-row.final-total span:last-child {
    color: var(--primary);
    font-size: 26px;
}

/* --- FORMS --- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-field input,
.form-field select,
.form-field textarea,
.premium-select {
    padding: 14px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    background: white;
    transition: all var(--transition-base);
    font-family: inherit;
}

.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover,
.premium-select:hover {
    border-color: var(--border-medium);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.premium-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 208, 132, 0.1);
}

.form-field textarea {
    resize: vertical;
    min-height: 100px;
}

.error-message {
    color: var(--error);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- MAP PICKER --- */
.map-picker-container {
    background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
    border-radius: var(--radius-lg);
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px dashed var(--primary);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.map-picker-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 208, 132, 0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.map-picker-container:hover {
    border-color: var(--primary-dark);
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.map-picker-container:hover::before {
    opacity: 1;
}

.map-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 1;
}

.map-overlay i {
    font-size: 32px;
    color: var(--primary);
    animation: bounce 2s ease-in-out infinite;
}

.map-overlay div {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
}

/* --- PAYMENT TABS --- */
.payment-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.payment-tab {
    padding: 20px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: white;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-secondary);
    position: relative;
}

.payment-tab:hover {
    border-color: var(--border-medium);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.payment-tab.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(0, 208, 132, 0.05), rgba(99, 102, 241, 0.05));
    color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.payment-tab.active::after {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    animation: scaleIn var(--transition-base);
}

.wallet-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all var(--transition-base);
}

.payment-tab.active .wallet-logo,
.payment-tab:hover .wallet-logo {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

.wallet-logo-large {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.wallet-instructions {
    background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
    border: 2px solid #FCD34D;
    color: #92400E;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.wallet-instructions strong {
    color: #B45309;
    font-weight: 800;
}

.payment-placeholder {
    text-align: center;
    padding: 48px 32px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-medium);
}

.placeholder-content h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.placeholder-content p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* --- SIDEBAR --- */
.order-summary-card {
    position: sticky;
    top: 92px;
    background: var(--bg-secondary);
    border-radius: var(--radius-2xl);
    padding: clamp(24px, 4vw, 36px);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    animation: scaleIn var(--transition-slow) 0.4s backwards;
}

.summary-header {
    border-bottom: 2px solid var(--bg-tertiary);
    margin-bottom: 24px;
    padding-bottom: 20px;
}

.summary-header h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-items {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-medium) transparent;
}

.summary-items::-webkit-scrollbar {
    width: 6px;
}

.summary-items::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 10px;
}

.summary-item {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--bg-tertiary);
}

.summary-item-image {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 2px solid var(--border-light);
}

.summary-item-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 15px;
}

.summary-item-quantity {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.summary-item-price {
    font-weight: 800;
    color: var(--text-primary);
    font-size: 16px;
}

.summary-totals {
    border-top: 2px solid var(--bg-tertiary);
    padding-top: 24px;
}

.secure-badge-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    padding: 14px;
    background: linear-gradient(135deg, #F0FDF4, #DCFCE7);
    border: 2px solid var(--primary);
    border-radius: var(--radius-md);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 800;
}

/* --- PLACE ORDER BUTTON --- */
.place-order-section {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 700px;
    z-index: 1000;
    animation: fadeInUp var(--transition-slow) 0.5s backwards;
}

.place-order-btn {
    width: 100%;
    padding: 20px 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 18px;
    font-weight: 800;
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    transition: all var(--transition-base);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

.place-order-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.place-order-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2xl);
}

.place-order-btn:hover::before {
    transform: translateX(100%);
}

.place-order-btn:active {
    transform: translateY(-2px);
}

.place-order-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: var(--radius-2xl);
    padding: 48px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: var(--shadow-2xl);
    transform: scale(0.9);
    transition: transform var(--transition-bounce);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.success-icon {
    font-size: 72px;
    color: var(--success);
    margin-bottom: 20px;
    animation: scaleIn var(--transition-bounce);
}

.modal-header h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 16px;
    line-height: 1.6;
}

.order-details {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: left;
    margin-bottom: 28px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 600;
}

.detail-row:last-child {
    font-weight: 800;
    color: var(--primary);
    font-size: 18px;
}

.modal-footer {
    display: flex;
    gap: 14px;
}

.modal-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
}

.modal-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.modal-btn.secondary:hover {
    background: var(--border-light);
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: var(--shadow-md);
}

.modal-btn.primary:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* --- RESPONSIVE DESIGN --- */

/* Tablets and below */
@media (max-width: 1024px) {
    .main-content {
        padding: 24px 20px 180px;
    }

    .checkout-container {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .order-summary-card {
        position: static;
        order: -1;
        animation: fadeInUp var(--transition-slow);
    }

    .summary-items {
        max-height: 300px;
    }
}

/* Phones */
@media (max-width: 768px) {
    .top-nav {
        height: 64px;
        padding: 0 12px;
    }

    .nav-left,
    .nav-right {
        flex: 1;
        display: flex;
        align-items: center;
    }

    .nav-right {
        justify-content: flex-end;
    }

    .nav-left .back-icon {
        padding: 8px;
        margin-left: -8px;
        width: 40px;
        height: 40px;
        object-fit: contain;
    }

    .nav-title {
        font-size: 18px;
        white-space: nowrap;
    }

    .main-content {
        padding: 16px 16px 160px;
    }

    .section-header {
        margin-bottom: 20px;
        padding-bottom: 16px;
    }

    .section-header h2 {
        font-size: 20px;
        gap: 10px;
    }

    .section-header h2 i {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .order-summary-section,
    .shipping-section,
    .payment-section,
    .order-summary-card {
        padding: 20px;
        border-radius: var(--radius-xl);
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-group {
        gap: 16px;
    }

    .payment-tabs {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .payment-tab {
        padding: 16px 12px;
        font-size: 13px;
        gap: 8px;
    }

    .wallet-logo {
        width: 40px;
        height: 40px;
    }

    .place-order-section {
        bottom: 0;
        width: 100%;
        max-width: none;
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-light);
        box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.05);
    }

    .place-order-btn {
        border-radius: var(--radius-lg);
        padding: 16px;
        font-size: 16px;
    }

    .mobile-total {
        display: inline;
    }

    /* Success Modal Mobile */
    .modal-content {
        padding: 32px 20px;
        width: 95%;
    }

    .success-icon {
        font-size: 56px;
    }

    .modal-header h2 {
        font-size: 22px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .order-item {
        padding: 12px;
        gap: 12px;
    }

    .order-item-image {
        width: 60px;
        height: 60px;
    }

    .order-item-name {
        font-size: 14px;
    }

    .order-item-total {
        font-size: 16px;
    }

    .quantity-selector {
        transform: scale(0.9);
        transform-origin: left;
    }
}

/* Small Phones */
@media (max-width: 480px) {
    .place-order-section {
        bottom: 0;
        width: 100%;
        max-width: none;
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0);
        backdrop-filter: blur(0px);
        border-top: none;
        box-shadow: 0 -10px 25px rgba(0, 0, 0, 0);
    }

    .place-order-section {
        position: fixed;
        top: 510px;
        left: 50%;
        transform: translateX(-50%);
        max-width: 700px;
        z-index: 1000;
        animation: fadeInUp var(--transition-slow) 0.5s backwards;
    }

    .payment-tabs {
        grid-template-columns: 1fr;
    }

    .order-item {
        flex-wrap: wrap;
    }

    .order-item-details {
        width: calc(100% - 72px);
    }

    .order-item-quantity {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px dashed var(--border-light);
    }

    .quantity-selector {
        transform: scale(1);
    }

    .summary-item {
        grid-template-columns: 50px 1fr auto;
        gap: 10px;
    }

    .summary-item-image {
        width: 50px;
        height: 50px;
    }

    .summary-item-name {
        font-size: 13px;
    }

    .total-row.final-total {
        font-size: 18px;
    }

    .total-row.final-total span:last-child {
        font-size: 22px;
    }

    .edit-cart-btn span {
        display: none;
    }

    .edit-cart-btn {
        padding: 8px;
        width: 36px;
        height: 36px;
        justify-content: center;
    }
}

/* Landscape orientation optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
        padding: 20px;
    }

    .success-icon {
        font-size: 40px;
        margin-bottom: 10px;
    }

    .place-order-section {
        position: static;
        transform: none;
        margin: 20px auto;
        width: 100%;
    }
}

/* Premium micro-interactions for mobile */
@media (hover: none) {

    .order-summary-section:hover,
    .shipping-section:hover,
    .payment-section:hover,
    .payment-tab:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }

    .order-item:active {
        background: var(--bg-secondary);
        transform: scale(0.98);
    }
}
