﻿/* =========================================================
   CRAZYNUTS CART
   Responsive desktop / tablet / mobile
   ========================================================= */

.cn-cart {
    box-sizing: border-box;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px;
    color: #171717;
}

    .cn-cart *,
    .cn-cart *::before,
    .cn-cart *::after {
        box-sizing: border-box;
    }


/* =========================================================
   HEADER
   ========================================================= */

.cn-cart__head {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.cn-cart__title {
    min-width: 0;
    margin: 0;
    color: #951f1f;
    font-size: clamp(26px, 4vw, 32px);
    font-weight: 900;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.cn-cart__link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid rgba(149, 31, 31, .25);
    border-radius: 12px;
    background: #fff;
    color: #951f1f;
    text-decoration: none;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
}

    .cn-cart__link:hover {
        background: rgba(149, 31, 31, .06);
    }

    .cn-cart__link:focus-visible {
        outline: 3px solid rgba(149, 31, 31, .18);
        outline-offset: 2px;
    }


/* =========================================================
   MAIN GRID
   ========================================================= */

.cn-cart__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 16px;
    align-items: start;
}

.cn-cart__list,
.cn-cart__summary {
    min-width: 0;
}


/* =========================================================
   CART ITEM
   ========================================================= */

.cn-cartItem {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    min-width: 0;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 16px;
    background: #fff;
}

.cn-cartItem__img {
    min-width: 0;
}

    .cn-cartItem__img img {
        display: block;
        width: 92px;
        height: 92px;
        max-width: 100%;
        object-fit: contain;
        border: 1px solid rgba(0, 0, 0, .06);
        border-radius: 14px;
        background: #fff;
    }

.cn-cartItem__mid {
    min-width: 0;
}

.cn-cartItem__top {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.cn-cartItem__name {
    min-width: 0;
}

    .cn-cartItem__name a,
    .cn-cartItem__name span {
        display: inline-block;
        max-width: 100%;
        color: #951f1f;
        font-size: 16px;
        font-weight: 950;
        line-height: 1.3;
        text-decoration: none;
        overflow-wrap: anywhere;
    }

        .cn-cartItem__name a:hover {
            text-decoration: underline;
        }


/* =========================================================
   REMOVE
   ========================================================= */

.cn-cartItem__remove {
    flex: 0 0 auto;
    margin: 0;
}

.cn-iconBtn {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, .10);
    border-radius: 12px;
    background: #fff;
    color: #333;
    font-family: inherit;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
}

    .cn-iconBtn:hover {
        background: rgba(0, 0, 0, .04);
    }

    .cn-iconBtn:focus-visible {
        outline: 3px solid rgba(149, 31, 31, .15);
        outline-offset: 2px;
    }


/* =========================================================
   PRICE
   ========================================================= */

