body[data-checkout-page] .checkout-contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body[data-checkout-page] .checkout-address-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: start !important;
}

body[data-checkout-page] .checkout-address-grid.is-two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body[data-checkout-page] .checkout-field[hidden] {
    display: none !important;
}

body[data-checkout-page] .checkout-postal-field small {
    order: 3;
    margin: -2px 0 0 !important;
    color: #7d878d;
    font-size: 11px !important;
    line-height: 1.25 !important;
}

body[data-checkout-page] .checkout-postal-field .commerce-input {
    order: 2;
}

body[data-checkout-page]:not(.checkout-validation-started) .checkout-field input:invalid,
body[data-checkout-page]:not(.checkout-validation-started) .checkout-field textarea:invalid,
body[data-checkout-page]:not(.checkout-validation-started) .checkout-field select:invalid {
    border-color: rgba(7,21,28,.14) !important;
    background: #fff !important;
    box-shadow: inset 0 1px 0 rgba(7,21,28,.025) !important;
}

body[data-checkout-page]:not(.checkout-validation-started) .checkout-field:hover .commerce-input {
    border-color: rgba(240,177,55,.45) !important;
}

body[data-checkout-page]:not(.checkout-validation-started) .checkout-field .commerce-input:focus {
    border-color: #F0B137 !important;
    box-shadow: 0 0 0 3px rgba(240,177,55,.18) !important;
}

body[data-checkout-page].checkout-validation-started .checkout-field input:invalid,
body[data-checkout-page].checkout-validation-started .checkout-field textarea:invalid,
body[data-checkout-page].checkout-validation-started .checkout-field select:invalid {
    border-color: rgba(192,57,43,.72) !important;
    background:
        linear-gradient(90deg, rgba(192,57,43,.10), transparent 30%),
        #fff !important;
    box-shadow: inset 4px 0 0 rgba(192,57,43,.62) !important;
}

body[data-checkout-page] .checkout-field.is-invalid-pulse .commerce-input,
body[data-checkout-page] .checkout-option.is-invalid-pulse,
body[data-checkout-page] .checkout-inline-check.is-invalid-pulse,
body[data-checkout-page] .checkout-agreement.is-invalid-pulse {
    animation: checkoutInvalidPulse .9s ease both;
    border-color: rgba(192,57,43,.82) !important;
    background:
        linear-gradient(90deg, rgba(192,57,43,.14), transparent 30%),
        #fff !important;
    box-shadow: inset 4px 0 0 rgba(192,57,43,.72), 0 0 0 3px rgba(192,57,43,.10) !important;
}

body[data-checkout-page] .checkout-field.is-invalid-pulse > span:first-child,
body[data-checkout-page] .checkout-agreement.is-invalid-pulse > span {
    color: #9f2f26 !important;
}

