/* Checkout — layout + reuse my-account field styles */

.stapler-checkout-page .entry-title {
    display: none;
}

.stapler-checkout-page .entry-content {
    margin-top: 32px;
}

@media (min-width: 1024px) {
    .stapler-checkout-page .entry-content {
        margin-top: 52px;
    }
}

.checkout-page__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    padding: 0 16px;
}

@media (min-width: 1024px) {
    .checkout-page__head {
        margin-bottom: 52px;
        padding: 0;
    }
}

.checkout-page__title {
    margin: 0;
    font-family: var(--second-family);
    font-weight: 600;
    font-size: 28px;
    line-height: 1.14;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--neutral-graphitic);
}

@media (min-width: 768px) {
    .checkout-page__title {
        font-size: 32px;
    }
}

@media (min-width: 1024px) {
    .checkout-page__title {
        font-size: 42px;
    }
}

.checkout-page__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--accent-gold);
}

.checkout-page__layout {
    display: grid;
    gap: 20px;
    align-items: start;
}

@media (min-width: 1100px) {
    .checkout-page__layout {
        grid-template-columns: minmax(0, 1fr) minmax(315px, 400px);
        gap: 24px;
    }
}

.checkout-page__customer {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.checkout-panel + .checkout-panel {
    margin-top: 0;
}

/* Shared with my-account panels */
.woocommerce-checkout .my-account-panel {
    border: 1px solid var(--gray-04-200);
    border-radius: 30px;
    background: var(--neutral-white);
    padding: 30px 20px;
}

.woocommerce-checkout .my-account-panel__head {
    margin-bottom: 20px;
}

.woocommerce-checkout .my-account-panel__title {
    font-family: var(--second-family);
    font-weight: 600;
    font-size: 28px;
    line-height: 114%;
    letter-spacing: -0.01em;
    color: var(--neutral-graphitic);
}

.woocommerce-checkout .woocommerce-form-row {
    margin-bottom: 0;
}

.woocommerce-checkout .my-account-panel__body .woocommerce-form-row label {
    display: block;
    font-weight: 500;
    font-size: 16px;
    line-height: 122%;
    letter-spacing: -0.01em;
    color: var(--neutral-graphitic);
    margin-bottom: 12px;
}

.woocommerce-checkout .my-account-panel .input-text,
.woocommerce-checkout .my-account-panel select,
.woocommerce-checkout .my-account-panel textarea {
    border: 1px solid var(--graphitic-100);
    border-radius: 100px;
    background: var(--gray-01-500);
    min-height: 52px;
    padding: 16px;
    width: 100%;
    font-weight: 400;
    font-size: 18px;
    line-height: 122%;
    letter-spacing: -0.01em;
    color: var(--neutral-graphitic);
}

.woocommerce-checkout .checkout-optional {
    font-weight: 400;
    color: var(--neutral-gray-04);
}

/* Contact grid: 3 + 2 columns */
.woocommerce-checkout .my-account-panel__body--contact {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .woocommerce-checkout .my-account-panel__body--contact {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 20px;
    }

    .woocommerce-checkout .my-account-panel__body--contact .form-row-middle {
        grid-column: auto;
    }
}

@media (min-width: 1024px) {
    .woocommerce-checkout .my-account-panel__body--contact {
        grid-template-columns: repeat(3, 1fr);
    }

    .woocommerce-checkout .my-account-panel__body--contact .form-row-last {
        grid-column: 3;
    }

    .woocommerce-checkout .my-account-panel__body--contact #billing_phone_field {
        grid-column: 1;
    }

    .woocommerce-checkout .my-account-panel__body--contact #billing_email_field {
        grid-column: 2 / span 2;
    }
}

@media (max-width: 1023.98px) {
    .woocommerce-checkout .my-account-panel__body--contact #billing_email_field {
        grid-column: auto;
    }
}

@media (min-width: 1240px) {
    .woocommerce-checkout .my-account-panel {
        padding: 52px;
        border-radius: 40px;
    }

    .woocommerce-checkout .my-account-panel__title {
        font-size: 32px;
    }
}

/* Shipping */
.woocommerce-checkout .checkout-ship-toggle {
    display: none;
}

.woocommerce-checkout .my-account-panel__body--shipping {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.woocommerce-checkout .my-account-panel__body--shipping .woocommerce-shipping-fields__field-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .woocommerce-checkout .my-account-panel__body--shipping .woocommerce-shipping-fields__field-wrapper {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 20px;
    }
}

.woocommerce-checkout .checkout-shipping-methods ul#shipping_method {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.woocommerce-checkout .checkout-shipping-methods ul#shipping_method li {
    margin: 0;
    padding: 0;
}

.woocommerce-checkout .checkout-shipping-methods ul#shipping_method li label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--graphitic-100);
    border-radius: 100px;
    background: var(--gray-01-500);
    min-height: 52px;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 500;
    font-size: 16px;
    color: var(--neutral-graphitic);
}

