/* ============================================================
   EXPRESS SHOP CHECKOUT
   Fresh reusable checkout UI
============================================================ */

:root {
    --es-checkout-bg: #f6f8f7;
    --es-checkout-card: #ffffff;
    --es-checkout-border: #e5e9e7;
    --es-checkout-text: #202522;
    --es-checkout-muted: #737b76;
    --es-checkout-brand: var(--es-brand, #2f8f63);
    --es-checkout-brand-dark: var(--es-brand-dark, #23704d);
    --es-checkout-danger: #d9534f;
}


/* ============================================================
   PAGE
============================================================ */

.es-checkout-page {
    min-height: 100vh;

    background: var(--es-checkout-bg);

    color: var(--es-checkout-text);
}


/* ============================================================
   HEADER
============================================================ */

.es-checkout-header {
    position: sticky;
    top: 0;

    z-index: 100;

    background: rgba(255, 255, 255, .94);

    border-bottom: 1px solid var(--es-checkout-border);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.es-checkout-header-inner {
    width: min(1180px, calc(100% - 32px));

    min-height: 72px;

    margin: 0 auto;

    display: flex;
    align-items: center;

    gap: 22px;
}

.es-checkout-back {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    color: var(--es-checkout-muted);

    font-size: 13px;
    font-weight: 600;

    text-decoration: none;

    white-space: nowrap;
}

.es-checkout-back span:first-child {
    font-size: 20px;
    line-height: 1;
}

.es-checkout-back:hover {
    color: var(--es-checkout-brand-dark);
}

.es-checkout-title {
    padding-left: 22px;

    border-left: 1px solid var(--es-checkout-border);
}

.es-checkout-title h1 {
    margin: 0;

    font-size: 21px;
    line-height: 1.2;
    font-weight: 750;
}

.es-checkout-title span {
    display: block;

    margin-top: 3px;

    color: var(--es-checkout-muted);

    font-size: 11px;
}


/* ============================================================
   CONTAINER
============================================================ */

.es-checkout-container {
    width: min(1180px, calc(100% - 32px));

    margin: 0 auto;

    padding: 24px 0 50px;
}

.es-checkout-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        370px;

    align-items: start;

    gap: 22px;
}


/* ============================================================
   CHECKOUT CARD
============================================================ */

.es-checkout-card {
    margin-bottom: 18px;

    padding: 21px;

    background: var(--es-checkout-card);

    border: 1px solid var(--es-checkout-border);
    border-radius: 14px;

    box-shadow:
        0 2px 8px rgba(20, 35, 27, .025);
}

.es-checkout-card-header {
    display: flex;
    align-items: flex-start;

    gap: 12px;

    margin-bottom: 20px;
}

.es-checkout-step {
    width: 30px;
    height: 30px;

    flex: 0 0 30px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background: rgba(47, 143, 99, .10);

    color: var(--es-checkout-brand-dark);

    font-size: 13px;
    font-weight: 800;
}

.es-checkout-card-header h2 {
    margin: 0;

    font-size: 16px;
    line-height: 1.25;
    font-weight: 750;
}

.es-checkout-card-header p {
    margin: 4px 0 0;

    color: var(--es-checkout-muted);

    font-size: 11px;
}


/* ============================================================
   FORM GRID
============================================================ */

.es-checkout-form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 15px;
}

.es-checkout-field {
    min-width: 0;
}

.es-field-full {
    grid-column: 1 / -1;
}

.es-checkout-field label {
    display: flex;
    align-items: center;

    gap: 5px;

    margin-bottom: 6px;

    color: var(--es-checkout-text);

    font-size: 11px;
    font-weight: 650;
}

.es-checkout-field label span {
    color: var(--es-checkout-muted);

    font-size: 9px;
    font-weight: 500;
}

.es-checkout-field input,
.es-checkout-field textarea,
.es-checkout-field select {
    width: 100%;

    box-sizing: border-box;

    padding: 11px 12px;

    border: 1px solid var(--es-checkout-border);
    border-radius: 9px;

    outline: none;

    background: #fff;

    color: var(--es-checkout-text);

    font-family: inherit;
    font-size: 13px;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background .15s ease;
}

.es-checkout-field textarea {
    min-height: 86px;

    resize: vertical;

    line-height: 1.45;
}

.es-checkout-field input::placeholder,
.es-checkout-field textarea::placeholder {
    color: #a8aeaa;
}

.es-checkout-field input:focus,
.es-checkout-field textarea:focus,
.es-checkout-field select:focus {
    border-color: var(--es-checkout-brand);

    box-shadow:
        0 0 0 3px rgba(47, 143, 99, .08);
}

.es-checkout-field input[readonly] {
    background: #f7f9f8;

    cursor: default;
}

.es-checkout-field select:disabled {
    background: #f2f4f3;

    color: #a2a8a4;

    cursor: not-allowed;
}


/* ============================================================
   ERROR
============================================================ */

.es-checkout-error {
    display: block;

    min-height: 15px;

    margin-top: 4px;

    color: var(--es-checkout-danger);

    font-size: 10px;
}


/* ============================================================
   PINCODE STATUS
============================================================ */

.es-input-with-status {
    position: relative;
}

.es-input-with-status input {
    padding-right: 38px;
}

.es-input-status {
    position: absolute;

    top: 50%;
    right: 12px;

    width: 14px;
    height: 14px;

    transform: translateY(-50%);

    pointer-events: none;
}


/* ============================================================
   ADDRESS SECTION
============================================================ */

.es-address-section {
    padding: 16px;

    border: 1px solid var(--es-checkout-border);
    border-radius: 11px;

    background: #fbfcfb;
}

.es-address-section-title {
    display: flex;
    flex-direction: column;

    gap: 3px;

    margin-bottom: 15px;
}

.es-address-section-title strong {
    font-size: 12px;
    font-weight: 700;
}

.es-address-section-title span {
    color: var(--es-checkout-muted);

    font-size: 10px;
}


/* ============================================================
   DIFFERENT ADDRESS
============================================================ */

.es-different-address-toggle {
    display: flex;
    align-items: center;

    gap: 10px;

    margin-top: 16px;
    padding: 13px;

    border: 1px solid var(--es-checkout-border);
    border-radius: 10px;

    background: #fff;

    cursor: pointer;

    transition:
        border-color .15s ease,
        background .15s ease;
}

.es-different-address-toggle:hover {
    border-color: rgba(47, 143, 99, .35);

    background: #fbfdfc;
}

.es-checkbox-wrap {
    position: relative;

    width: 20px;
    height: 20px;

    flex: 0 0 20px;
}

.es-checkbox-wrap input {
    position: absolute;

    opacity: 0;

    width: 1px;
    height: 1px;
}

.es-custom-checkbox {
    position: absolute;
    inset: 0;

    display: block;

    border: 1px solid #cfd6d2;
    border-radius: 5px;

    background: #fff;
}

.es-checkbox-wrap input:checked + .es-custom-checkbox {
    border-color: var(--es-checkout-brand);

    background: var(--es-checkout-brand);
}

.es-checkbox-wrap input:checked + .es-custom-checkbox::after {
    content: "";

    position: absolute;

    left: 6px;
    top: 2px;

    width: 5px;
    height: 10px;

    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;

    transform: rotate(45deg);
}

.es-different-address-text {
    display: flex;
    flex-direction: column;

    gap: 3px;
}

.es-different-address-text strong {
    font-size: 12px;
}

.es-different-address-text small {
    color: var(--es-checkout-muted);

    font-size: 10px;
}


/* ============================================================
   SHIPPING ADDRESS
============================================================ */

.es-shipping-address {
    margin-top: 15px;
    padding: 16px;

    border: 1px solid var(--es-checkout-border);
    border-radius: 11px;

    background: #fbfcfb;
}

.es-shipping-address[hidden] {
    display: none;
}


/* ============================================================
   PAYMENT
============================================================ */

.es-payment-options {
    display: grid;

    gap: 10px;
}

.es-payment-option {
    position: relative;

    display: flex;
    align-items: center;

    gap: 11px;

    padding: 13px;

    border: 1px solid var(--es-checkout-border);
    border-radius: 10px;

    cursor: pointer;

    transition:
        border-color .15s ease,
        background .15s ease;
}

.es-payment-option:has(input:checked) {
    border-color: rgba(47, 143, 99, .55);

    background: rgba(47, 143, 99, .035);
}

.es-payment-option input {
    position: absolute;

    opacity: 0;
}

.es-payment-radio {
    width: 18px;
    height: 18px;

    flex: 0 0 18px;

    border: 1px solid #cbd2ce;
    border-radius: 50%;
}

.es-payment-option input:checked + .es-payment-radio {
    border: 5px solid var(--es-checkout-brand);
}

.es-payment-content {
    display: flex;
    flex-direction: column;

    gap: 3px;
}

.es-payment-content strong {
    font-size: 12px;
}

.es-payment-content small {
    color: var(--es-checkout-muted);

    font-size: 10px;
}


/* ============================================================
   SUMMARY
============================================================ */

.es-checkout-summary {
    position: sticky;
    top: 94px;
}

.es-checkout-summary-card {
    overflow: hidden;

    background: #fff;

    border: 1px solid var(--es-checkout-border);
    border-radius: 14px;

    box-shadow:
        0 2px 10px rgba(20, 35, 27, .035);
}

.es-summary-header {
    padding: 18px;

    border-bottom: 1px solid var(--es-checkout-border);
}

.es-summary-header h2 {
    margin: 0;

    font-size: 16px;
    font-weight: 750;
}

.es-summary-header span {
    display: block;

    margin-top: 4px;

    color: var(--es-checkout-muted);

    font-size: 10px;
}


/* ============================================================
   SUMMARY PRODUCTS
============================================================ */

.es-checkout-products {
    max-height: 360px;

    overflow-y: auto;

    padding: 6px 15px;
}

.es-checkout-product {
    display: flex;

    gap: 9px;

    padding: 10px 0;

    border-bottom: 1px solid var(--es-checkout-border);
}

.es-checkout-product:last-child {
    border-bottom: 0;
}

.es-checkout-product-image {
    width: 48px;
    height: 48px;

    flex: 0 0 48px;

    overflow: hidden;

    border: 1px solid var(--es-checkout-border);
    border-radius: 7px;

    background: #f7f8f7;
}

.es-checkout-product-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.es-checkout-product-info {
    min-width: 0;
    flex: 1;
}

.es-checkout-product-name {
    display: -webkit-box;

    overflow: hidden;

    font-size: 11px;
    line-height: 1.35;
    font-weight: 650;

    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.es-checkout-product-meta {
    margin-top: 4px;

    color: var(--es-checkout-muted);

    font-size: 9px;
}

.es-checkout-product-total {
    align-self: center;

    color: var(--es-checkout-text);

    font-size: 11px;
    font-weight: 700;

    white-space: nowrap;
}


/* ============================================================
   TOTALS
============================================================ */

.es-checkout-totals {
    margin: 0 15px;

    padding: 13px 0;

    border-top: 1px solid var(--es-checkout-border);
}

.es-checkout-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 28px;

    color: var(--es-checkout-muted);

    font-size: 11px;
}

.es-checkout-total-row strong {
    color: var(--es-checkout-text);

    font-size: 12px;
}

.es-checkout-saving {
    color: var(--es-checkout-brand-dark) !important;
}

.es-checkout-payable {
    margin-top: 5px;
    padding-top: 10px;

    border-top: 1px dashed var(--es-checkout-border);

    color: var(--es-checkout-text);

    font-size: 13px;
}

.es-checkout-payable strong {
    font-size: 20px;
    font-weight: 800;
}


/* ============================================================
   PLACE ORDER
============================================================ */

.es-place-order {
    width: calc(100% - 30px);

    min-height: 47px;

    margin: 0 15px 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    border: 0;
    border-radius: 10px;

    background: var(--es-checkout-brand);

    color: #fff;

    font-family: inherit;

    font-size: 13px;
    font-weight: 750;

    cursor: pointer;

    transition:
        transform .15s ease,
        opacity .15s ease;
}

.es-place-order:hover {
    background: var(--es-checkout-brand-dark);
}

.es-place-order:active {
    transform: scale(.985);
}

.es-place-order:disabled {
    opacity: .45;

    cursor: not-allowed;
}


/* ============================================================
   SECURE
============================================================ */

.es-checkout-secure {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 5px;

    padding: 0 15px 15px;

    color: var(--es-checkout-muted);

    font-size: 9px;
}


/* ============================================================
   TABLET
============================================================ */

@media (max-width: 900px) {

    .es-checkout-layout {
        grid-template-columns: 1fr;
    }

    .es-checkout-summary {
        position: static;
    }

    .es-checkout-summary-card {
        margin-top: 0;
    }

    .es-checkout-products {
        max-height: none;
    }
}


/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 600px) {

    .es-checkout-header-inner {
        width: calc(100% - 24px);

        min-height: 62px;

        gap: 12px;
    }

    .es-checkout-back {
        font-size: 0;
    }

    .es-checkout-back span:first-child {
        font-size: 22px;
    }

    .es-checkout-title {
        padding-left: 12px;
    }

    .es-checkout-title h1 {
        font-size: 18px;
    }

    .es-checkout-title span {
        font-size: 10px;
    }

    .es-checkout-container {
        width: calc(100% - 20px);

        padding-top: 12px;
        padding-bottom: 30px;
    }

    .es-checkout-card {
        margin-bottom: 12px;

        padding: 15px;

        border-radius: 12px;
    }

    .es-checkout-card-header {
        margin-bottom: 16px;
    }

    .es-checkout-form-grid {
        grid-template-columns: 1fr;

        gap: 12px;
    }

    .es-field-full {
        grid-column: auto;
    }

    .es-address-section,
    .es-shipping-address {
        padding: 12px;
    }

    .es-checkout-summary-card {
        border-radius: 12px;
    }

    .es-summary-header {
        padding: 15px;
    }
}