body[data-checkout-page] .checkout-option,
body[data-checkout-page] .checkout-inline-check,
body[data-checkout-page] .checkout-agreement {
    display: grid !important;
    grid-template-columns: 20px minmax(0, 1fr) !important;
    gap: 12px !important;
    align-items: center !important;
    width: 100% !important;
    margin: 10px 0 0 !important;
    padding: 14px 16px !important;
    border: 1px solid rgba(7,21,28,.08) !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    color: #07151c !important;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}

body[data-checkout-page] .checkout-option:hover,
body[data-checkout-page] .checkout-inline-check:hover,
body[data-checkout-page] .checkout-agreement:hover {
    border-color: rgba(240,177,55,.45) !important;
    transform: none !important;
}

body[data-checkout-page] .checkout-option:focus-within,
body[data-checkout-page] .checkout-inline-check:focus-within,
body[data-checkout-page] .checkout-agreement:focus-within {
    border-color: #F0B137 !important;
    box-shadow: 0 0 0 3px rgba(240,177,55,.18) !important;
    transform: none !important;
}

body[data-checkout-page] .checkout-option input,
body[data-checkout-page] .checkout-inline-check input,
body[data-checkout-page] .checkout-agreement input {
    margin: 2px 0 0 !important;
}

body[data-checkout-page] .checkout-option > span,
body[data-checkout-page] .checkout-inline-check > span,
body[data-checkout-page] .checkout-agreement > span {
    display: block !important;
    min-width: 0 !important;
    overflow: visible !important;
}

@keyframes checkoutInvalidPulse {
    0% { transform: translateX(0); }
    18% { transform: translateX(-3px); }
    36% { transform: translateX(3px); }
    54% { transform: translateX(-2px); }
    72% { transform: translateX(2px); }
    100% { transform: translateX(0); }
}

@media (max-width: 900px) {
    body[data-checkout-page] .checkout-address-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    body[data-checkout-page] .checkout-contact-grid,
    body[data-checkout-page] .checkout-address-grid {
        grid-template-columns: 1fr !important;
    }
}

html[data-theme="dark"] body[data-checkout-page] .checkout-field .commerce-input,
html[data-theme="dark"] body[data-checkout-page] .checkout-field select.commerce-input,
html[data-theme="dark"] body[data-checkout-page] .checkout-field textarea.commerce-input,
html[data-theme="dark"] body[data-checkout-page]:not(.checkout-validation-started) .checkout-field input:invalid,
html[data-theme="dark"] body[data-checkout-page]:not(.checkout-validation-started) .checkout-field textarea:invalid,
html[data-theme="dark"] body[data-checkout-page]:not(.checkout-validation-started) .checkout-field select:invalid {
    border-color: rgba(247,242,231,.16) !important;
    background: rgba(255,255,255,.065) !important;
    color: #f7f2e7 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035) !important;
}

html[data-theme="dark"] body[data-checkout-page] .checkout-field .commerce-input::placeholder {
    color: rgba(247,242,231,.38) !important;
}

html[data-theme="dark"] body[data-checkout-page] .checkout-field:hover .commerce-input {
    border-color: rgba(240,177,55,.5) !important;
}

html[data-theme="dark"] body[data-checkout-page] .checkout-field .commerce-input:focus {
    border-color: #F0B137 !important;
    box-shadow: 0 0 0 3px rgba(240,177,55,.22) !important;
}

html[data-theme="dark"] body[data-checkout-page].checkout-validation-started .checkout-field input:invalid,
html[data-theme="dark"] body[data-checkout-page].checkout-validation-started .checkout-field textarea:invalid,
html[data-theme="dark"] body[data-checkout-page].checkout-validation-started .checkout-field select:invalid {
    border-color: rgba(218,88,74,.82) !important;
    background:
        linear-gradient(90deg, rgba(218,88,74,.16), transparent 30%),
        rgba(255,255,255,.065) !important;
    box-shadow: inset 4px 0 0 rgba(218,88,74,.72) !important;
}

html[data-theme="dark"] body[data-checkout-page] .checkout-combobox-list {
    top: calc(100% + 6px) !important;
    right: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    padding: 6px 20px 6px 6px !important;
    border: 1px solid rgba(253,185,18,.22) !important;
    border-radius: 12px !important;
    background: #061f26 !important;
    background-clip: padding-box !important;
    box-shadow: 0 18px 42px rgba(0,0,0,.34) !important;
    scrollbar-width: none;
}

html[data-theme="dark"] body[data-checkout-page] .checkout-combobox-list::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
}

html[data-theme="dark"] body[data-checkout-page] .checkout-combobox-list::-webkit-scrollbar-track {
    background: transparent !important;
}

html[data-theme="dark"] body[data-checkout-page] .checkout-combobox-list::-webkit-scrollbar-track-piece,
html[data-theme="dark"] body[data-checkout-page] .checkout-combobox-list::-webkit-scrollbar-corner {
    background: transparent !important;
}

html[data-theme="dark"] body[data-checkout-page] .checkout-combobox-list::-webkit-scrollbar-thumb {
    background: transparent !important;
}

body[data-checkout-page] .checkout-scroll-thumb {
    position: absolute;
    top: calc(100% + 16px);
    right: 8px;
    z-index: 22;
    width: 7px;
    border-radius: 999px;
    background: var(--primary);
    pointer-events: none;
    transform: translateY(0);
}

body[data-checkout-page] .checkout-scroll-thumb[hidden] {
    display: none !important;
}

