/* =========================================================
   CART PAGE
   CHOOKS-TO-GO ORDERING SYSTEM
   ========================================================= */


/* =========================================================
   RESET / GLOBAL
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

a {
    -webkit-tap-highlight-color: transparent;
}


/* =========================================================
   HEADER
========================================================= */

header {
    position: fixed;
    top: 0;
    left: 0;

    width: 100%;
    height: 80px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 7%;

    background: #fff;

    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);

    z-index: 1000;
}


/* =========================================================
   LOGO
========================================================= */

.logo {
    display: flex;
    align-items: center;

    gap: 12px;

    min-width: 0;

    text-decoration: none;
}

.logo img {
    width: 65px;
    height: 65px;

    flex-shrink: 0;

    border-radius: 50%;

    object-fit: cover;
}

.logo span {
    color: #b71c1c;

    font-size: 1.6rem;
    font-weight: 700;

    white-space: nowrap;
}


/* =========================================================
   NAVIGATION
========================================================= */

nav {
    display: flex;
    align-items: center;

    gap: 35px;
}

nav a {
    position: relative;

    color: #333;

    text-decoration: none;

    font-size: 0.98rem;
    font-weight: 500;

    transition:
        color 0.25s ease,
        transform 0.25s ease;
}

nav a:hover,
nav a.active {
    color: #b71c1c;
}

nav a:focus-visible {
    outline: 3px solid rgba(183, 28, 28, 0.25);
    outline-offset: 5px;

    border-radius: 4px;
}


/* =========================================================
   CART PAGE
========================================================= */

.cart-page {
    width: min(1400px, 100%);

    margin: 120px auto 60px;

    padding: 20px;
}


/* =========================================================
   CART HEADER
========================================================= */

.cart-header {
    margin-bottom: 35px;
}

.cart-header h1 {
    margin-bottom: 10px;

    color: #b71c1c;

    font-size: clamp(2rem, 3vw, 2.3rem);
    font-weight: 700;

    line-height: 1.2;
}

.cart-header p {
    color: #777;

    font-size: 0.98rem;
}


/* =========================================================
   CART LAYOUT
========================================================= */

.cart-wrapper {
    display: grid;

    grid-template-columns: minmax(0, 1fr) 360px;

    gap: 30px;

    align-items: start;
}


/* =========================================================
   CART ITEMS CONTAINER
========================================================= */

.cart-items {
    min-width: 0;
}


/* =========================================================
   PRODUCT CARD
========================================================= */

.cart-card {
    display: flex;
    align-items: center;

    width: 100%;

    padding: 20px;
    margin-bottom: 20px;

    background: #fff;

    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 18px;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.cart-card:hover {
    transform: translateY(-3px);

    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.10);
}


/* =========================================================
   PRODUCT IMAGE
========================================================= */

.cart-image {
    width: 140px;
    height: 140px;

    flex: 0 0 140px;

    overflow: hidden;

    border-radius: 15px;

    background: #f1f1f1;
}

.cart-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    border-radius: 15px;

    transition: transform 0.3s ease;
}

.cart-card:hover .cart-image img {
    transform: scale(1.03);
}


/* =========================================================
   PRODUCT DETAILS
========================================================= */

.cart-details {
    flex: 1;

    min-width: 0;

    margin-left: 25px;
}

.cart-details h2 {
    margin-bottom: 8px;

    color: #222;

    font-size: 1.35rem;
    font-weight: 700;

    line-height: 1.3;

    overflow-wrap: anywhere;
}

.cart-details p {
    margin-bottom: 14px;

    color: #777;

    font-size: 0.95rem;

    line-height: 1.6;

    overflow-wrap: anywhere;
}


/* =========================================================
   PRODUCT PRICE
========================================================= */

.price {
    margin-bottom: 18px;

    color: #b71c1c;

    font-size: 1.4rem;
    font-weight: 700;

    line-height: 1.2;
}


/* =========================================================
   QUANTITY AREA
========================================================= */

.quantity-area {
    display: flex;
    align-items: center;

    gap: 10px;
}


/* =========================================================
   QUANTITY BUTTON
========================================================= */

.qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    padding: 0;

    border: none;
    border-radius: 10px;

    background: #b71c1c;
    color: #fff;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.15s ease,
        opacity 0.2s ease;
}

.qty-btn:hover {
    background: #8b0000;
}

.qty-btn:active {
    transform: scale(0.94);
}