.cn-cartItem__priceRow {
    display: flex;
    min-width: 0;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.cn-cartItem__unit {
    min-width: 0;
    font-weight: 900;
    opacity: .85;
    overflow-wrap: anywhere;
}

.cn-cartItem__total {
    flex: 0 0 auto;
    color: #951f1f;
    font-size: 16px;
    font-weight: 950;
    white-space: nowrap;
}

.cn-muted {
    opacity: .7;
    font-weight: 800;
    line-height: 1.4;
}


/* =========================================================
   CONTROLS
   ========================================================= */

.cn-cartItem__controls {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}


/* =========================================================
   PER KG
   ========================================================= */

.cn-cartPerKg {
    display: grid;
    width: 100%;
    min-width: 0;
    gap: 10px;
}

.cn-weight {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
}

.cn-chip {
    display: inline-flex;
    min-width: 60px;
    height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid rgba(149, 31, 31, .28);
    border-radius: 999px;
    background: #fff;
    color: #951f1f;
    font-family: inherit;
    font-size: 13px;
    font-weight: 950;
    cursor: pointer;
}

    .cn-chip:hover {
        background: rgba(149, 31, 31, .06);
    }

    .cn-chip.is-active {
        border-color: #951f1f;
        background: #951f1f;
        color: #fff;
    }

    .cn-chip:focus-visible {
        outline: 3px solid rgba(149, 31, 31, .15);
        outline-offset: 2px;
    }

.cn-weight__hint {
    margin-left: 4px;
}


/* =========================================================
   QUANTITY
   ========================================================= */

.cn-qty {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
}

.cn-qty__btn {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 12px;
    background: #fff;
    color: #222;
    font-family: inherit;
    font-size: 18px;
    font-weight: 950;
    cursor: pointer;
}

    .cn-qty__btn:hover {
        background: rgba(0, 0, 0, .04);
    }

    .cn-qty__btn:focus-visible {
        outline: 3px solid rgba(149, 31, 31, .15);
        outline-offset: 2px;
    }

.cn-qty__input {
    box-sizing: border-box;
    width: 84px;
    height: 44px;
    min-width: 0;
    padding: 0 10px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 12px;
    background: #fff;
    color: #222;
    font-family: inherit;
    font-size: 16px;
    font-weight: 950;
    text-align: center;
    outline: none;
}

    .cn-qty__input:focus {
        border-color: rgba(149, 31, 31, .45);
        box-shadow: 0 0 0 4px rgba(149, 31, 31, .10);
    }

.cn-qty__apply {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 13px;
    border: 1px solid rgba(149, 31, 31, .25);
    border-radius: 12px;
    background: #fff;
    color: #951f1f;
    font-family: inherit;
    font-size: 13px;
    font-weight: 950;
    cursor: pointer;
}

    .cn-qty__apply:hover {
        background: rgba(149, 31, 31, .06);
    }

    .cn-qty__apply:focus-visible {
        outline: 3px solid rgba(149, 31, 31, .15);
        outline-offset: 2px;
    }


/* =========================================================
   MIX BOX DETAILS
   ========================================================= */

.cn-cartMix {
    min-width: 0;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(149, 31, 31, .12);
    border-radius: 14px;
    background: rgba(149, 31, 31, .05);
}

.cn-cartMix__items {
    display: flex;
    min-width: 0;
    gap: 8px;
    flex-wrap: wrap;
}

.cn-cartMix__chip {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: 12.5px;
    font-weight: 950;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.cn-cartMix__grams {
    flex: 0 0 auto;
    font-weight: 900;
    opacity: .65;
}

.cn-cartMix__note {
    margin-top: 10px;
    color: #333;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.cn-cartMix__noteLabel {
    margin-right: 6px;
    color: #951f1f;
    font-weight: 950;
}


/* =========================================================
   SUMMARY
   ========================================================= */

.cn-summaryCard {
    position: sticky;
    top: 96px;
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 16px;
    background: #fff;
}

.cn-summaryCard__title {
    margin-bottom: 10px;
    color: #951f1f;
    font-size: 17px;
    font-weight: 950;
}

.cn-summaryRow {
    display: flex;
    min-width: 0;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, .06);
    font-weight: 900;
}

    .cn-summaryRow > * {
        min-width: 0;
        overflow-wrap: anywhere;
    }

.cn-summaryNote {
    margin-top: 12px;
    padding: 11px 12px;
    border: 1px solid rgba(149, 31, 31, .12);
    border-radius: 12px;
    background: rgba(149, 31, 31, .05);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.5;
    opacity: .9;
    overflow-wrap: anywhere;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.cn-btn {
    box-sizing: border-box;
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 950;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    cursor: pointer;
}

.cn-btn--primary {
    background: #951f1f;
    color: #fff;
}

    .cn-btn--primary:hover {
        filter: brightness(.95);
    }

    .cn-btn--primary:focus-visible {
        outline: 3px solid rgba(149, 31, 31, .20);
        outline-offset: 2px;
    }

.cn-btn--block {
    width: 100%;
    max-width: 100%;
    margin-top: 14px;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.cn-cartEmpty {
    display: grid;
    place-items: center;
    padding: 36px 0;
}

.cn-cartEmpty__card {
    box-sizing: border-box;
    width: min(520px, 100%);
    padding: 20px;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 18px;
    background: #fff;
    text-align: center;
}

.cn-cartEmpty__title {
    color: #951f1f;
    font-size: 20px;
    font-weight: 950;
}

.cn-cartEmpty__sub {
    margin-top: 8px;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
    opacity: .8;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 980px) {

    .cn-cart {
        max-width: 780px;
    }

    .cn-cart__grid {
        grid-template-columns: 1fr;
    }

    .cn-summaryCard {
        position: static;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 640px) {

    .cn-cart {
        padding: 14px 12px 38px;
    }

    .cn-cart__head {
        align-items: flex-start;
        margin-bottom: 16px;
    }

    .cn-cart__title {
        font-size: 27px;
    }

    .cn-cart__link {
        min-height: 42px;
        padding: 8px 10px;
        font-size: 13px;
    }

    .cn-cartItem {
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 11px;
        padding: 12px;
        border-radius: 15px;
    }

    .cn-cartItem__img img {
        width: 78px;
        height: 78px;
        border-radius: 12px;
    }

    .cn-cartItem__name a,
    .cn-cartItem__name span {
        font-size: 15px;
    }

    .cn-iconBtn {
        width: 40px;
        height: 40px;
    }

    .cn-cartItem__priceRow {
        gap: 8px;
    }

    .cn-cartItem__unit {
        font-size: 13px;
    }

    .cn-cartItem__total {
        font-size: 15px;
    }

    .cn-cartItem__controls {
        display: block;
        margin-top: 12px;
    }

    .cn-cartPerKg {
        gap: 11px;
    }

    .cn-weight {
        width: 100%;
    }

    .cn-chip {
        min-height: 44px;
        padding: 0 13px;
    }

    .cn-weight__hint {
        width: 100%;
        margin: 2px 0 0;
        font-size: 12px;
    }

    .cn-qty {
        width: 100%;
        justify-content: flex-start;
    }

    .cn-qty__input {
        width: 72px;
    }

    .cn-cartMix {
        padding: 10px;
    }

    .cn-cartMix__chip {
        border-radius: 12px;
    }

    .cn-summaryCard {
        padding: 15px;
        border-radius: 15px;
    }

    .cn-btn--block {
        min-height: 50px;
        font-size: 15px;
    }
}


/* =========================================================
   SMALL MOBILE
   320px - 480px
   ========================================================= */

@media (max-width: 480px) {

    .cn-cart {
        padding-left: 10px;
        padding-right: 10px;
    }

    .cn-cart__head {
        flex-wrap: wrap;
    }

    .cn-cart__title {
        flex: 1 1 180px;
    }

    .cn-cart__link {
        flex: 0 1 auto;
    }

    .cn-cartItem {
        grid-template-columns: 70px minmax(0, 1fr);
        gap: 10px;
        padding: 11px;
    }

    .cn-cartItem__img img {
        width: 70px;
        height: 70px;
    }

    .cn-cartItem__top {
        gap: 6px;
    }

    .cn-cartItem__name a,
    .cn-cartItem__name span {
        font-size: 14px;
    }

    .cn-cartItem__priceRow {
        flex-wrap: wrap;
    }

    .cn-cartItem__total {
        margin-left: auto;
    }

    .cn-qty {
        display: grid;
        grid-template-columns: 44px minmax(58px, 72px) 44px;
        gap: 7px;
        width: fit-content;
        max-width: 100%;
    }

    .cn-qty__input {
        width: 100%;
    }

    .cn-qty__apply {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 42px;
    }

    .cn-weight {
        gap: 6px;
    }

    .cn-chip {
        min-width: 56px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .cn-summaryRow {
        font-size: 14px;
    }
}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 360px) {

    .cn-cartItem {
        grid-template-columns: 62px minmax(0, 1fr);
    }

    .cn-cartItem__img img {
        width: 62px;
        height: 62px;
    }

    .cn-cartItem__name a,
    .cn-cartItem__name span {
        font-size: 13.5px;
    }

    .cn-cartItem__priceRow {
        font-size: 12.5px;
    }

    .cn-chip {
        min-width: 52px;
        padding-left: 8px;
        padding-right: 8px;
        font-size: 12px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .cn-btn,
    .cn-chip,
    .cn-iconBtn,
    .cn-qty__btn,
    .cn-qty__apply {
        transition: none;
    }
}
