:root {
    --green: #08784f;
    --green-dark: #045638;
    --green-light: #e9f6f0;
    --orange: #f58220;
    --orange-dark: #d9680d;
    --lime: #b8d63d;

    --dark: #17231e;
    --muted: #68756f;
    --border: #e7ebe8;
    --background: #f5f7f6;
    --white: #ffffff;

    --shadow: 0 8px 30px rgba(20, 45, 32, .07);
    --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: "Inter", sans-serif;
    background: var(--background);
    color: var(--dark);
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }

.container {
    width: min(1400px, calc(100% - 32px));
    margin: auto;
}

.btn {
    min-height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    border: 0;
    cursor: pointer;
    transition: .2s;
}
.btn-white        { background: #fff; color: var(--green-dark); }
.btn-green        { background: var(--green); color: #fff; }
.btn-green:hover  { background: var(--green-dark); }
.btn-orange       { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange-dark); }
.btn-transparent  { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.3); color: #fff; }

/* ============ Cart Drawer ============ */
.rc-drawer-bg {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    z-index: 4000; opacity: 0; visibility: hidden; transition: .25s;
}
.rc-drawer-bg.open { opacity: 1; visibility: visible; }
.rc-drawer {
    position: fixed; top: 0; right: 0; height: 100%;
    width: min(420px, 100%); background: #fff;
    transform: translateX(100%); transition: .3s;
    display: flex; flex-direction: column; z-index: 4001;
    box-shadow: -12px 0 40px rgba(0,0,0,.18);
}
.rc-drawer.open { transform: translateX(0); }
.rc-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.rc-drawer-head h3 {
    font-family: "Manrope", sans-serif; font-size: 18px;
    letter-spacing: -.3px;
}
.rc-drawer-head .close {
    width: 38px; height: 38px; border: 0; border-radius: 50%;
    background: #f2f5f3; cursor: pointer; font-size: 16px;
}
.rc-drawer-body { flex: 1; overflow-y: auto; padding: 14px 20px; }
.rc-drawer-foot {
    border-top: 1px solid var(--border); padding: 16px 20px;
    background: #fafbfa;
}
.rc-line {
    display: grid; grid-template-columns: 62px 1fr auto;
    gap: 12px; padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.rc-line:last-child { border-bottom: 0; }
.rc-line .thumb {
    width: 62px; height: 62px; background: #f2f4f3;
    border-radius: 10px; overflow: hidden;
    display: grid; place-items: center;
}
.rc-line .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.rc-line .name { font-size: 13px; font-weight: 700; line-height: 1.3; }
.rc-line .seller { font-size: 10px; color: var(--muted); margin-top: 2px; }
.rc-line .pill {
    display: inline-block; margin-top: 4px;
    background: var(--green-light); color: var(--green);
    font-size: 9px; font-weight: 700;
    padding: 2px 7px; border-radius: 50px;
}
.rc-line .row-actions {
    display: flex; align-items: center; gap: 8px; margin-top: 6px;
}
.rc-line .qty {
    display: inline-flex; align-items: center;
    border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.rc-line .qty button {
    width: 24px; height: 26px; border: 0; background: #fff; cursor: pointer;
}
.rc-line .qty span { padding: 0 8px; font-size: 12px; font-weight: 700; }
.rc-line .rm {
    background: transparent; border: 0; cursor: pointer;
    color: #b23a3a; font-size: 11px; font-weight: 600;
}
.rc-line .price {
    font-size: 14px; font-weight: 800; white-space: nowrap; text-align: right;
}
.rc-totals { padding: 10px 0; }
.rc-totals .r {
    display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0;
}
.rc-totals .r.total {
    font-size: 17px; font-weight: 800;
    border-top: 1px solid var(--border);
    margin-top: 8px; padding-top: 12px;
}
.rc-drawer-foot .btn { width: 100%; min-height: 48px; margin-top: 12px; }
.rc-empty {
    text-align: center; padding: 50px 20px; color: var(--muted);
}
.rc-empty i { font-size: 44px; color: #cfd6d1; margin-bottom: 14px; display: block; }
.rc-busy { opacity: .5; pointer-events: none; }

/* ============ Auth Modal ============ */
.rc-modal-bg {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    z-index: 5000; opacity: 0; visibility: hidden; transition: .25s;
    display: grid; place-items: center; padding: 20px;
}
.rc-modal-bg.open { opacity: 1; visibility: visible; }
.rc-modal {
    background: #fff; border-radius: 20px; width: min(440px, 100%);
    padding: 30px; position: relative;
    transform: translateY(20px); transition: .3s;
    max-height: calc(100vh - 40px); overflow-y: auto;
}
.rc-modal-bg.open .rc-modal { transform: translateY(0); }
.rc-modal .close {
    position: absolute; top: 16px; right: 16px;
    width: 36px; height: 36px; border: 0; border-radius: 50%;
    background: #f2f5f3; cursor: pointer;
}
.rc-modal h2 {
    font-family: "Manrope", sans-serif; font-size: 22px;
    letter-spacing: -.4px; margin-bottom: 6px;
}
.rc-modal .sub {
    color: var(--muted); font-size: 12px; margin-bottom: 20px;
}
.rc-tabs {
    display: flex; gap: 6px; margin-bottom: 20px;
    background: #f2f5f3; padding: 4px; border-radius: 10px;
}
.rc-tabs button {
    flex: 1; border: 0; background: transparent; padding: 10px;
    font-size: 12px; font-weight: 700; border-radius: 8px;
    cursor: pointer; color: var(--muted);
}
.rc-tabs button.active { background: #fff; color: var(--dark); box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.rc-field { margin-bottom: 12px; }
.rc-field label {
    display: block; font-size: 10px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .5px;
    color: var(--muted); margin-bottom: 5px;
}
.rc-field input {
    width: 100%; border: 1px solid var(--border);
    border-radius: 10px; padding: 11px 13px;
    font-size: 13px; background: #fafbfa;
}
.rc-field input:focus {
    outline: 0; border-color: var(--green); background: #fff;
    box-shadow: 0 0 0 3px rgba(8,120,79,.08);
}
.rc-error {
    background: #fdecec; color: #b23a3a; border-radius: 10px;
    padding: 10px 12px; font-size: 12px; margin-bottom: 12px;
}
.rc-modal .btn { width: 100%; min-height: 46px; margin-top: 8px; }
.rc-form { display: none; }
.rc-form.active { display: block; }


/* ============================================================
   CAMPAIGN BADGES + SALE PRICE + LOW STOCK
   ============================================================ */

/* Badge colors */
.product-badge {
    position: absolute;
    left: 9px; top: 9px;
    color: #fff;
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .4px;
    z-index: 2;
    background: var(--orange);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.product-badge.badge-orange { background: #f58220; }
.product-badge.badge-green  { background: #08784f; }
.product-badge.badge-red    { background: #dc2626; }
.product-badge.badge-blue   { background: #1d5fa5; }
.product-badge.badge-purple { background: #7c3aed; }
.product-badge.badge-dark   { background: #10251c; }

/* Sale price display */
.price .now      { color: #dc2626; font-weight: 800; }
.price .was {
    color: #9ca3af;
    text-decoration: line-through;
    font-weight: 500;
    font-size: 0.75em;
    margin-left: 6px;
}

/* Stock states */
.stock        { color: #08784f; font-size: 9px; font-weight: 700; }
.stock.low    { color: #d97706; }
.stock.out    { color: #dc2626; }

/* Card bottom row: lock button alignment */
.product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 10px;
    min-height: 34px;
}
.product-bottom .stock { flex: 1 1 auto; min-width: 0; }
.product-bottom .add-cart { flex: 0 0 34px; }

/* "Choose options" variant of the button */
.add-cart.choose {
    width: auto;
    padding: 0 12px;
    flex: 0 1 auto !important;
    background: var(--dark);
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    gap: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    min-height: 34px;
    transition: .2s;
}
.add-cart.choose:hover { background: #1a2e25; }
.add-cart.choose i { font-size: 12px; }



/* ============================================================
   PRODUCT CARD — universal styling
   ============================================================ */

.product-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 15px;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

/* Image area */
.product-image {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f2f4f3;
    overflow: hidden;
}
.product-image-link {
    display: block;
    width: 100%;
    height: 100%;
}
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    display: block;
    transition: transform .3s;
}
.product-card:hover .product-image img { transform: scale(1.04); }

/* Wishlist button */
.product-image .wishlist {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.95);
    color: #5c6962;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 4;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    line-height: 1;
    transition: background .2s, color .2s, transform .15s;
    padding: 0;
}
.product-image .wishlist i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    pointer-events: none;
}
.product-image .wishlist:hover {
    background: #fff;
    color: #e34e48;
    transform: scale(1.08);
}
.product-image .wishlist.active { color: #e34e48; }
.product-image .wishlist.active i { font-weight: 900; }
.product-image .wishlist.is-busy { pointer-events: none; opacity: .75; }
.product-image .wishlist.is-busy i { animation: rcSpin .8s linear infinite; }
@keyframes rcSpin { to { transform: rotate(360deg); } }

/* Badge */
.product-badge {
    position: absolute;
    left: 9px;
    top: 9px;
    color: #fff;
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .4px;
    z-index: 3;
    background: var(--orange);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.product-badge.badge-orange { background: #f58220; }
.product-badge.badge-green  { background: #08784f; }
.product-badge.badge-red    { background: #dc2626; }
.product-badge.badge-blue   { background: #1d5fa5; }
.product-badge.badge-purple { background: #7c3aed; }
.product-badge.badge-dark   { background: #10251c; }

/* Body */
.product-content {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-category {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: #89958f;
    margin-bottom: 5px;
    letter-spacing: .4px;
}
.product-name {
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
    min-height: 35px;
    display: block;
    color: var(--dark);
}
.seller {
    font-size: 10px;
    color: #75817b;
    margin-top: 7px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.seller .verified { color: var(--green); }

/* Price */
.price {
    margin-top: 9px;
    font-size: 18px;
    font-weight: 800;
    color: var(--dark);
}
.price .now { color: #dc2626; font-weight: 800; }
.price .was {
    color: #9ca3af;
    text-decoration: line-through;
    font-weight: 500;
    font-size: 0.75em;
    margin-left: 6px;
}

/* Bottom row: stock text left, button right, always aligned */
.product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    min-height: 36px;
}
.product-bottom .stock {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 9px;
    font-weight: 700;
    color: var(--green);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.product-bottom .stock.low { color: #d97706; }
.product-bottom .stock.out { color: #dc2626; }

/* Cart button: solid green square */
.product-bottom .add-cart {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: var(--green);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 2px 6px rgba(8,120,79,.20);
    text-decoration: none;
}
.product-bottom .add-cart i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
}
.product-bottom .add-cart:hover {
    background: var(--green-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8,120,79,.30);
}
.product-bottom .add-cart:active { transform: translateY(0); }

/* "Choose options" pill button */
.product-bottom .add-cart.choose {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    padding: 0 12px;
    height: 36px;
    min-height: 36px;
    background: var(--dark);
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.product-bottom .add-cart.choose:hover {
    background: #1a2e25;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.product-bottom .add-cart.choose i { font-size: 12px; }

/* Mobile: shrink the button but keep it perfectly centred */
@media (max-width: 600px) {
    .product-bottom { min-height: 34px; }
    .product-bottom .add-cart {
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        border-radius: 8px;
    }
    .product-bottom .add-cart i { font-size: 13px; }
    .product-bottom .add-cart.choose {
        height: 34px;
        min-height: 34px;
        padding: 0 10px;
        font-size: 10.5px;
    }
}


.cat-overlay {
    position: fixed; inset: 0;
    background: rgba(10, 25, 18, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none;
    transition: opacity .3s ease;
    z-index: 1080;
}
.cat-overlay.open { opacity: 1; pointer-events: auto; }
.cat-sidebar {
    position: fixed; top: 0; right: 0;
    width: 100%; max-width: 440px; height: 100vh;
    background: #fff;
    box-shadow: -12px 0 40px rgba(0,0,0,.18);
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1090;
    display: flex; flex-direction: column; overflow: hidden;
}
.cat-sidebar.open { transform: translateX(0); }
.cat-sidebar-head {
    padding: 22px 24px 18px;
    background: linear-gradient(135deg, #065f3e 0%, #08784f 50%, #0a9363 100%);
    color: #fff;
    display: flex; align-items: center; gap: 14px;
    flex-shrink: 0; position: relative; overflow: hidden;
}
.cat-sidebar-head .ico {
    width: 48px; height: 48px; border-radius: 14px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.25);
    display: grid; place-items: center; font-size: 20px;
    flex-shrink: 0;
}
.cat-sidebar-head .txt { flex: 1; }
.cat-sidebar-head h2 { font-family: Manrope, sans-serif; font-size: 20px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 3px; }
.cat-sidebar-head p { font-size: 12px; color: rgba(255,255,255,.8); }
.cat-sidebar-close {
    width: 38px; height: 38px; border: 0; border-radius: 50%;
    background: rgba(255,255,255,.18); color: #fff;
    cursor: pointer; display: grid; place-items: center; font-size: 15px;
}
.cat-sidebar-body { flex: 1; overflow-y: auto; padding: 18px; }
.cat-sidebar-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cat-tile {
    background: #fff; border: 1px solid var(--border);
    border-radius: 14px; overflow: hidden;
    text-decoration: none; color: var(--dark);
    display: flex; flex-direction: column;
    transition: all .2s ease;
}
.cat-tile:hover { transform: translateY(-3px); border-color: transparent; box-shadow: 0 10px 24px rgba(8, 120, 79, 0.15); }
.cat-tile .thumb {
    aspect-ratio: 1/1; background: linear-gradient(135deg, #f6faf7, #eef4f0);
    display: grid; place-items: center; overflow: hidden;
}
.cat-tile .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.cat-tile .thumb .fallback {
    width: 100%; height: 100%; display: grid; place-items: center;
    color: #08784f; font-size: 30px;
    background: linear-gradient(135deg, #d1f0e0, #b8e6d0);
}
.cat-tile .info { padding: 12px; text-align: center; }
.cat-tile .name { font-size: 12px; font-weight: 700; line-height: 1.35; color: #0a3d28; min-height: 32px; }
.cat-tile .count {
    display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
    background: linear-gradient(135deg, rgba(8,120,79,0.10), rgba(8,120,79,0.05));
    color: #08784f; font-size: 10px; font-weight: 800;
    padding: 4px 10px; border-radius: 50px;
    border: 1px solid rgba(8, 120, 79, 0.12);
}
.cat-sidebar-footer {
    padding: 14px 18px; border-top: 1px solid var(--border);
    background: #f9fbfa; text-align: center;
}
.cat-sidebar-footer a {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 22px;
    background: linear-gradient(135deg, #08784f, #0a9363);
    color: #fff; border-radius: 12px; font-size: 13px; font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(8, 120, 79, 0.25);
}

body.rc-noscroll { overflow: hidden; }

@media (max-width: 600px) {
    .cat-sidebar { max-width: 100%; }
    .cat-sidebar-head { padding: 18px 18px 14px; }
    .cat-sidebar-head h2 { font-size: 18px; }
    .cat-sidebar-body { padding: 14px; }
    .cat-sidebar-grid { gap: 10px; }
    .cat-tile .info { padding: 10px; }
    .cat-tile .name { font-size: 11px; }
}

@media (max-width: 600px) {
    body { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0)); }
}