.qty-btn:focus-visible {
    outline: 3px solid rgba(183, 28, 28, 0.25);
    outline-offset: 3px;
}


/* =========================================================
   DISABLED QUANTITY BUTTON
========================================================= */

.qty-btn:disabled {
    background: #d6d6d6;

    color: #888;

    cursor: not-allowed;

    opacity: 0.7;

    transform: none;
}


/* =========================================================
   QUANTITY INPUT
========================================================= */

.quantity-area input {
    width: 70px;
    height: 40px;

    padding: 0 8px;

    text-align: center;

    border: 1px solid #ddd;
    border-radius: 10px;

    outline: none;

    background: #fff;
    color: #333;

    font-size: 16px;
    font-weight: 600;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.quantity-area input:focus {
    border-color: #b71c1c;

    box-shadow: 0 0 0 3px rgba(183, 28, 28, 0.10);
}


/* Remove number input arrows */

.quantity-area input::-webkit-outer-spin-button,
.quantity-area input::-webkit-inner-spin-button {
    margin: 0;

    -webkit-appearance: none;
}

.quantity-area input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}


/* =========================================================
   RIGHT SIDE OF PRODUCT CARD
========================================================= */

.cart-right {
    min-width: 170px;

    text-align: right;
}

.cart-right h3 {
    margin-bottom: 20px;

    color: #b71c1c;

    font-size: 1.5rem;
    font-weight: 700;

    line-height: 1.2;
}


/* =========================================================
   REMOVE BUTTON
========================================================= */

.remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 11px 18px;

    border-radius: 10px;

    background: #dc3545;
    color: #fff;

    text-decoration: none;

    font-size: 0.92rem;
    font-weight: 600;

    transition:
        background 0.2s ease,
        transform 0.15s ease;
}

.remove:hover {
    background: #b71c1c;

    transform: translateY(-1px);
}

.remove:active {
    transform: scale(0.97);
}

.remove:focus-visible {
    outline: 3px solid rgba(220, 53, 69, 0.25);
    outline-offset: 3px;
}


/* =========================================================
   SUMMARY
========================================================= */

.summary {
    position: sticky;
    top: 105px;

    padding: 30px;

    background: #fff;

    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 20px;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
}

.summary h2 {
    margin-bottom: 25px;

    color: #b71c1c;

    font-size: 1.5rem;
    font-weight: 700;
}


/* =========================================================
   SUMMARY ROW
========================================================= */

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;

    color: #555;

    font-size: 16px;
}

.summary-row span:last-child {
    color: #222;

    font-weight: 600;

    text-align: right;

    white-space: nowrap;
}


/* =========================================================
   SUMMARY DIVIDER
========================================================= */

.summary hr {
    height: 1px;

    margin: 25px 0;

    border: 0;
    border-top: 1px solid #eee;
}


/* =========================================================
   CASH ORDER LIMIT WARNING
========================================================= */

.cash-limit-warning {
    display: flex;
    align-items: flex-start;

    gap: 10px;

    margin: 18px 0;

    padding: 13px 14px;

    border: 1px solid #f1c40f;
    border-radius: 10px;

    background: #fff8db;
    color: #7a5c00;

    font-size: 0.88rem;
    line-height: 1.5;
}

.cash-limit-warning i {
    flex-shrink: 0;

    margin-top: 2px;
}


/* =========================================================
   SUMMARY BUTTONS
========================================================= */

.continue,
.checkout,
.clear-cart {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;

    min-height: 50px;

    padding: 14px 16px;

    border-radius: 12px;

    text-align: center;
    text-decoration: none;

    font-size: 0.95rem;
    font-weight: 600;

    transition:
        background 0.2s ease,
        transform 0.15s ease,
        opacity 0.2s ease,
        box-shadow 0.2s ease;
}

.continue:active,
.checkout:active,
.clear-cart:active {
    transform: scale(0.98);
}

.continue:focus-visible,
.checkout:focus-visible,
.clear-cart:focus-visible {
    outline: 3px solid rgba(183, 28, 28, 0.25);
    outline-offset: 3px;
}


/* =========================================================
   CONTINUE SHOPPING
========================================================= */

.continue {
    background: #f1f1f1;

    color: #333;
}

.continue:hover {
    background: #ddd;

    color: #222;
}


/* =========================================================
   CHECKOUT
========================================================= */