/* ============================================================
   SMALL MOBILE
============================================================ */

@media (max-width: 380px) {

    .es-checkout-container {
        width: calc(100% - 14px);
    }

    .es-checkout-card {
        padding: 13px;
    }

    .es-checkout-field input,
    .es-checkout-field textarea,
    .es-checkout-field select {
        font-size: 12px;
    }

    .es-checkout-payable strong {
        font-size: 18px;
    }
}

.es-checkout-page {
   min-height: auto;
}

/* ============================================================
   DELIVERY OPTIONS
============================================================ */

.es-delivery-options {
    margin-top: 16px;
}


.es-delivery-options .es-checkout-card-header {
    padding-bottom: 14px;
}


.es-delivery-options .es-checkout-card-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}


.es-delivery-options .es-checkout-card-title > i {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: #eefaf5;

    color: #35b779;

    font-size: 17px;

    flex: 0 0 38px;
}


.es-delivery-options .es-checkout-card-title h4 {
    margin: 0;

    font-size: 16px;

    font-weight: 600;

    color: #253d4e;
}


.es-delivery-options .es-checkout-card-title p {
    margin: 3px 0 0;

    font-size: 12px;

    color: #8a98a5;
}


/* ------------------------------------------------------------
   Delivery option row
------------------------------------------------------------ */

