/* =========================================================
    NOOKS COFFEE & EATERY
    MY BASKET PAGE STYLESHEET
    MODERN EMERALD GREEN THEME
========================================================= */


/* =========================================================
    RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* =========================================================
    VARIABLES
========================================================= */

:root {
    --green: #123c32;
    --green-2: #1f5a4b;
    --green-3: #2b6857;

    --sage: #dce8df;
    --sage-light: #e9f0eb;

    --cream: #f7f4ed;
    --white: #ffffff;

    --ink: #17221e;
    --muted: #68746e;

    --line: #d8dfda;
}


/* =========================================================
    HTML
========================================================= */

html {
    scroll-behavior: smooth;
}


/* =========================================================
    BODY
========================================================= */

body {
    font-family: "DM Sans", sans-serif;
    color: var(--ink);
    background: var(--cream);
    line-height: 1.6;
    overflow-x: hidden;
}


/* =========================================================
    LINKS
========================================================= */

a {
    color: inherit;
    text-decoration: none;
}


/* =========================================================
    HEADER
========================================================= */

.site-header {
    width: min(1180px, 92%);
    min-height: 86px;
    margin: 0 auto;
    padding: 0 26px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(18, 60, 50, 0.08);
    border-radius: 0 0 20px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 5px 20px rgba(18, 60, 50, 0.05);
}


.back-arrow {
    font-size: 22px;
    color: var(--green);
    font-weight: 700;
    transition: transform 0.2s ease;
}

.brand:hover .back-arrow {
    transform: translateX(-4px);
}


.header-title {
    font-family: "Playfair Display", serif;
    color: var(--green);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
}


/* =========================================================
    HAMBURGER
========================================================= */

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
}


.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    margin: 6px auto;
    background: var(--green);
}


/* =========================================================
    BASKET MAIN CONTAINER
========================================================= */

.basket-main {
    width: min(850px, 90%);
    margin: 0 auto;
    padding: 60px 0 100px;
}


.section-title {
    font-family: "Playfair Display", serif;
    color: var(--green);
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
}


/* =========================================================
    ORDER LIST SECTION
========================================================= */

.order-list-section {
    margin-bottom: 45px;
}


.order-items-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}


.order-item-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(18, 60, 50, 0.03);
}


.item-img-placeholder {
    width: 120px;
    height: 120px;
    min-width: 120px;
    border-radius: 12px;
    background: #c4c4c4;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}


.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}


.item-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}


.item-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
}


.quantity-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 4px;
}


.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--cream);
    color: var(--green);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.2s ease;
}


.qty-btn:hover {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}


.qty-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}


.item-total-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--green);
}


/* =========================================================
    ORDER SUMMARY SECTION
========================================================= */

.order-summary-section {
    margin-bottom: 45px;
}


.summary-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px 30px;
    box-shadow: 0 4px 15px rgba(18, 60, 50, 0.03);
    display: flex;
    flex-direction: column;
    gap: 16px;
}


.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
}


.summary-row.total-row {
    border-top: 1px solid var(--line);
    padding-top: 16px;
    font-size: 16px;
    font-weight: 700;
    color: var(--green);
}


.summary-value {
    color: var(--ink);
    font-weight: 700;
}

.total-row .summary-value {
    color: var(--green);
}