html[data-theme="dark"] body[data-checkout-page] .checkout-combobox-list button,
html[data-theme="dark"] body[data-checkout-page] .checkout-combobox-empty {
    color: #f7f2e7 !important;
}

html[data-theme="dark"] body[data-checkout-page] .checkout-combobox-list button:hover,
html[data-theme="dark"] body[data-checkout-page] .checkout-combobox-list button[aria-selected="true"] {
    background: rgba(253,185,18,.14) !important;
    color: var(--primary) !important;
}

/* Onay kutusunun altındaki sözleşme bağlantıları. Cümle i18n sözlüğünde tam
   cümle olarak bulunduğu için bağlantılar metnin içine değil altına konur. */
.checkout-agreement-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 6px 0 0 30px;
    font-size: 13px;
}
.checkout-agreement-links a {
    color: var(--cta-petrol, #055a57);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}
html[data-theme="dark"] .checkout-agreement-links a {
    color: var(--he-gold, #fdb912);
}

/* Checkout submit feedback: sipariş kaydı sürerken donmuş ekran hissini önler. */
body[data-checkout-page].checkout-submitting {
    overflow: hidden;
}

body[data-checkout-page] .checkout-processing-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: rgba(7, 21, 28, .42);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
}

body[data-checkout-page] .checkout-processing-overlay[hidden] {
    display: none !important;
}

body[data-checkout-page] .checkout-processing-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

body[data-checkout-page] .checkout-processing-card {
    width: min(440px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 22px;
    border: 1px solid rgba(240, 177, 55, .30);
    border-radius: 18px;
    background: rgba(255, 255, 255, .985);
    color: #07151c;
    box-shadow: 0 24px 70px rgba(7, 21, 28, .24);
    transform: translateY(8px) scale(.985);
    transition: transform .18s ease;
}

body[data-checkout-page] .checkout-processing-overlay.is-visible .checkout-processing-card {
    transform: translateY(0) scale(1);
}

body[data-checkout-page] .checkout-processing-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(240, 177, 55, .34);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(240, 177, 55, .18), rgba(240, 177, 55, .06));
    color: #b77700;
}

body[data-checkout-page] .checkout-processing-icon svg {
    width: 30px;
    height: 30px;
}

body[data-checkout-page] .checkout-processing-copy {
    min-width: 0;
    display: grid;
    gap: 5px;
}

body[data-checkout-page] .checkout-processing-copy strong {
    font-size: 18px;
    line-height: 1.25;
    font-weight: 800;
    color: #07151c;
}

body[data-checkout-page] .checkout-processing-copy span {
    font-size: 13.5px;
    line-height: 1.5;
    color: #536168;
}

body[data-checkout-page] .checkout-processing-copy small {
    font-size: 12px;
    line-height: 1.45;
    color: #7a858b;
}

body[data-checkout-page] .checkout-processing-progress {
    grid-column: 1 / -1;
    position: relative;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(240, 177, 55, .18);
}

body[data-checkout-page] .checkout-processing-progress > span {
    position: absolute;
    inset: 0 auto 0 0;
    width: 42%;
    border-radius: inherit;
    background: linear-gradient(90deg, #d99a00, #F0B137, #ffd46c);
    animation: heCheckoutProgress 1.15s ease-in-out infinite;
}

body[data-checkout-page] .summary-checkout.is-processing {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 9px !important;
    cursor: wait !important;
    opacity: 1 !important;
}

body[data-checkout-page] .checkout-submit-spinner {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    border: 2px solid rgba(7, 21, 28, .22);
    border-top-color: #07151c;
    border-radius: 50%;
    animation: heCheckoutSpin .72s linear infinite;
}

html[data-theme="dark"] body[data-checkout-page] .checkout-processing-overlay {
    background: rgba(0, 7, 10, .62);
}

html[data-theme="dark"] body[data-checkout-page] .checkout-processing-card {
    border-color: rgba(240, 177, 55, .28);
    background: #08232a;
    color: #f7f2e7;
    box-shadow: 0 26px 80px rgba(0, 0, 0, .46);
}

html[data-theme="dark"] body[data-checkout-page] .checkout-processing-icon {
    border-color: rgba(240, 177, 55, .30);
    background: rgba(240, 177, 55, .10);
    color: #F0B137;
}

html[data-theme="dark"] body[data-checkout-page] .checkout-processing-copy strong {
    color: #f7f2e7;
}

html[data-theme="dark"] body[data-checkout-page] .checkout-processing-copy span {
    color: #cad4d7;
}

html[data-theme="dark"] body[data-checkout-page] .checkout-processing-copy small {
    color: #9eacb0;
}

@keyframes heCheckoutSpin {
    to { transform: rotate(360deg); }
}

@keyframes heCheckoutProgress {
    0% { transform: translateX(-110%); }
    55% { transform: translateX(95%); }
    100% { transform: translateX(245%); }
}

@media (max-width: 520px) {
    body[data-checkout-page] .checkout-processing-card {
        width: min(100%, 380px);
        grid-template-columns: 50px minmax(0, 1fr);
        gap: 13px;
        padding: 18px;
        border-radius: 16px;
    }

    body[data-checkout-page] .checkout-processing-icon {
        width: 50px;
        height: 50px;
        border-radius: 14px;
    }

    body[data-checkout-page] .checkout-processing-icon svg {
        width: 26px;
        height: 26px;
    }

    body[data-checkout-page] .checkout-processing-copy strong {
        font-size: 16px;
    }

    body[data-checkout-page] .checkout-processing-copy span {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body[data-checkout-page] .checkout-processing-overlay,
    body[data-checkout-page] .checkout-processing-card {
        transition: none;
    }

    body[data-checkout-page] .checkout-processing-progress > span,
    body[data-checkout-page] .checkout-submit-spinner {
        animation-duration: 1.8s;
    }
}


/* Checkout saved addresses: tekilleştirilen son adres + açılır geçmiş adresler. */
body[data-checkout-page] .checkout-saved-address-list {
    display: block;
    margin-top: 12px;
}

body[data-checkout-page] .checkout-saved-primary > .checkout-saved-address-card {
    width: 100%;
}

body[data-checkout-page] .checkout-saved-address-card .checkout-saved-street {
    margin-top: 7px;
    color: #536168;
    font-weight: 800;
}

body[data-checkout-page] .checkout-saved-more {
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid rgba(7, 21, 28, .10);
    border-radius: 12px;
    background: rgba(255, 255, 255, .58);
}

body[data-checkout-page] .checkout-saved-more > summary {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 13px;
    color: #07151c;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

body[data-checkout-page] .checkout-saved-more > summary::-webkit-details-marker {
    display: none;
}

body[data-checkout-page] .checkout-saved-more > summary::after {
    content: '';
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .18s ease;
}

body[data-checkout-page] .checkout-saved-more[open] > summary::after {
    transform: rotate(225deg) translate(-2px, -2px);
}

body[data-checkout-page] .checkout-saved-more > summary strong {
    min-width: 26px;
    height: 26px;
    display: inline-grid;
    place-items: center;
    margin-left: 4px;
    border-radius: 999px;
    background: #fff4d8;
    color: #8a5a00;
    font-size: 12px;
}

body[data-checkout-page] .checkout-saved-more-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-height: 330px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 10px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(240, 177, 55, .72) transparent;
}

body[data-checkout-page] .checkout-saved-more-list::-webkit-scrollbar {
    width: 6px;
}

body[data-checkout-page] .checkout-saved-more-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(240, 177, 55, .72);
}

html[data-theme="dark"] body[data-checkout-page] .checkout-saved-address-card .checkout-saved-street {
    color: #b9c1c5;
}

html[data-theme="dark"] body[data-checkout-page] .checkout-saved-more {
    border-color: rgba(240, 177, 55, .18);
    background: rgba(255, 255, 255, .035);
}

html[data-theme="dark"] body[data-checkout-page] .checkout-saved-more > summary {
    color: #f7f2e7;
}

html[data-theme="dark"] body[data-checkout-page] .checkout-saved-more > summary strong {
    background: rgba(240, 177, 55, .14);
    color: #f6c85d;
}

@media (max-width: 760px) {
    body[data-checkout-page] .checkout-saved-more-list {
        grid-template-columns: 1fr;
        max-height: 285px;
    }
}