.es-delivery-option {
    position: relative;

    display: flex;

    align-items: flex-start;

    gap: 12px;

    width: 100%;

    padding: 15px 16px;

    border: 1px solid #e5e9ec;

    border-radius: 10px;

    background: #fff;

    cursor: pointer;

    transition:
        border-color .2s ease,
        background-color .2s ease,
        box-shadow .2s ease;
}


.es-delivery-option:hover {
    border-color: #b9dfce;

    background: #fbfefd;
}


/* ------------------------------------------------------------
   Hide browser checkbox
------------------------------------------------------------ */

.es-delivery-option input {
    position: absolute;

    opacity: 0;

    pointer-events: none;
}


/* ------------------------------------------------------------
   Custom checkbox
------------------------------------------------------------ */

.es-custom-checkbox {
    position: relative;

    width: 20px;
    height: 20px;

    flex: 0 0 20px;

    margin-top: 1px;

    border: 1.5px solid #cfd8df;

    border-radius: 5px;

    background: #fff;

    transition:
        background-color .2s ease,
        border-color .2s ease;
}


/* Check mark */

.es-custom-checkbox::after {
    content: "";

    position: absolute;

    left: 6px;
    top: 2px;

    width: 5px;
    height: 10px;

    border: solid #fff;

    border-width: 0 2px 2px 0;

    transform: rotate(45deg) scale(0);

    transition: transform .15s ease;
}