.basket-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.addon-open-button,
.addon-add-button {
    border: 0;
    border-radius: 8px;
    background: var(--green);
    color: var(--white);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.addon-open-button {
    margin-bottom: 24px;
    padding: 10px 16px;
}

.addon-open-button:hover,
.addon-add-button:hover {
    background: var(--green-2);
    transform: translateY(-1px);
}

.basket-empty-message {
    padding: 20px;
    color: var(--muted);
    text-align: center;
}

.basket-order-history {
    margin-top: 48px;
}

.basket-order-history > .section-title {
    margin-bottom: 18px;
}

.basket-order-history-list {
    display: grid;
    gap: 16px;
}

.basket-order-history-message {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
}

.basket-order-card {
    display: grid;
    gap: 12px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
}

.basket-order-card-header,
.basket-order-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.basket-order-card-header strong {
    color: var(--green);
}

.basket-order-status {
    font-size: 13px;
    font-weight: 700;
}

.basket-order-items {
    color: var(--muted);
    line-height: 1.5;
}

.basket-order-card-footer {
    color: var(--muted);
    font-size: 14px;
}

.basket-order-card-footer strong {
    color: var(--ink);
}

.basket-order-receipt {
    justify-self: start;
    color: var(--green);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.addons-dialog {
    position: fixed;
    width: min(720px, 92vw);
    max-width: none;
    max-height: 88vh;
    margin: auto;
    padding: 28px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--white);
    color: var(--ink);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.addons-dialog::backdrop {
    background: rgba(11, 24, 19, 0.68);
}

.addons-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.addons-eyebrow {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.addons-dialog-header h2 {
    color: var(--green);
    font-family: "Playfair Display", serif;
    font-size: 28px;
}

.addons-close-button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--white);
    color: var(--green);
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.addons-description {
    margin: 8px 0 20px;
    color: var(--muted);
    font-size: 14px;
}

.addons-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.addon-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.addon-card-out-of-stock {
    background: #f0f0f0;
}

.addon-card-out-of-stock > img {
    opacity: 0.6;
    filter: grayscale(1);
}

.addon-stock-label,
.basket-addon-stock-label {
    display: inline-block;
    color: #b42318;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.basket-addon-stock-label {
    margin-left: 6px;
}

.addon-add-button:disabled {
    cursor: not-allowed;
    color: #b42318;
    background: #e2e2e2;
    opacity: 1;
}

.order-item-out-of-stock {
    background: #f0f0f0;
}

.order-item-out-of-stock .item-img-placeholder {
    filter: grayscale(1);
}

.qty-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.addon-card > img {
    width: 92px;
    height: 104px;
    border-radius: 8px;
    object-fit: cover;
}

.addon-card-details h3 {
    font-size: 14px;
}

.addon-card-details p {
    margin: 3px 0 10px;
    color: var(--muted);
    font-size: 13px;
}

.addon-add-button {
    padding: 8px 10px;
    font-size: 12px;
}

.addons-status {
    min-height: 20px;
    margin-top: 12px;
    color: var(--green-2);
    font-size: 13px;
}


/* =========================================================
    PAYMENT METHOD SECTION
========================================================= */

.payment-method-section {
    margin-bottom: 50px;
}


.payment-card {
    background: var(--sage);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(18, 60, 50, 0.07);
}


.payment-card h3 {
    font-family: "Playfair Display", serif;
    color: var(--green);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}


.payment-option h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
}


.payment-option p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}


/* =========================================================
    BASKET ACTIONS (BUTTONS)
========================================================= */

.basket-actions {
    display: flex;
    gap: 20px;
    justify-content: space-between;
}

.ordering-closed-message {
    margin: 0 0 20px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--green);
    background: var(--sage-light);
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}


.action-btn {
    flex: 1;
    padding: 16px 20px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
}


.secondary-btn {
    background: var(--white);
    color: var(--green);
    border: 1px solid var(--line);
    box-shadow: 0 4px 15px rgba(18, 60, 50, 0.03);
}


.secondary-btn:hover {
    background: var(--sage);
    border-color: var(--green-2);
}


.primary-btn {
    background: var(--green);
    color: var(--white);
    box-shadow: 0 8px 20px rgba(18, 60, 50, 0.18);
}


.primary-btn:hover {
    background: var(--green-2);
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(18, 60, 50, 0.22);
}

.disabled-order-action {
    cursor: not-allowed;
    opacity: 0.6;
}


/* =========================================================
    FOOTER
========================================================= */

footer {
    min-height: 90px;
    padding: 20px 5%;
    background: var(--green);
    color: rgba(255, 255, 255, 0.82);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    font-size: 11px;
}


.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
}


.brand-mark {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--white);
    color: var(--green);
    display: grid;
    place-items: center;
    font-family: "Playfair Display", serif;
    font-size: 20px;
}


.footer-social {
    display: flex;
    align-items: center;
    gap: 12px;
}


.footer-social a {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 16px;
    transition: 0.3s ease;
}


.footer-social a:hover {
    background: var(--white);
    color: var(--green);
}


/* =========================================================
    MOBILE MENU
========================================================= */

.mobile-menu {
    display: none;
}


/* =========================================================
    TABLET & MOBILE RESPONSIVE
========================================================= */

@media (max-width: 850px) {
    .site-header {
        width: 94%;
        min-height: 78px;
        padding: 0 20px;
    }

    .basket-main {
        width: 92%;
        padding: 40px 0 80px;
    }

    footer {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
}


@media (max-width: 520px) {
    .site-header {
        width: 94%;
        min-height: 72px;
        padding: 0 16px;
        border-radius: 0 0 16px 16px;
    }

    .header-title {
        font-size: 20px;
    }

    .basket-main {
        width: 90%;
        padding: 30px 0 60px;
    }

    .basket-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0;
    }

    .addon-open-button {
        margin: -10px 0 22px;
    }

    .addons-dialog {
        padding: 20px;
    }

    .addons-grid {
        grid-template-columns: 1fr;
    }

    .order-item-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        position: relative;
    }

    .item-img-placeholder {
        width: 100px;
        height: 100px;
        min-width: 100px;
    }

    .item-total-price {
        position: absolute;
        top: 20px;
        right: 20px;
    }

    .basket-actions {
        flex-direction: column;
        gap: 12px;
    }

    footer {
        flex-direction: column;
        padding: 30px 20px;
        gap: 15px;
    }
}