
:root {
    --green: #526b48;
    --dark: #292d25;
    --muted: #858575;
    --cream: #f5f0e6;
    --line: #000000;
    --beige: #e8ddc9;
    --surface: #ffffff;
    --soft-green: #eaeedf;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--cream);
    background-image: url("background-image.jpg");
    background-size: 100% auto;
    background-position: center top;
    background-repeat: repeat-y;
    background-attachment: scroll;
    color: var(--dark);
    font-family: Arial, sans-serif;
}

button {
    cursor: pointer;
    font: inherit;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

img {
    display: block;
    max-width: 100%;
}

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

header {
    height: 70px;
    padding: 0 6%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
}

.brand img {
    width: auto;
    height: 38px;
    object-fit: contain;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ==========================================
   HISTORY BUTTON
========================================== */

.history-button {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface);
    color: var(--dark);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: background 0.2s ease;
}

.history-button:hover {
    background: #dfe6d5;
}

/* ==========================================
   SHOPPING BAG
========================================== */

.cart-button {
    position: relative;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--dark);
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.cart-button:hover {
    background: var(--soft-green);
    border-color: var(--green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(41, 45, 37, 0.08);
}

.cart-button:active {
    transform: scale(0.94);
}

.bag-icon {
    width: 22px;
    height: 22px;
    stroke-width: 1.6;
}

#cartCount {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    background: var(--green);
    color: white;
    border: 2px solid var(--surface);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

/* ==========================================
   HERO BANNER
========================================== */

.hero {
    padding: 0;
}

.hero-content {
    width: 100%;
    max-width: 1050px;
    margin: auto;
}

.hero-banner {
    width: 100%;
    overflow: hidden;
}

.hero-banner img {
    display: block;
    width: 100%;
    height: auto;
}

/* ==========================================
   CATEGORY TABS
========================================== */

.tabs {
    display: flex;
    gap: 26px;
    padding: 0 6%;
    overflow-x: auto;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    flex-shrink: 0;
    padding: 15px 0;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.tab:hover {
    color: var(--green);
}

.tab.active {
    color: var(--green);
    border-bottom-color: var(--green);
    font-weight: bold;
}

/* ==========================================
   MENU
========================================== */

.menu,
main {
    max-width: 1050px;
    margin: auto;
    padding: 28px 6% 100px;
}

.menu h2,
.section-title {
    margin: 0 0 20px;
    font-size: 19px;
    font-weight: bold;
}

/* ==========================================
   PRODUCT GRID
========================================== */

#products,
.products {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

/* ==========================================
   PRODUCT CARD
========================================== */

.product {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.product:hover {
    border-color: var(--green);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(41, 45, 37, 0.06);
}

.product img {
    width: 100%;
    height: 155px;
    object-fit: cover;
    background: var(--beige);
}

.product-info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-name {
    font-size: 15px;
    font-weight: bold;
}

.product-desc {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 15px;
}

.price {
    color: var(--dark);
    font-size: 14px;
    font-weight: bold;
}

.add {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--green);
    color: white;
    font-size: 20px;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.add:hover {
    background: var(--dark);
    transform: scale(1.08);
}

/* ==========================================
   DRAWER OVERLAY
========================================== */

#overlay,
.overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

#overlay.show,
.overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================
   DRAWER
========================================== */

#drawer,
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 11;
    width: min(440px, 100%);
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    transform: translateX(105%);
    transition: transform 0.3s ease;
}

#drawer.show,
.drawer.show {
    transform: translateX(0);
}

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

.drawer-header {
    min-height: 68px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.drawer-header h2,
.drawer-header strong {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.close-button,
.close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--dark);
    font-size: 25px;
    transition: background 0.2s ease;
}

.close-button:hover,
.close:hover {
    background: var(--soft-green);
}

/* ==========================================
   DRAWER CONTENT
========================================== */

.drawer-content,
#drawerContent {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* ==========================================
   SELECTED PRODUCT
========================================== */

.drawer-product {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 25px;
}

.drawer-product img {
    width: 95px;
    height: 85px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 6px;
    background: var(--beige);
}

.drawer-product h3 {
    margin: 0 0 7px;
    font-size: 17px;
}

.drawer-product p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

/* ==========================================
   CUSTOMISATION GROUPS
========================================== */

.option-group {
    margin: 25px 0;
}

.option-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: bold;
}

.required {
    color: var(--muted);
    font-size: 10px;
    font-weight: normal;
}

/* ==========================================
   CUSTOMISATION OPTIONS
========================================== */

.choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.choice {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface);
    color: var(--dark);
    text-align: left;
    font-size: 12px;
    transition: all 0.15s ease;
}

.choice:hover {
    border-color: var(--green);
}

.choice.selected {
    border: 1.5px solid var(--green);
    background: var(--soft-green);
    color: var(--green);
}

.choice small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

/* ==========================================
   ADD-ONS
========================================== */

.addon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.addon input {
    width: 17px;
    height: 17px;
    accent-color: var(--green);
    cursor: pointer;
}

/* ==========================================
   QUANTITY
========================================== */

.qty-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.qty-row strong {
    min-width: 20px;
    text-align: center;
}

.qty-row button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--dark);
    font-size: 17px;
}