.checkout {
    margin-top: 15px;
    background: #1caf1c;

    color: #fff;

    box-shadow: 0 4px 10px rgba(28, 175, 28, 0.12);
}

.checkout:hover {
    background: #0c8b00;

    color: #fff;

    transform: translateY(-1px);

    box-shadow: 0 6px 14px rgba(28, 175, 28, 0.18);
}


/* =========================================================
   CHECKOUT LOCKED
   Used by cart.js when the Cash Order Limit is reached.
========================================================= */

.checkout.checkout-locked {
    background: #a9a9a9;

    color: #fff;

    opacity: 0.65;

    cursor: not-allowed;

    filter: grayscale(20%);

    box-shadow: none;

    pointer-events: none;

    transform: none;
}

.checkout.checkout-locked:hover {
    background: #a9a9a9;

    transform: none;

    box-shadow: none;
}


/* =========================================================
   CLEAR CART
========================================================= */

.clear-cart {
    margin-top: 8px;

    background: #dc3545;

    color: #fff;
}

.clear-cart:hover {
    background: #b71c1c;

    color: #fff;

    transform: translateY(-1px);
}

.clear-cart i {
    margin-right: 8px;
}


/* =========================================================
   EMPTY CART
========================================================= */

.empty-cart {
    padding: 70px 30px;

    background: #fff;

    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 20px;

    text-align: center;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
}

.empty-cart i {
    display: block;

    margin-bottom: 20px;

    color: #b71c1c;

    font-size: 80px;
}

.empty-cart h2 {
    margin-bottom: 15px;

    color: #222;

    font-size: 1.6rem;
}

.empty-cart p {
    max-width: 550px;

    margin: 0 auto 30px;

    color: #777;

    line-height: 1.6;
}

.empty-cart a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 50px;

    padding: 14px 30px;

    border-radius: 12px;

    background: #b71c1c;
    color: #fff;

    text-decoration: none;

    font-weight: 600;

    transition:
        background 0.2s ease,
        transform 0.15s ease;
}

.empty-cart a:hover {
    background: #8b0000;

    transform: translateY(-1px);
}

.empty-cart a:active {
    transform: scale(0.98);
}


/* =========================================================
   LOADING / UPDATING STATE
   Supports cart.js while quantity is being updated.
========================================================= */

.cart-card.is-updating {
    opacity: 0.65;

    pointer-events: none;
}

.cart-card.is-updating .qty-btn {
    cursor: wait;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1100px) {

    header {
        padding: 0 4%;
    }

    .cart-page {
        padding: 20px;
    }

    .cart-wrapper {
        grid-template-columns: minmax(0, 1fr) 320px;

        gap: 20px;
    }

    .cart-card {
        padding: 18px;
    }

    .cart-image {
        width: 120px;
        height: 120px;

        flex-basis: 120px;
    }

    .cart-details {
        margin-left: 20px;
    }

    .cart-right {
        min-width: 150px;
    }

    .summary {
        padding: 25px;
    }
}


/* =========================================================
   TABLET / SMALL DESKTOP
========================================================= */

