﻿/* ===================================================================
   EasySok Ã¢â‚¬â€ Professional One-Page Checkout
   =================================================================== */

#megabyte-theme .es-checkout-page {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

#megabyte-theme .es-checkout-page:has(.es-checkout-sticky-bar) {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0));
}

@media (min-width: 1024px) {
    #megabyte-theme .es-checkout-page:has(.es-checkout-sticky-bar) {
        padding-bottom: 0;
    }
}

#megabyte-theme .es-checkout-page main {
    background: transparent !important;
}

/* 3-column single-page layout: address | shipping+payment | summary */
#megabyte-theme .es-checkout-layout--3col {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
    #megabyte-theme .es-checkout-layout--3col {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(280px, 320px);
        gap: 20px;
        align-items: start;
    }
}

@media (min-width: 1280px) {
    #megabyte-theme .es-checkout-layout--3col {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(300px, 360px);
        gap: 24px;
    }
}

#megabyte-theme .es-checkout-col--address .es-checkout-card,
#megabyte-theme .es-checkout-col--delivery .es-checkout-card,
#megabyte-theme .es-checkout-col--summary .es-checkout-card {
    height: auto;
}

@media (min-width: 1024px) {
    #megabyte-theme .es-checkout-col--address .es-checkout-card,
    #megabyte-theme .es-checkout-col--delivery .es-checkout-card,
    #megabyte-theme .es-checkout-col--summary .es-checkout-card {
        height: 100%;
    }
}

#megabyte-theme .es-checkout-col--delivery .es-checkout-section {
    margin-top: 0;
}

#megabyte-theme .es-checkout-col--delivery .es-checkout-section + .es-checkout-section {
    margin-top: 0;
}

#megabyte-theme .es-checkout-col--delivery .es-checkout-card {
    padding: 18px 20px;
}

#megabyte-theme .es-checkout-col--delivery .es-checkout-section__header {
    margin-bottom: 14px;
    padding-bottom: 12px;
}

#megabyte-theme .es-checkout-col--delivery .es-checkout-section__title {
    font-size: 16px;
}

#megabyte-theme .es-checkout-col--delivery .es-checkout-options {
    gap: 10px;
}

#megabyte-theme .es-checkout-col--delivery .es-checkout-option__card {
    padding: 12px 44px 12px 12px;
}

html[dir="rtl"] #megabyte-theme .es-checkout-col--delivery .es-checkout-option__card {
    padding: 12px 12px 12px 44px;
}

#megabyte-theme .es-checkout-col--delivery .es-checkout-option__icon {
    font-size: 28px;
}

/* Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬ Mobile checkout (Ã¢â€°Â¤1023px) Ã¢â‚¬â€ keep desktop 3-col untouched Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬ */
@media (max-width: 1023px) {
    #megabyte-theme .es-checkout-page {
        padding-bottom: calc(92px + env(safe-area-inset-bottom, 0));
    }

    #megabyte-theme .es-checkout-layout--3col {
        gap: 14px;
    }

    #megabyte-theme .es-checkout-mobile-step {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0 0 10px;
        font-size: 15px;
        font-weight: 700;
        color: #111827;
    }

    #megabyte-theme .es-checkout-mobile-step__num {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 9999px;
        background: var(--theme-primary, #00C897);
        color: #fff;
        font-size: 13px;
        font-weight: 800;
        flex-shrink: 0;
    }

    #megabyte-theme .es-checkout-col--address .es-checkout-section__title,
    #megabyte-theme .es-checkout-col--delivery .es-checkout-section__title {
        font-size: 16px;
    }

    #megabyte-theme .es-checkout-col--address .es-checkout-section__header,
    #megabyte-theme .es-checkout-col--delivery .es-checkout-section__header {
        margin-bottom: 14px;
        padding-bottom: 12px;
    }

    #megabyte-theme .es-checkout-col--delivery .es-checkout-card {
        padding: 16px;
    }

    #megabyte-theme .es-checkout-form input[type="text"],
    #megabyte-theme .es-checkout-form input[type="email"],
    #megabyte-theme .es-checkout-form input[type="number"],
    #megabyte-theme .es-checkout-form input[type="password"],
    #megabyte-theme .es-checkout-form select,
    #megabyte-theme .es-checkout-form textarea {
        min-height: 50px !important;
        font-size: 16px !important; /* Ã™Å Ã™â€¦Ã™â€ Ã˜Â¹ zoom Ã™ÂÃ™Å  iOS */
    }

    #megabyte-theme .es-checkout-option__card {
        min-height: 64px;
        padding: 14px 48px 14px 14px;
        gap: 12px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    html[dir="rtl"] #megabyte-theme .es-checkout-option__card {
        padding: 14px 14px 14px 48px;
    }

    #megabyte-theme .es-checkout-option__radio {
        font-size: 24px;
        padding: 8px;
    }

    #megabyte-theme .es-checkout-option__card--payment {
        min-height: 68px;
    }

    #megabyte-theme .es-checkout-mobile-summary__toggle {
        min-height: 56px;
        padding: 12px 14px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    #megabyte-theme .es-checkout-mobile-summary__start {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        flex: 1;
    }

    #megabyte-theme .es-checkout-mobile-summary__icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: rgba(0, 200, 151, .1);
        color: var(--theme-primary, #00C897);
        flex-shrink: 0;
    }

    #megabyte-theme .es-checkout-mobile-summary__icon svg {
        width: 20px;
        height: 20px;
    }

    #megabyte-theme .es-checkout-mobile-summary__end {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    #megabyte-theme .es-checkout-mobile-summary__chevron {
        width: 20px;
        height: 20px;
        color: #9ca3af;
        transition: transform .2s ease;
    }

    #megabyte-theme .es-checkout-mobile-summary__chevron.is-open {
        transform: rotate(180deg);
    }

    #megabyte-theme .es-checkout-mobile-summary__panel {
        max-height: 50vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #megabyte-theme .es-checkout-sticky-bar {
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0));
    }

    #megabyte-theme .es-checkout-sticky-bar__inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(130px, 42%);
        gap: 10px;
        align-items: stretch;
        max-width: none;
    }

    #megabyte-theme .es-checkout-sticky-bar__total {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
        padding-inline: 4px;
    }

    #megabyte-theme .es-checkout-sticky-bar__action {
        display: flex;
        align-items: stretch;
    }

    #megabyte-theme .es-checkout-btn--sticky {
        min-height: 50px !important;
        width: 100%;
    }

    #megabyte-theme .es-checkout-sticky-bar__action .paypal-button-container {
        min-width: 140px;
        max-width: 100%;
    }

    #megabyte-theme .es-checkout-sticky-bar__action .paypal-button-container iframe {
        max-width: 100% !important;
    }

    #megabyte-theme .es-checkout-btn:not(:disabled):hover {
        transform: none;
        box-shadow: none;
    }

    #megabyte-theme .es-checkout-btn:not(:disabled):active {
        transform: scale(0.98);
    }
}

@media (max-width: 380px) {
    #megabyte-theme .es-checkout-sticky-bar__inner {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    #megabyte-theme .es-checkout-sticky-bar__total {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding-inline: 2px;
    }
}

/* Progress steps (unused) */
#megabyte-theme .es-checkout-steps ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

#megabyte-theme .es-checkout-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 0 1 auto;
}

#megabyte-theme .es-checkout-step__dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    border: 2px solid #d1d5db;
    background: #fff;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 700;
    transition: all .2s ease;
}

#megabyte-theme .es-checkout-step__label {
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    white-space: nowrap;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 640px) {
    #megabyte-theme .es-checkout-step__label {
        font-size: 12px;
        max-width: none;
    }
}

#megabyte-theme .es-checkout-step.is-active .es-checkout-step__dot {
    border-color: var(--theme-primary, #00C897);
    background: var(--theme-primary, #00C897);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 200, 151, .15);
}

#megabyte-theme .es-checkout-step.is-active .es-checkout-step__label {
    color: #111827;
    font-weight: 600;
}

#megabyte-theme .es-checkout-step.is-done .es-checkout-step__dot {
    border-color: var(--theme-primary, #00C897);
    background: var(--theme-primary, #00C897);
    color: #fff;
}

#megabyte-theme .es-checkout-step.is-done .es-checkout-step__label {
    color: #374151;
}

#megabyte-theme .es-checkout-step__line {
    flex: 1 1 24px;
    height: 2px;
    min-width: 12px;
    max-width: 48px;
    background: #e5e7eb;
    margin-top: 15px;
    border-radius: 1px;
}