.woocommerce-checkout .checkout-shipping-methods ul#shipping_method li input {
    margin: 0 12px 0 0;
    accent-color: var(--primary-emerald);
}

/* Order sidebar */
.checkout-order-panel {
    border: 1px solid var(--green-light);
    border-radius: 20px;
    background: var(--green-light-500);
    padding: 24px 20px;
}

@media (min-width: 1100px) {
    .checkout-page__aside {
        position: sticky;
        top: 120px;
    }

    .checkout-order-panel {
        border-radius: 30px;
        padding: 32px 24px;
    }
}

.checkout-order-panel__title {
    margin: 0;
    font-family: var(--second-family);
    font-weight: 600;
    font-size: 24px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--neutral-graphitic);
}

.checkout-order-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}

.checkout-order-table tbody.checkout-order-items {
    display: table-row-group;
}

.checkout-order-table .checkout-order-item-row td {
    padding: 0 0 16px;
    border: 0;
    vertical-align: top;
}

.checkout-order-table tr.cart_item:not(.checkout-order-item-row) {
    display: none !important;
}

.checkout-order-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.checkout-order-item__thumb {
    border: 1px solid var(--graphitic-100);
    border-radius: 8px;
    overflow: hidden;
    width: 52px;
    height: 52px;
}

.checkout-order-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.checkout-order-item__name {
    font-family: var(--second-family);
    font-weight: 600;
    font-size: 16px;
    line-height: 1.25;
    color: var(--neutral-graphitic);
}

.checkout-order-item__content .variation,
.checkout-order-item__content dl {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--neutral-gray-04);
}

.checkout-order-item__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    font-weight: 600;
    font-size: 16px;
    color: var(--neutral-graphitic);
}

.checkout-order-item__qty {
    font-weight: 400;
    color: var(--neutral-gray-04);
}

.checkout-coupon-row td {
    padding: 0 0 20px !important;
    border: 0 !important;
}

/* Coupon */
.checkout-coupon {
    margin-bottom: 0;
}

.checkout-coupon .checkout_coupon {
    display: flex;
    align-items: stretch;
    border-radius: 100px;
    overflow: hidden;
    background: var(--neutral-white);
    border: 1px solid var(--graphitic-100);
}

.checkout-coupon__input {
    flex: 1;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    min-height: 48px !important;
    padding: 12px 16px !important;
    font-size: 16px !important;
}

.checkout-coupon__btn {
    flex-shrink: 0;
    border: 0;
    background: var(--graphitic-100);
    min-width: 56px;
    padding: 0 16px;
    font-weight: 600;
    font-size: 14px;
    color: var(--neutral-graphitic);
    cursor: pointer;
}

.checkout-order-table tbody.checkout-order-totals {
    display: table-row-group;
}

.checkout-order-table .checkout-order-totals th,
.checkout-order-table .checkout-order-totals td,
.checkout-order-totals th,
.checkout-order-totals td {
    padding: 8px 0;
    border: 0;
    font-size: 16px;
    line-height: 1.25;
    color: var(--neutral-graphitic);
    text-align: left;
    vertical-align: top;
}

.checkout-order-totals td {
    text-align: right;
    font-weight: 500;
}

.checkout-order-totals tr.order-total th,
.checkout-order-totals tr.order-total td {
    padding-top: 16px;
    border-top: 1px solid var(--graphitic-100);
    font-size: 18px;
    font-weight: 600;
}

.checkout-order-totals .checkout-order-totals__shipping-row td {
    font-weight: 400;
}

.checkout-order-totals table.shop_table::before {
    display: none;
}

/* Payment */
.checkout-payment .wc_payment_methods {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.checkout-payment .wc_payment_methods li {
    margin-bottom: 8px;
}

.checkout-place-order__btn {
    width: 100%;
    max-width: 100%;
    min-height: 52px;
    border-radius: 100px;
    justify-content: center;
}

.checkout-place-order__btn .primary-btn__text {
    font-weight: 600;
    font-size: 16px;
}

/* Hide default WC headings / coupon toggle */
.woocommerce-checkout .woocommerce-billing-fields > h3,
.woocommerce-checkout .woocommerce-shipping-fields > h3,
.woocommerce-checkout #order_review_heading {
    display: none;
}

.woocommerce-checkout .woocommerce-form-coupon-toggle {
    display: none !important;
}

.woocommerce-checkout .col2-set {
    display: contents;
}

.woocommerce-checkout .woocommerce-additional-fields {
    display: none;
}

.woocommerce-checkout .stapler-hidden-field,
.woocommerce-checkout #billing_country_field,
.woocommerce-checkout #shipping_country_field,
.woocommerce-checkout .form-row.stapler-hidden-field {
    display: none !important;
    margin: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

.woocommerce-checkout .my-account-panel--contact .woocommerce-billing-fields > :not(.woocommerce-billing-fields__field-wrapper) {
    display: none !important;
}

.woocommerce-checkout .checkout-shipping-fields .woocommerce-shipping-fields__field-wrapper:empty {
    display: none;
}
