/* ==========================================
   GLOBAL
========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f4f2ee;
    color: #171717;
}

h1,
h2,
h3,
h4 {
    font-family: 'Jost', sans-serif;
    text-transform: uppercase;
}

button,
input,
select {
    font: inherit;
}


/* ==========================================
   TOP BAR
========================================== */

.checkout-top-bar {
    background-color: #000000;
    color: #ffffff;
    padding: 9px 30px;
    text-align: center;
}

.checkout-top-bar a {
    color: #ffffff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

.checkout-top-bar a:hover {
    text-decoration: underline;
}


/* ==========================================
   HEADER
========================================== */

.checkout-header {
    min-height: 82px;
    padding: 0 40px;

    background-color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid #dfdcd6;
}

.checkout-logo {
    text-decoration: none;
    color: #000000;
}

.checkout-logo-main {
    display: block;

    font-family: 'Jost', sans-serif;
    font-size: 31px;
    font-weight: 700;
    line-height: 1;
}

.checkout-logo-sub {
    display: block;

    margin-top: 3px;

    color: #777777;

    font-size: 8px;
    font-weight: 700;

    letter-spacing: 2px;
}

.checkout-secure {
    display: flex;
    align-items: center;
    gap: 8px;

    color: #555555;

    font-family: 'Jost', sans-serif;
    font-size: 12px;
    font-weight: 600;

    letter-spacing: 0.7px;
}

.secure-icon {
    font-size: 14px;
}


/* ==========================================
   CHECKOUT PAGE
========================================== */

.checkout-page {
    width: 100%;
    padding: 55px 30px 80px;
}

.checkout-container {
    width: min(1180px, 100%);

    margin: 0 auto;

    display: grid;

    grid-template-columns:
        minmax(0, 1.35fr)
        minmax(340px, 0.85fr);

    gap: 45px;

    align-items: start;
}


/* ==========================================
   LEFT SIDE
========================================== */

.checkout-left {
    min-width: 0;
}

.checkout-title {
    margin-bottom: 28px;
}

.checkout-label {
    color: #9a7b5f;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 2px;
}

.checkout-title h1 {
    margin-top: 5px;

    color: #171717;

    font-size:
        clamp(38px, 5vw, 60px);

    line-height: 1;
}

.checkout-title p {
    margin-top: 10px;

    color: #706c67;

    font-size: 14px;

    line-height: 1.6;
}


/* ==========================================
   CHECKOUT CARDS
========================================== */

.checkout-card {
    background-color: #ffffff;

    border: 1px solid #dedbd5;

    border-radius: 10px;

    padding: 28px;

    margin-bottom: 20px;

    box-shadow:
        0 8px 30px
        rgba(0, 0, 0, 0.035);
}

.checkout-card-header {
    display: flex;
    align-items: flex-start;

    gap: 14px;

    margin-bottom: 25px;
}

.checkout-step-number {
    width: 34px;
    height: 34px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background-color: #171717;

    color: #ffffff;

    font-family: 'Jost', sans-serif;

    font-size: 14px;
    font-weight: 700;
}

.checkout-card-header h2 {
    color: #171717;

    font-size: 21px;

    line-height: 1.1;
}

.checkout-card-header p {
    margin-top: 4px;

    color: #87827c;

    font-size: 12px;

    line-height: 1.5;
}


/* ==========================================
   FORM
========================================== */

.checkout-row {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 15px;
}

.checkout-field {
    margin-bottom: 18px;
}

.checkout-field:last-child {
    margin-bottom: 0;
}

.checkout-field label {
    display: block;

    margin-bottom: 7px;

    color: #292929;

    font-size: 12px;
    font-weight: 700;
}

.checkout-field input,
.checkout-field select {
    width: 100%;

    min-height: 50px;

    padding: 0 14px;

    background-color: #faf9f7;

    color: #171717;

    border: 1px solid #d7d3cc;

    border-radius: 4px;

    outline: none;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

.checkout-field input::placeholder {
    color: #aaa59f;
}

.checkout-field input:focus,
.checkout-field select:focus {
    background-color: #ffffff;

    border-color: #171717;

    box-shadow:
        0 0 0 3px
        rgba(23, 23, 23, 0.06);
}

.checkout-field input.invalid,
.checkout-field select.invalid {
    border-color: #9a7b5f;

    background-color: #fff8f7;
}

.checkout-field-error {
    min-height: 15px;

    margin-top: 5px;

    color: #9a7b5f;

    font-size: 11px;
}


/* ==========================================
   SHIPPING OPTION
========================================== */

.shipping-option {
    position: relative;

    min-height: 78px;

    padding: 16px 18px;

    display: grid;

    grid-template-columns:
        auto
        auto
        1fr
        auto;

    align-items: center;

    gap: 12px;

    border: 1px solid #171717;

    border-radius: 6px;

    background-color: #faf9f7;

    cursor: pointer;
}

.shipping-option input {
    position: absolute;

    opacity: 0;

    pointer-events: none;
}

.shipping-option-circle {
    width: 18px;
    height: 18px;

    border-radius: 50%;

    border: 1px solid #77716b;

    background-color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;
}

.shipping-option input:checked +
.shipping-option-circle::after {
    content: '';

    width: 10px;
    height: 10px;

    border-radius: 50%;

    background-color: #9a7b5f;
}

.shipping-option-content {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.shipping-option-content strong {
    color: #171717;

    font-family: 'Jost', sans-serif;

    font-size: 14px;
}

.shipping-option-content small {
    margin-top: 3px;

    color: #817c76;

    font-size: 11px;

    line-height: 1.4;
}

.shipping-option-price {
    color: #171717;

    font-weight: 700;

    font-size: 13px;
}


/* ==========================================
   CHECKOUT MESSAGES
========================================== */

.checkout-message {
    display: none;

    margin-bottom: 18px;

    padding: 13px 15px;

    border-radius: 4px;

    font-size: 12px;

    line-height: 1.5;
}

.checkout-message.show {
    display: block;
}

.checkout-error-message {
    background-color: #fff0ef;

    border: 1px solid #e8b9b6;

    color: #9b2f2a;
}


/* ==========================================
   RIGHT SIDE
========================================== */

.checkout-right {
    min-width: 0;
}

.order-summary {
    position: sticky;

    top: 24px;

    background-color: #ffffff;

    border: 1px solid #dedbd5;

    border-radius: 10px;

    padding: 26px;

    box-shadow:
        0 14px 40px
        rgba(0, 0, 0, 0.055);
}

.order-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding-bottom: 18px;

    border-bottom: 1px solid #e2ded8;
}

.order-summary-header h2 {
    color: #171717;

    font-size: 24px;
}

.order-summary-header a {
    color: #66615c;

    font-size: 12px;

    text-decoration: underline;
}

.order-summary-header a:hover {
    color: #9a7b5f;
}


/* ==========================================
   EMPTY CART
========================================== */

.checkout-empty-cart {
    padding: 50px 10px;

    text-align: center;
}

.checkout-empty-cart h3 {
    color: #171717;

    font-size: 20px;

    margin-bottom: 8px;
}

.checkout-empty-cart p {
    max-width: 290px;

    margin: 0 auto 20px;

    color: #807b75;

    font-size: 13px;

    line-height: 1.6;
}

.checkout-shop-button {
    display: inline-flex;

    min-height: 46px;

    align-items: center;
    justify-content: center;

    padding: 0 22px;

    background-color: #171717;

    color: #ffffff;

    font-family: 'Jost', sans-serif;

    font-size: 13px;

    text-decoration: none;
}

.checkout-shop-button:hover {
    background-color: #9a7b5f;
}


/* ==========================================
   ORDER ITEMS
========================================== */

.checkout-order-items {
    width: 100%;
}

.checkout-order-item {
    display: grid;

    grid-template-columns:
        78px
        1fr
        auto;

    gap: 13px;

    align-items: center;

    padding: 18px 0;

    border-bottom: 1px solid #e4e1dc;
}

.checkout-order-image {
    position: relative;

    width: 78px;
    height: 88px;

    background-color: #f5f4f1;

    border: 1px solid #e7e3dd;

    display: flex;
    align-items: center;
    justify-content: center;
}

.checkout-order-image img {
    width: 100%;
    height: 100%;

    object-fit: contain;

    padding: 4px;
}

.checkout-item-quantity-badge {
    position: absolute;

    top: -7px;
    right: -7px;

    min-width: 22px;
    height: 22px;

    padding: 0 6px;

    border-radius: 999px;

    background-color: #171717;

    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 10px;
    font-weight: 700;
}

.checkout-order-info {
    min-width: 0;
}

.checkout-order-name {
    color: #171717;

    font-family: 'Jost', sans-serif;

    font-size: 15px;
    font-weight: 700;

    text-transform: uppercase;

    line-height: 1.25;
}

.checkout-order-size {
    margin-top: 4px;

    color: #807b75;

    font-size: 11px;
}

.checkout-order-unit-price {
    margin-top: 6px;

    color: #6c6761;

    font-size: 11px;
}

.checkout-order-line-total {
    color: #171717;

    font-family: 'Jost', sans-serif;

    font-size: 15px;
    font-weight: 700;

    white-space: nowrap;
}


/* ==========================================
   TOTALS
========================================== */

.checkout-totals {
    padding-top: 20px;
}

.checkout-total-line {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 11px;

    color: #66615c;

    font-size: 13px;
}

.checkout-total-divider {
    height: 1px;

    margin: 18px 0;

    background-color: #dfdcd6;
}

.checkout-grand-total {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 22px;
}

.checkout-grand-total > span {
    color: #171717;

    font-family: 'Jost', sans-serif;

    font-size: 19px;
    font-weight: 700;
}

.checkout-grand-total > div {
    display: flex;

    align-items: baseline;

    gap: 7px;
}

.checkout-grand-total small {
    color: #89847e;

    font-size: 10px;
}

.checkout-grand-total strong {
    color: #9a7b5f;

    font-family: 'Jost', sans-serif;

    font-size: 26px;
}


/* ==========================================
   CHECKOUT BUTTON
========================================== */

.checkout-submit {
    width: 100%;

    min-height: 58px;

    border: none;

    border-radius: 3px;

    background-color: #9a7b5f;

    color: #ffffff;

    font-family: 'Jost', sans-serif;

    font-size: 16px;
    font-weight: 700;

    letter-spacing: 0.4px;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        transform 0.15s ease;
}

.checkout-submit:hover {
    background-color: #7d6249;
}

.checkout-submit:active {
    transform: scale(0.995);
}

.checkout-submit:disabled {
    background-color: #aaaaaa;

    color: #eeeeee;

    cursor: not-allowed;
}

.checkout-submit-mobile {
    display: none;
}


/* ==========================================
   SECURITY INFO
========================================== */

.checkout-security-info {
    display: flex;

    align-items: flex-start;

    gap: 10px;

    margin-top: 15px;

    padding-top: 15px;

    border-top: 1px solid #e2ded8;
}

.checkout-security-info span {
    flex-shrink: 0;

    font-size: 13px;
}

.checkout-security-info p {
    color: #89847e;

    font-size: 10px;

    line-height: 1.55;
}


/* ==========================================
   FOOTER
========================================== */

.checkout-footer {
    background-color: #111111;

    color: #777777;

    padding: 26px 30px;
}

.checkout-footer > div {
    width: min(1180px, 100%);

    margin: 0 auto;

    display: flex;

    align-items: center;

    gap: 20px;

    font-size: 11px;
}

.checkout-footer a {
    color: #888888;

    text-decoration: none;
}

.checkout-footer a:hover {
    color: #ffffff;
}


/* ==========================================
   TABLET
========================================== */

@media (max-width: 900px) {

    .checkout-container {
        grid-template-columns: 1fr;

        gap: 30px;
    }

    .checkout-right {
        order: -1;
    }

    .order-summary {
        position: static;
    }

    .checkout-submit-desktop {
        display: none;
    }

    .checkout-submit-mobile {
        display: block;

        margin-top: 8px;
    }

}


/* ==========================================
   MOBILE
========================================== */

@media (max-width: 600px) {

    .checkout-top-bar {
        padding:
            8px 15px;
    }

    .checkout-header {
        min-height: 72px;

        padding:
            0 18px;
    }

    .checkout-logo-main {
        font-size: 27px;
    }

    .checkout-secure {
        font-size: 10px;
    }

    .checkout-page {
        padding:
            30px 14px
            55px;
    }

    .checkout-title {
        margin-bottom: 20px;
    }

    .checkout-title h1 {
        font-size: 42px;
    }

    .checkout-card {
        padding: 20px 17px;

        border-radius: 7px;
    }

    .checkout-row {
        grid-template-columns: 1fr;

        gap: 0;
    }

    .shipping-option {
        grid-template-columns:
            auto
            1fr
            auto;

        gap: 10px;
    }

    .shipping-option > input {
        display: none;
    }

    .shipping-option-content small {
        max-width: 190px;
    }

    .order-summary {
        padding: 20px 17px;

        border-radius: 7px;
    }

    .order-summary-header h2 {
        font-size: 21px;
    }

    .checkout-order-item {
        grid-template-columns:
            66px
            1fr;

        align-items: start;
    }

    .checkout-order-image {
        width: 66px;
        height: 76px;

        grid-row:
            1 / span 2;
    }

    .checkout-order-line-total {
        grid-column: 2;

        margin-top: -5px;
    }

    .checkout-footer {
        padding:
            24px 18px;
    }

    .checkout-footer > div {
        flex-direction: column;

        align-items: flex-start;

        gap: 9px;
    }

}

/* =====================================================
   BYTO – TEMA FÖR KASSAN
===================================================== */

body { background-color: #faf7f2; color: #1c1917; }
.checkout-header { border-bottom: 1px solid #e8dfd3; }
.checkout-logo { text-decoration: none; }
.checkout-logo-main { font-weight: 500; letter-spacing: 0.38em; color: #1c1917; font-size: 27px; }
.checkout-logo-sub { font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-weight: 400; font-size: 12px; letter-spacing: 0.08em; color: #9a7b5f; text-transform: none; }
.checkout-page h1, .checkout-page h2, .checkout-page h3 { font-weight: 500; letter-spacing: 0.06em; }


/* =====================================================
   BYTO – RABATTKOD I KASSAN
===================================================== */

.checkout-discount {
    padding: 20px 0 6px;
    border-top: 1px solid #e8dfd3;
}

.checkout-discount label {
    display: block;
    margin-bottom: 8px;
    color: #1c1917;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.checkout-discount-row {
    display: flex;
    gap: 8px;
}

.checkout-discount-row input {
    flex: 1;
    min-width: 0;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid #e8dfd3;
    background: #ffffff;
    color: #1c1917;
    font: 500 14px 'Inter', Arial, sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    outline: none;
}

.checkout-discount-row input::placeholder {
    text-transform: none;
    letter-spacing: 0;
    color: #a99d91;
}

.checkout-discount-row input:focus {
    border-color: #9a7b5f;
}

.checkout-discount-button {
    min-height: 46px;
    padding: 0 20px;
    border: 1px solid #1c1917;
    background: #1c1917;
    color: #ffffff;
    font: 600 11px 'Inter', Arial, sans-serif;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.checkout-discount-button:hover {
    background: #9a7b5f;
    border-color: #9a7b5f;
}

.checkout-discount-button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.checkout-discount-message {
    margin: 9px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: #7a6f65;
}

.checkout-discount-message.is-success {
    color: #3f6b48;
}

.checkout-discount-message.is-error {
    color: #a0412d;
}

.checkout-discount-line span:last-child {
    color: #3f6b48;
    font-weight: 600;
}

/* Dölj rabattraden när ingen rabattkod används */
.checkout-total-line[hidden] {
    display: none !important;
}


/* Nyhetsbrev i kassan */
.checkout-newsletter {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 4px 0 18px;
    padding: 14px 16px;
    border: 1px solid var(--byto-line, #e8dfd3);
    background: var(--byto-cream, #faf7f2);
    color: var(--byto-text, #3d3631);
    font: 400 14px/1.5 var(--byto-body, Inter, sans-serif);
    cursor: pointer;
}

.checkout-newsletter input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--byto-ink, #1c1917);
    cursor: pointer;
}

.checkout-newsletter small {
    display: block;
    margin-top: 2px;
    color: var(--byto-muted, #7a6f65);
    font-size: 12.5px;
}