/* Cards */
#megabyte-theme .es-checkout-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
    padding: 24px;
}

@media (max-width: 639px) {
    #megabyte-theme .es-checkout-card {
        padding: 18px 16px;
        border-radius: 14px;
    }
}

#megabyte-theme .es-checkout-card--summary {
    padding: 20px;
}

#megabyte-theme .es-checkout-section + .es-checkout-section {
    margin-top: 16px;
}

#megabyte-theme .es-checkout-section__header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

#megabyte-theme .es-checkout-section__title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

#megabyte-theme .es-checkout-section__body {
    margin: 0;
}

/* Form fields */
#megabyte-theme .es-checkout-form .control-group,
#megabyte-theme .es-checkout-form [class*="control-group"] {
    margin-bottom: 16px !important;
}

#megabyte-theme .es-checkout-form label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 6px !important;
}

#megabyte-theme .es-checkout-form input[type="text"],
#megabyte-theme .es-checkout-form input[type="email"],
#megabyte-theme .es-checkout-form input[type="number"],
#megabyte-theme .es-checkout-form input[type="password"],
#megabyte-theme .es-checkout-form select,
#megabyte-theme .es-checkout-form textarea {
    min-height: 48px !important;
    border-radius: 10px !important;
    border-color: #e5e7eb !important;
    background: #fafbfc !important;
    font-size: 15px !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease !important;
}

#megabyte-theme .es-checkout-form input:focus,
#megabyte-theme .es-checkout-form select:focus,
#megabyte-theme .es-checkout-form textarea:focus {
    border-color: var(--theme-primary, #00C897) !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(0, 200, 151, .12) !important;
    outline: none !important;
}

#megabyte-theme .es-checkout-btn {
    min-height: 52px;
    letter-spacing: 0.01em;
    transition: transform .15s ease, box-shadow .15s ease;
}

#megabyte-theme .es-checkout-btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}

/* Shipping / payment options */
#megabyte-theme .es-checkout-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#megabyte-theme .es-checkout-option {
    position: relative;
}

#megabyte-theme .es-checkout-option__radio {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 22px;
    z-index: 2;
}

html[dir="ltr"] #megabyte-theme .es-checkout-option__radio {
    right: 16px;
}

html[dir="rtl"] #megabyte-theme .es-checkout-option__radio {
    left: 16px;
}

#megabyte-theme .es-checkout-option__card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 48px 16px 16px;
    border: 2px solid #e8eaed;
    border-radius: 12px;
    background: #fafbfc;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

html[dir="rtl"] #megabyte-theme .es-checkout-option__card {
    padding: 16px 16px 16px 48px;
}

#megabyte-theme .es-checkout-option__card:hover {
    border-color: #d1d5db;
    background: #fff;
}

#megabyte-theme .es-checkout-option .peer:checked ~ .es-checkout-option__card {
    border-color: var(--theme-primary, #00C897);
    background: rgba(0, 200, 151, .04);
    box-shadow: 0 0 0 1px var(--theme-primary, #00C897);
}

#megabyte-theme .es-checkout-option__icon {
    font-size: 36px;
    flex-shrink: 0;
}

#megabyte-theme .es-checkout-option__card--payment {
    min-height: 72px;
}

/* Mobile summary toggle */
#megabyte-theme .es-checkout-mobile-summary__toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
    cursor: pointer;
    text-align: inherit;
}

#megabyte-theme .es-checkout-mobile-summary__panel {
    margin-top: 8px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 14px;
}

#megabyte-theme .es-checkout-mobile-summary__panel .es-checkout-summary__title {
    display: none;
}

/* Sticky mobile place-order bar */
#megabyte-theme .es-checkout-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid #e8eaed;
    backdrop-filter: blur(8px);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, .08);
}

#megabyte-theme .es-checkout-sticky-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 640px;
    margin: 0 auto;
}

/* Summary in sidebar */
#megabyte-theme .es-checkout-sidebar .es-checkout-summary__title {
    font-size: 17px;
}

/* Hide duplicate accordion styles from default Bagisto on checkout */
#megabyte-theme .es-checkout-layout .accordion,
#megabyte-theme .es-checkout-layout [class*="accordion"] {
    background: transparent !important;
    border: none !important;
}