.qty-row button:hover {
    background: var(--soft-green);
    border-color: var(--green);
}

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

.drawer-footer,
#drawerFooter {
    padding: 18px 20px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: bold;
}

/* ==========================================
   PRIMARY BUTTON
========================================== */

.primary {
    width: 100%;
    padding: 16px;
    border: 0;
    border-radius: 5px;
    background: var(--dark);
    color: white;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: background 0.2s ease;
}

.primary:hover:not(:disabled) {
    background: var(--green);
}

/* ==========================================
   CART ITEMS
========================================== */

.cart-item {
    display: flex;
    gap: 14px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
}

.cart-item img {
    width: 76px;
    height: 76px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 5px;
    background: var(--beige);
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-info h3,
.cart-item-info strong {
    margin: 0 0 6px;
    font-size: 14px;
}

.cart-item-info p {
    margin: 4px 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.cart-item-info .price {
    margin-top: 8px;
    color: var(--dark);
    font-size: 13px;
}

.cart-item button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--green);
    font-size: 11px;
    font-weight: bold;
}

.cart-item button:hover {
    text-decoration: underline;
}

/* ==========================================
   CART ACTIONS
========================================== */

.history-actions {
    display: flex;
    gap: 15px;
    margin-top: 12px;
}

.history-actions button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--green);
    font-size: 11px;
    font-weight: bold;
}

.history-actions button:hover {
    text-decoration: underline;
}

/* ==========================================
   EMPTY STATE
========================================== */

.empty {
    padding: 50px 15px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
}

/* ==========================================
   ORDER HISTORY
========================================== */

.history-order {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.history-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.history-top strong {
    font-size: 14px;
}

.history-meta {
    margin: 6px 0 12px;
    color: var(--muted);
    font-size: 11px;
}

.status {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 4px;
    background: var(--soft-green);
    color: var(--green);
    font-size: 10px;
    font-weight: bold;
}

.danger {
    color: #a44 !important;
}

/* ==========================================
   ORDER CONFIRMATION
========================================== */

.order-confirmation {
    padding: 35px 10px;
    text-align: center;
}

/* ==========================================
   CLEAR HISTORY CONFIRMATION
========================================== */

.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    animation: confirmFadeIn 0.2s ease;
}

.confirm-box {
    width: 100%;
    max-width: 360px;
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.confirm-box h3 {
    margin: 0 0 12px;
    color: var(--dark);
    font-size: 17px;
}

.confirm-box p {
    margin: 0 0 8px;
    color: var(--dark);
    font-size: 13px;
    line-height: 1.6;
}

.confirm-box span {
    color: var(--muted);
    font-size: 11px;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.confirm-actions button {
    flex: 1;
    padding: 12px 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.confirm-cancel {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--dark);
}

.confirm-cancel:hover {
    background: var(--soft-green);
}

.confirm-delete {
    border: 1px solid #a44;
    background: #a44;
    color: white;
}

.confirm-delete:hover {
    background: #873636;
}

@keyframes confirmFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ==========================================
   RESPONSIVE: TABLETS AND DESKTOP
========================================== */

@media (min-width: 700px) {
    #products,
    .products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }

    .product img {
        height: 190px;
    }
}

/* ==========================================
   RESPONSIVE: SMALL MOBILE
========================================== */

@media (max-width: 380px) {
    header {
        padding: 0 4%;
    }

    .header-right {
        gap: 9px;
    }

    .brand img {
        height: 32px;
    }

    .cart-button {
        width: 42px;
        height: 42px;
    }

    .history-button {
        padding: 9px 10px;
        font-size: 10px;
    }

    .hero {
        padding: 0;
    }

    .tabs {
        padding: 0 5%;
        gap: 20px;
    }

    .menu,
    main {
        padding-left: 5%;
        padding-right: 5%;
    }

    #products,
    .products {
        gap: 10px;
    }

    .product-info {
        padding: 11px;
    }

    .product-name {
        font-size: 13px;
    }

    .product-desc {
        font-size: 10px;
    }
}
