/* ==========================================================================
   Grocery — quick-commerce layout: banner, promo cards, aisle tiles, product
   rows, aisle sidebar listing and a split product page.
   ========================================================================== */

body[data-page^="grocery"] { --sa-canvas: #ffffff; background: #fff; }

/* ------------------------------------------------------------------- home */
.sa-gx { max-width: 1240px; margin: 0 auto; padding: 16px var(--sa-gutter) var(--sa-s-8); }

.sa-gx-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 200px;
    overflow: hidden;
    border-radius: 16px;
    background: linear-gradient(100deg, #0b5b2a 0%, #15803d 45%, #2fa35a 100%);
    color: #fff;
    isolation: isolate;
}
.sa-gx-hero__copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; max-width: 560px; padding: 28px; }
@media (min-width: 768px) { .sa-gx-hero { min-height: 240px; } .sa-gx-hero__copy { padding: 36px 44px; } }
.sa-gx-hero__title { font-size: clamp(26px, 3.6vw, 40px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.sa-gx-hero__text { max-width: 420px; font-size: var(--sa-fs-md); color: rgba(255, 255, 255, .88); }
.sa-gx-hero__btn { margin-top: 6px; padding: 10px 18px; border-radius: 10px; background: #fff; color: var(--sa-grocery) !important; font-weight: 800; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .5); transition: transform var(--sa-fast); }
.sa-gx-hero__btn:hover { transform: translateY(-1px); }
.sa-gx-hero__img { position: absolute; inset: 0 0 0 45%; z-index: -1; }
.sa-gx-hero__img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #15803d, rgba(21, 128, 61, .15) 45%, transparent); }
@media (max-width: 639px) { .sa-gx-hero__img { inset: 0; opacity: .35; } }

.sa-gx-promos { display: grid; gap: 14px; margin-top: 18px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .sa-gx-promos { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
.sa-gx-promo {
    position: relative;
    display: flex;
    min-height: 160px;
    overflow: hidden;
    border-radius: 16px;
    transition: transform var(--sa-med) var(--sa-ease), box-shadow var(--sa-med);
}
.sa-gx-promo:hover { transform: translateY(-3px); box-shadow: 0 14px 28px -18px rgba(16, 18, 24, .5); }
.sa-gx-promo--green { background: linear-gradient(135deg, #d9f5e3, #b8ebc9); color: #0b4f25; }
.sa-gx-promo--blue { background: linear-gradient(135deg, #dceefc, #bfe0f8); color: #0b3d63; }
.sa-gx-promo--yellow { background: linear-gradient(135deg, #fff2c2, #ffe38a); color: #5c4300; }
.sa-gx-promo__copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 62%; padding: 20px; }
.sa-gx-promo__title { font-size: var(--sa-fs-xl); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.sa-gx-promo__text { font-size: var(--sa-fs-sm); opacity: .85; }
.sa-gx-promo__btn { margin-top: auto; padding: 7px 14px; border-radius: 8px; background: #1f2328; color: #fff; font-size: var(--sa-fs-sm); font-weight: 700; }
.sa-gx-promo__img { position: absolute; right: -10px; bottom: -10px; width: 46%; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .45); }

.sa-gx-section { padding: 22px 0 6px; }
.sa-gx-cats { display: grid; gap: 14px 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 640px) { .sa-gx-cats { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .sa-gx-cats { grid-template-columns: repeat(10, minmax(0, 1fr)); } }
.sa-gx-cat { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.sa-gx-cat__img { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 14px; background: #eef6f1; padding: 10px; transition: transform var(--sa-fast), box-shadow var(--sa-fast); }
.sa-gx-cat__img img { border-radius: 10px; }
.sa-gx-cat__img--all { color: var(--sa-grocery); }
.sa-gx-cat:hover .sa-gx-cat__img { transform: translateY(-2px); box-shadow: 0 8px 18px -12px rgba(16, 18, 24, .45); }
.sa-gx-cat__name { font-size: 13px; font-weight: 600; line-height: 1.25; color: #1f2328; }

.sa-gx-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sa-gx-title { font-size: clamp(18px, 2vw, 22px); font-weight: 800; letter-spacing: -.02em; }
.sa-gx-head__actions { display: flex; align-items: center; gap: 8px; }
.sa-gx-seeall { margin-right: 6px; font-size: var(--sa-fs-md); font-weight: 700; color: var(--sa-grocery) !important; }
.sa-gx-seeall:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Product row: whole cards only (--per cards per view) */
.sa-gx-rail {
    --per: 2;
    --gap: 12px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--per) - 1) * var(--gap)) / var(--per));
    gap: var(--gap);
    overflow-x: auto;
    padding: 2px 2px 10px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.sa-gx-rail::-webkit-scrollbar { display: none; }
.sa-gx-rail > * { scroll-snap-align: start; }
@media (min-width: 640px) { .sa-gx-rail { --per: 4; --gap: 12px; } }
@media (min-width: 900px) { .sa-gx-rail { --per: 5; } }
@media (min-width: 1100px) { .sa-gx-rail { --per: 7; --gap: 14px; } }


/* ----------------------------------------------------------------- listing */
.sa-gl { max-width: 1240px; margin: 0 auto; }
.sa-gl__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px var(--sa-gutter); border-bottom: 1px solid #eee; background: #fff; }
.sa-gl__title { overflow: hidden; font-size: var(--sa-fs-md); font-weight: 800; white-space: nowrap; text-overflow: ellipsis; }
.sa-gl__sort { display: inline-flex; align-items: center; gap: 8px; flex: none; font-size: var(--sa-fs-sm); color: var(--sa-muted); }
@media (max-width: 639px) { .sa-gl__sort > span { display: none; } }
.sa-gl__sort select { padding: 7px 10px; border: 1px solid #e0e0e0; border-radius: 8px; background: #fff; font: inherit; font-weight: 700; color: var(--sa-grocery); cursor: pointer; }
.sa-gl__body { display: grid; grid-template-columns: 80px minmax(0, 1fr); }
@media (min-width: 768px) { .sa-gl__body { grid-template-columns: 112px minmax(0, 1fr); } }
.sa-gl__side {
    position: sticky;
    top: var(--sa-header-h);
    align-self: start;
    max-height: calc(100vh - var(--sa-header-h));
    overflow-y: auto;
    border-right: 1px solid #eee;
    scrollbar-width: thin;
}
.sa-gl__cat {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 12px 6px;
    border: 0;
    border-bottom: 1px solid #f3f3f3;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    color: #333;
    text-align: center;
    cursor: pointer;
}
.sa-gl__cat:hover { background: #f7fbf8; }
.sa-gl__cat[aria-pressed="true"] { background: #eaf7ee; color: #0b4f25; font-weight: 800; }
.sa-gl__cat[aria-pressed="true"]::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 4px; border-radius: 4px 0 0 4px; background: var(--sa-grocery); }
.sa-gl__catimg { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: #f3f6f9; }
@media (min-width: 768px) { .sa-gl__catimg { width: 56px; height: 56px; } }
.sa-gl__catimg--all { color: var(--sa-grocery); }
.sa-gl__main { min-width: 0; min-height: 70vh; padding: 12px; background: #f4f6fb; }
@media (min-width: 768px) { .sa-gl__main { padding: 16px; } }
.sa-gl__grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .sa-gl__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1024px) { .sa-gl__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .sa-gl__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ------------------------------------------------------------ product page */
.sa-gp { max-width: 1240px; margin: 0 auto; padding: 0 var(--sa-gutter) var(--sa-s-8); }
.sa-gp__split { display: grid; grid-template-columns: 1fr; border-bottom: 1px solid #eee; }
@media (min-width: 900px) { .sa-gp__split { grid-template-columns: 1fr 1fr; } }
.sa-gp__media { padding: 20px 0; }
@media (min-width: 900px) { .sa-gp__media { padding: 28px 32px 32px 0; border-right: 1px solid #eee; } }
.sa-gp__img { max-width: 460px; aspect-ratio: 1; margin: 0 auto; border-radius: 12px; }
.sa-gp__details { margin-top: 28px; }
.sa-gp__subtitle { margin-bottom: 12px; font-size: var(--sa-fs-lg); font-weight: 800; }
.sa-gp__facts { display: flex; flex-direction: column; gap: 14px; margin: 0; font-size: var(--sa-fs-sm); }
.sa-gp__facts dt { font-weight: 700; color: #1f1f1f; }
.sa-gp__facts dd { margin: 2px 0 0; color: #666; }
.sa-gp__facts ul { padding-left: 18px; list-style: disc; }
.sa-gp__info { padding: 8px 0 28px; }
@media (min-width: 900px) { .sa-gp__info { position: sticky; top: var(--sa-header-h); align-self: start; padding: 32px 0 32px 32px; } }
.sa-gp__crumbs { font-size: 12px; font-weight: 600; color: #1f1f1f; }
.sa-gp__crumbs a:hover { text-decoration: underline; }
.sa-gp__crumbs span { color: #828282; }
.sa-gp__eta { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; background: #f2f2f2; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.sa-gp__eta .sa-icon { width: 12px; height: 12px; stroke-width: 2.5; }
.sa-gp__name { margin: 8px 0 10px; font-size: clamp(20px, 2.4vw, 26px); font-weight: 800; letter-spacing: -.02em; }
.sa-gp__buy { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 16px 0; border-top: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0; }
.sa-gp__unit { font-size: var(--sa-fs-sm); color: #666; }
.sa-gp__price { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.sa-gp__price strong { font-size: var(--sa-fs-xl); font-weight: 800; }
.sa-gp__price s { color: #828282; }
.sa-gp__off { padding: 2px 6px; border-radius: 4px; background: #256fef; color: #fff; font-size: 11px; font-weight: 800; }
.sa-gp__tax { font-size: 11px; color: #828282; }
.sa-addctl--cart .sa-addbtn,
.sa-addctl--cart .sa-stepper { min-height: 44px; border-radius: 8px; font-size: var(--sa-fs-md); font-weight: 700; }
.sa-addctl--cart .sa-addbtn { padding: 0 22px; border: 0; background: #318616; color: #fff; }
.sa-addctl--cart .sa-addbtn:hover { background: #276d12; color: #fff; }
.sa-addctl--cart .sa-addbtn .sa-icon { display: none; }
.sa-addctl--cart .sa-stepper { background: #318616; color: #fff; animation: none; }
.sa-addctl--cart .sa-stepper button { width: 44px; height: 44px; }
.sa-gp__why { margin-top: 26px; }
.sa-gp__why ul { display: flex; flex-direction: column; gap: 16px; }
.sa-gp__why li { display: flex; gap: 14px; font-size: 13px; color: #666; }
.sa-gp__why strong { display: block; margin-bottom: 2px; font-size: var(--sa-fs-sm); color: #1f1f1f; }
.sa-gp__whyicon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: #eaf7ee; color: var(--sa-grocery); }

/* --------------------------------------------- delivery slot picker (checkout) */
.sa-slots__days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.sa-slots__day { flex: none; display: flex; flex-direction: column; align-items: center; min-width: 76px; padding: 10px; border: 1.5px solid var(--sa-line); border-radius: var(--sa-r-md); background: #fff; font-size: var(--sa-fs-xs); font-weight: 700; cursor: pointer; }
.sa-slots__day strong { font-size: var(--sa-fs-md); }
.sa-slots__day[aria-pressed="true"] { border-color: var(--sa-accent); background: var(--sa-accent-soft); color: var(--sa-accent-ink); }
.sa-slots__times { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 12px; }
.sa-slots__times .sa-option { padding: 10px 12px; justify-content: center; font-size: var(--sa-fs-sm); font-weight: 700; }
.sa-slots__times .sa-option.is-full { opacity: .45; cursor: not-allowed; }