@media (max-width: 992px) {

    .cart-wrapper {
        grid-template-columns: 1fr;
    }

    .summary {
        position: static;

        width: 100%;
    }

    .cart-right {
        min-width: 160px;
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    /* =====================================================
       HEADER
    ====================================================== */

    header {
        position: fixed;

        top: 0;
        left: 0;

        width: 100%;
        height: 70px;

        padding: 0 20px;

        justify-content: space-between;
    }


    /* =====================================================
       LOGO
    ====================================================== */

    .logo {
        gap: 8px;
    }

    .logo img {
        width: 50px;
        height: 50px;
    }

    .logo span {
        max-width: 180px;

        overflow: hidden;

        font-size: 1.1rem;

        text-overflow: ellipsis;
    }


    /* =====================================================
       NAVIGATION
    ====================================================== */

    nav {
        display: none;
    }


    /* =====================================================
       CART PAGE
    ====================================================== */

    .cart-page {
        width: 100%;

        margin: 95px auto 40px;

        padding: 0 15px;
    }


    /* =====================================================
       CART HEADER
    ====================================================== */

    .cart-header {
        margin-bottom: 25px;

        text-align: center;
    }

    .cart-header h1 {
        margin-bottom: 8px;

        font-size: 2rem;
    }

    .cart-header p {
        font-size: 0.92rem;
    }


    /* =====================================================
       CART CARD
    ====================================================== */

    .cart-card {
        flex-direction: column;

        padding: 18px;

        margin-bottom: 15px;

        text-align: center;

        border-radius: 16px;
    }

    .cart-card:hover {
        transform: none;
    }


    /* =====================================================
       PRODUCT IMAGE
    ====================================================== */

    .cart-image {
        width: 120px;
        height: 120px;

        flex: 0 0 120px;

        margin-bottom: 15px;
    }


    /* =====================================================
       PRODUCT DETAILS
    ====================================================== */

    .cart-details {
        width: 100%;

        margin-left: 0;
    }

    .cart-details h2 {
        margin-bottom: 8px;

        font-size: 1.25rem;
    }

    .cart-details p {
        margin-bottom: 10px;

        font-size: 0.9rem;
    }


    /* =====================================================
       PRICE
    ====================================================== */

    .price {
        margin-bottom: 15px;

        font-size: 1.2rem;
    }


    /* =====================================================
       QUANTITY
    ====================================================== */

    .quantity-area {
        justify-content: center;

        gap: 8px;
    }

    .qty-btn {
        width: 42px;
        height: 42px;
    }

    .quantity-area input {
        width: 70px;
        height: 42px;
    }


    /* =====================================================
       RIGHT SIDE
    ====================================================== */

    .cart-right {
        width: 100%;

        min-width: 0;

        margin-top: 18px;

        text-align: center;
    }

    .cart-right h3 {
        margin-bottom: 15px;

        font-size: 1.25rem;
    }

    .remove {
        width: 100%;

        min-height: 45px;
    }


    /* =====================================================
       SUMMARY
    ====================================================== */

    .summary {
        position: static;

        padding: 22px 18px;

        border-radius: 16px;
    }

    .summary h2 {
        margin-bottom: 20px;

        font-size: 1.4rem;
    }

    .summary-row {
        margin-bottom: 15px;

        font-size: 15px;
    }

    .summary hr {
        margin: 20px 0;
    }


    /* =====================================================
       CASH WARNING
    ====================================================== */

    .cash-limit-warning {
        font-size: 0.84rem;
    }


    /* =====================================================
       SUMMARY BUTTONS
    ====================================================== */

    .continue,
    .checkout,
    .clear-cart {
        min-height: 48px;

        padding: 13px 14px;
    }


    /* =====================================================
       EMPTY CART
    ====================================================== */

    .empty-cart {
        padding: 50px 20px;

        border-radius: 16px;
    }

    .empty-cart i {
        margin-bottom: 18px;

        font-size: 60px;
    }

    .empty-cart h2 {
        font-size: 1.4rem;
    }

    .empty-cart p {
        margin-bottom: 25px;

        font-size: 0.92rem;
    }

    .empty-cart a {
        width: 100%;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

    header {
        padding: 0 15px;
    }

    .logo img {
        width: 46px;
        height: 46px;
    }

    .logo span {
        max-width: 145px;

        font-size: 1rem;
    }


    .cart-page {
        margin-top: 90px;

        padding: 0 12px;
    }

    .cart-header h1 {
        font-size: 1.75rem;
    }

    .cart-header p {
        font-size: 0.88rem;
    }


    .cart-card {
        padding: 15px;
    }

    .cart-image {
        width: 110px;
        height: 110px;

        flex-basis: 110px;
    }

    .cart-details h2 {
        font-size: 1.15rem;
    }

    .cart-details p {
        font-size: 0.86rem;
    }

    .price {
        font-size: 1.15rem;
    }


    .summary {
        padding: 20px 15px;
    }

    .summary h2 {
        font-size: 1.3rem;
    }

    .summary-row {
        font-size: 14px;
    }


    .empty-cart {
        padding: 40px 18px;
    }

    .empty-cart i {
        font-size: 55px;
    }
}


/* =========================================================
   VERY SMALL DEVICES
========================================================= */

@media (max-width: 360px) {

    .logo span {
        display: none;
    }

    .cart-page {
        padding: 0 10px;
    }

    .cart-card {
        padding: 13px;
    }

    .summary {
        padding: 18px 13px;
    }

    .summary-row {
        gap: 10px;

        font-size: 13px;
    }

    .qty-btn {
        width: 38px;
        height: 38px;
    }

    .quantity-area input {
        width: 62px;
        height: 38px;
    }
}


/* =========================================================
   REDUCED MOTION
   Accessibility improvement for users who prefer
   reduced animations.
========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}