/* ------------------------------------------------------------
   Checked state
------------------------------------------------------------ */

.es-delivery-option input:checked + .es-custom-checkbox {
    background: #35b779;

    border-color: #35b779;
}


.es-delivery-option input:checked + .es-custom-checkbox::after {
    transform: rotate(45deg) scale(1);
}


.es-delivery-option:has(input:checked) {
    border-color: #9ed9c2;

    background: #f7fcfa;

    box-shadow: 0 2px 8px rgba(53, 183, 121, .06);
}


/* ------------------------------------------------------------
   Text
------------------------------------------------------------ */

.es-delivery-option-content {
    display: flex;

    flex-direction: column;

    gap: 3px;

    min-width: 0;
}


.es-delivery-option-content strong {
    font-size: 13px;

    font-weight: 600;

    line-height: 1.4;

    color: #253d4e;
}


.es-delivery-option-content small {
    font-size: 11px;

    line-height: 1.5;

    color: #8a98a5;
}


/* ------------------------------------------------------------
   Mobile
------------------------------------------------------------ */

@media (max-width: 767px) {

    .es-delivery-options {
        margin-top: 12px;
    }


    .es-delivery-option {
        padding: 13px;

        gap: 10px;
    }


    .es-delivery-option-content strong {
        font-size: 12px;
    }


    .es-delivery-option-content small {
        font-size: 10px;
    }

}

.checkout-terms {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
}

.checkout-terms input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    accent-color: #2f9e68;
}

.checkout-terms span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.checkout-terms a {
    color: #2f9e68;
    font-weight: 600;
    text-decoration: none;
}

.checkout-terms a:hover {
    text-decoration: underline;
}