/* Mini-cart drawer is teleported to <body> Ã¢â‚¬â€ styles must be global */
.es-mini-cart-checkout-btn {
    align-items: center;
    background: #060C3B;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(6, 12, 59, 0.32);
    color: #ffffff !important;
    display: flex;
    font-size: 16px;
    font-weight: 700;
    gap: 12px;
    justify-content: center;
    min-height: 56px;
    padding: 16px 20px;
    text-decoration: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    width: 100%;
}

.es-mini-cart-checkout-btn:hover {
    background: #0a1147;
    box-shadow: 0 14px 32px rgba(6, 12, 59, 0.38);
    color: #ffffff !important;
    transform: translateY(-2px);
}

.es-mini-cart-checkout-btn:active {
    transform: scale(0.98);
}

.es-mini-cart-checkout-btn span {
    color: #ffffff;
}

/* Bazaro checkout â€” neutralize Bootstrap/main.css conflicts on Premium checkout */
#megabyte-theme .es-checkout-page {
    background-color: #f4f6f8;
    font-family: var(--es-font-rtl, var(--aq-ff-onest), system-ui, sans-serif);
}

#megabyte-theme .es-checkout-page .primary-button,
#megabyte-theme .es-checkout-page .es-checkout-btn.primary-button {
    background-color: var(--aq-common-black, #0f0f0f) !important;
    border-color: var(--aq-common-black, #0f0f0f) !important;
    color: #fff !important;
    border-radius: 12px !important;
}

#megabyte-theme .es-checkout-page .primary-button:hover:not(:disabled),
#megabyte-theme .es-checkout-page .es-checkout-btn.primary-button:hover:not(:disabled) {
    background-color: #222 !important;
    color: #fff !important;
}

/*
 * Bootstrap vs Tailwind utility clash:
 *   Bootstrap .px-5 = 3rem (48px)  â€” ruins Bagisto form controls
 *   Tailwind  .px-5 = 1.25rem (20px) â€” what control.blade.php expects
 * Same for .px-4 / .py-2 / .py-3. Scope overrides to checkout only.
 */
#megabyte-theme .es-checkout-page .px-5 {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}

#megabyte-theme .es-checkout-page .px-4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

#megabyte-theme .es-checkout-page .py-3 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

#megabyte-theme .es-checkout-page .py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

#megabyte-theme .es-checkout-form input[type="text"],
#megabyte-theme .es-checkout-form input[type="email"],
#megabyte-theme .es-checkout-form input[type="number"],
#megabyte-theme .es-checkout-form input[type="password"],
#megabyte-theme .es-checkout-form input[type="tel"],
#megabyte-theme .es-checkout-form select,
#megabyte-theme .es-checkout-form textarea {
    border-radius: 10px !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

@media (max-width: 525px) {
    #megabyte-theme .es-checkout-form input[type="text"],
    #megabyte-theme .es-checkout-form input[type="email"],
    #megabyte-theme .es-checkout-form input[type="number"],
    #megabyte-theme .es-checkout-form input[type="password"],
    #megabyte-theme .es-checkout-form input[type="tel"],
    #megabyte-theme .es-checkout-form select,
    #megabyte-theme .es-checkout-form textarea {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

#megabyte-theme .es-checkout-option .peer:checked ~ .es-checkout-option__card {
    border-color: var(--theme-primary, #FD8B4E);
    background: color-mix(in srgb, var(--theme-primary, #FD8B4E) 6%, white);
    box-shadow: 0 0 0 1px var(--theme-primary, #FD8B4E);
}

#megabyte-theme .es-checkout-mobile-step__num {
    background: var(--theme-primary, #FD8B4E);
}

#megabyte-theme .es-checkout-mobile-summary__icon {
    background: color-mix(in srgb, var(--theme-primary, #FD8B4E) 12%, white);
    color: var(--theme-primary, #FD8B4E);
}

#megabyte-theme .es-checkout-form input:focus,
#megabyte-theme .es-checkout-form select:focus,
#megabyte-theme .es-checkout-form textarea:focus {
    border-color: var(--theme-primary, #FD8B4E) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary, #FD8B4E) 18%, transparent) !important;
}
