body:has(.grocery-detail) { background: #f7f7f7; padding-bottom: 0; }
body:has(.grocery-detail) .front-topbar, body:has(.grocery-detail) .front-footer { display: none !important; }
.grocery-detail { --gd-green: #009c58; --gd-muted: #999; color: #111; font-family: Inter, system-ui, sans-serif; padding-bottom: calc(145px + env(safe-area-inset-bottom)); }
.grocery-detail * { box-sizing: border-box; }
.grocery-detail [hidden] { display: none !important; }
.grocery-detail a { text-decoration: none; }
.grocery-detail button, .grocery-detail input { font: inherit; }
.grocery-detail :focus-visible { outline: 3px solid var(--gd-green); outline-offset: 4px; }
.gd-toolbar { position: fixed; top: 0; left: 0; right: 0; z-index: 25; padding: 22px 18px 12px; display: flex; align-items: center; gap: 12px; pointer-events: none; }
.gd-toolbar > * { pointer-events: auto; }
.gd-toolbar form { margin: 0 0 0 auto; }
.gd-circle { display: grid; place-items: center; width: 48px; height: 48px; padding: 12px; background: white; border: 0; border-radius: 50%; box-shadow: 0 6px 16px #0000000e; color: #111; flex-shrink: 0; }
.gd-circle svg { width: 24px; height: 24px; }
.gd-wished { color: #d83b4c; }
.gd-sticky-title { opacity: 0; min-width: 0; flex: 1; text-align: center; font-weight: 700; font-size: 17px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; transition: opacity .15s; }
.gd-scrolled { background: white; box-shadow: 0 1px 0 #ededed; padding-top: max(12px, env(safe-area-inset-top)); }
.gd-scrolled .gd-sticky-title { opacity: 1; }
.gd-scrolled .gd-circle { box-shadow: none; }
.gd-gallery { position: relative; height: clamp(265px, 72vw, 490px); background: white; padding: 62px 38px 50px; }
.gd-slides, .gd-slide { width: 100%; height: 100%; }
.gd-slide img { width: 100%; height: 100%; display: block; object-fit: contain; }
.gd-empty-image { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 12px; font-size: 14px; color: #aaa; }
.gd-empty-image svg { width: 58px; height: 58px; }
.gd-gallery-arrow { position: absolute; top: 45%; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #777c; color: white; display: grid; place-items: center; padding: 8px; box-shadow: 0 2px 6px #0002; }
.gd-gallery-arrow svg { width: 20px; height: 20px; }
.gd-gallery-prev { left: 10px; }
.gd-gallery-next { right: 10px; }
.gd-dots { display: flex; align-items: center; justify-content: center; gap: 5px; position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%); padding: 3px; }
.gd-dots button { width: 8px; height: 8px; padding: 0; border-radius: 20px; border: 1px solid #eee; background: white; box-shadow: 0 1px 5px #0002; }
.gd-dots button[aria-pressed=true] { width: 21px; background: var(--gd-green); border-color: var(--gd-green); }
.gd-intro { background: white; padding: 14px 22px 25px; }
.gd-store { display: flex; gap: 8px; align-items: center; font-size: 15px; color: #222; margin-bottom: 9px; }
.gd-store img { object-fit: contain; border-radius: 50%; }
.gd-intro h1 { font-size: 23px; line-height: 1.3; letter-spacing: -.3px; font-weight: 700; margin: 0 0 9px; }
.gd-rating { display: flex; gap: 7px; align-items: center; font-size: 15px; color: var(--gd-muted); margin-bottom: 3px; }
.gd-rating > span { color: #f1b900; font-size: 22px; line-height: 1; }
.gd-price { font-size: 23px; font-weight: 700; line-height: 1.4; letter-spacing: -.5px; }
.gd-price del { font-size: 16px; color: #222; font-weight: 400; margin-left: 6px; letter-spacing: 0; white-space: nowrap; }
.gd-unit { margin: 10px 0 0; color: var(--gd-muted); font-size: 17px; }
.gd-discount { display: inline-block; margin-top: 15px; background: #ff252e; color: white; border-radius: 22px; padding: 4px 11px; font-size: 14px; }
.gd-description { margin-top: 22px; }
.gd-description-text { color: var(--gd-muted); font-size: 17px; line-height: 1.5; white-space: pre-line; margin: 0; }
.gd-clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.gd-description-toggle { color: #168d64; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border: 0; background: transparent; font-size: 16px !important; font-weight: 500 !important; }
.gd-description-toggle svg { width: 20px; height: 20px; }
.gd-description-toggle[aria-expanded=true] svg { transform: rotate(180deg); }
.gd-specifications { color: #666; font-size: 15px; margin-top: 12px; }
.gd-specifications summary { font-weight: 600; cursor: pointer; }
.gd-specifications dl { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gd-specifications dd { margin: 0; }
.gd-options { padding: 24px 18px 20px; display: flex; flex-direction: column; gap: 18px; }
.gd-option-card { background: white; border-radius: 24px; padding: 24px; }
.gd-option-card summary { display: flex; align-items: flex-start; list-style: none; cursor: pointer; gap: 10px; }
.gd-option-card summary::-webkit-details-marker { display: none; }
.gd-group-title { font-size: 20px; line-height: 1.3; font-weight: 700; flex: 1; min-width: 0; }
.gd-group-title small { display: block; color: var(--gd-muted); font-weight: 400; font-size: 14px; margin-top: 8px; }
.gd-required, .gd-optional { font-size: 13px; padding: 7px 12px; border-radius: 22px; white-space: nowrap; }
.gd-required { color: #d93942; background: #fceaea; }
.gd-optional { color: #777; background: #f5f5f5; }
.gd-chevron { width: 34px; height: 34px; border-radius: 50%; background: #f4f4f4; display: grid; place-items: center; flex-shrink: 0; }
.gd-chevron svg { width: 20px; height: 20px; }
.gd-option-card:not([open]) .gd-chevron svg { transform: rotate(180deg); }
.gd-option-rows { margin-top: 17px; }
.gd-option-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: 17px; line-height: 1.4; cursor: pointer; }
.gd-option-row > span:first-child { flex: 1; min-width: 0; }
.gd-option-row small { display: block; font-size: 13px; color: #999; margin-top: 3px; }
.gd-option-row input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; flex: 0 0 24px; border: 1.5px solid #aaa; border-radius: 50%; margin: 0; cursor: pointer; }
.gd-option-row input[type=checkbox] { border-radius: 6px; }
.gd-option-row input:checked { border: 5px solid var(--gd-green); }
.gd-option-row:has(input:disabled) { color: #b5b5b5; cursor: not-allowed; }
.gd-option-row input:disabled { opacity: .4; cursor: not-allowed; }
.gd-extra-price { white-space: nowrap; font-size: 15px; }
.gd-reset { align-self: flex-end; border: 0; background: transparent; color: #168d64; font-size: 13px !important; padding: 0 8px; margin: -8px 0; text-decoration: underline; text-underline-offset: 3px; }
.gd-unavailable { padding: 20px; text-align: center; background: #e1f0e7; color: #168d64; font-size: 20px; border-radius: 14px; }
.gd-selection-status { color: #888; text-align: center; font-size: 13px; margin: 0; }
.gd-selection-status:empty { display: none; }
.gd-pinned-action { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; padding: 16px 22px calc(16px + env(safe-area-inset-bottom)); background: white; box-shadow: 0 -10px 22px #00000005; }
.gd-action-inner { max-width: 1056px; margin: auto; }
.gd-total-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; font-weight: 700; font-size: 19px; }
.gd-total-row strong { font-size: 23px; }
.gd-original-total { font-size: 14px; font-weight: 400; color: #999; margin-right: 8px; }
.gd-controls { display: flex; gap: 20px; align-items: center; }
.gd-stepper { display: flex; align-items: center; flex-shrink: 0; }
.gd-stepper button { width: 42px; height: 46px; border: 0; background: #f5f5f5; border-radius: 13px; font-size: 28px; color: #111; }
.gd-stepper button:disabled { color: #bbb; }
.gd-stepper input { border: 0; width: 40px; text-align: center; font-size: 18px; font-weight: 600; background: white; padding: 0; -moz-appearance: textfield; }
.gd-stepper input::-webkit-inner-spin-button, .gd-stepper input::-webkit-outer-spin-button { appearance: none; }
#gd-add-button { border: 0; background: var(--gd-green); color: white; min-height: 48px; border-radius: 12px; flex: 1; padding: 12px 10px; font-size: 17px; font-weight: 700; }
#gd-add-button:disabled { background: #d1d1d1; color: #666; cursor: not-allowed; font-size: 14px; }
@media (min-width: 768px) {
    .grocery-detail { max-width: 1120px; margin: 32px auto; padding: 0 24px 155px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
    .gd-toolbar { max-width: 1108px; margin: auto; background: transparent; }
    .gd-sticky-title { max-width: 650px; }
    .gd-scrolled { max-width: none; background: white; }
    .gd-gallery { height: 560px; border-radius: 24px; position: sticky; top: 32px; padding: 90px 40px 70px; }
    .gd-intro { padding: 28px; border-radius: 24px; }
    .gd-intro h1 { font-size: 29px; }
    .gd-options { padding: 20px 0; }
    .gd-action-inner { max-width: 1056px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 32px; }
    .gd-total-row { margin: 0; }
}
@media (max-width: 360px) {
    .gd-intro { padding-left: 18px; padding-right: 18px; }
    .gd-options { padding-left: 14px; padding-right: 14px; }
    .gd-option-card { padding: 20px 16px; }
    .gd-controls { gap: 12px; }
    .gd-stepper button { width: 34px; }
    .gd-stepper input { width: 32px; }
    .gd-price { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { .gd-sticky-title { transition: none; } }

/* Keep the storefront navigation visible below the item purchase controls. */
@media (max-width: 767px) {
    body:has(.grocery-detail) { --item-bottom-nav-height: calc(66px + env(safe-area-inset-bottom, 0px)); }
    body:has(.grocery-detail) .mobile-bottom-nav {
        display: flex;
        height: var(--item-bottom-nav-height);
        box-sizing: border-box;
    }
    .gd-pinned-action {
        bottom: var(--item-bottom-nav-height);
        padding-bottom: 16px;
    }
    .grocery-detail { padding-bottom: calc(225px + env(safe-area-inset-bottom, 0px)); }
}
