/* Online shop - shared by every banner; colours/fonts come from the banner theme (:root in layout.php). */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: 'Open Sans', Arial, sans-serif; color: var(--text); background: #fff; font-size: 15px; line-height: 1.45; }
a { color: var(--primary); }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 18px; padding-bottom: 40px; min-height: 60vh; }
.small { font-size: 13px; }
.muted { color: #666; }
.hidden, [hidden] { display: none !important; }

/* header */
.site-head { border-bottom: 1px solid #e6e1d8; background: #fff; position: sticky; top: 0; z-index: 20; }
.site-head > .head-row-wrap { background: var(--head-bg); }
.head-row { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.logo img { height: 54px; width: auto; display: block; }
.search { flex: 1 1 320px; display: flex; min-width: 0; }
.search input { flex: 1; min-width: 0; padding: 10px 12px; border: 2px solid var(--primary); border-right: 0; border-radius: 6px 0 0 6px; font-size: 15px; }
.search button { background: var(--primary); color: #fff; border: 0; padding: 0 16px; border-radius: 0 6px 6px 0; font-weight: 600; cursor: pointer; }
.head-links { display: flex; gap: 16px; align-items: center; white-space: nowrap; }
.head-links a { text-decoration: none; color: var(--head-text); }
.store-pick { line-height: 1.1; }
.store-pick .small { display: block; color: var(--head-text); opacity: .8; font-size: 11px; }
.cart-link { background: var(--accent); color: #fff !important; padding: 8px 14px; border-radius: 20px; font-weight: 600; }
.cart-count { background: #fff; color: var(--accent); border-radius: 10px; padding: 0 7px; margin-left: 4px; font-size: 13px; }
.dept-bar { background: var(--primary); }
.dept-bar .wrap { display: flex; gap: 22px; overflow-x: auto; }
.dept-bar a { color: #fff; text-decoration: none; padding: 9px 0; font-weight: 600; white-space: nowrap; }
.dept-bar a.hot { color: #ffe27a; }
.dept-bar .site-link { margin-left: auto; font-weight: 400; opacity: .85; }
.flash { margin-top: 12px; padding: 10px 14px; background: #fff7d6; border: 1px solid #ecd98a; border-radius: 6px; }

/* type */
h1, h2, .section-title { font-family: var(--heading-font); font-weight: normal; color: var(--accent); text-transform: uppercase; letter-spacing: .5px; }
.section-title { font-size: 30px; margin: 24px 0 12px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-title .more { font-family: 'Open Sans', Arial, sans-serif; font-size: 14px; text-transform: none; margin-left: auto; letter-spacing: 0; }
.section-title .small { font-family: 'Open Sans', Arial, sans-serif; text-transform: none; letter-spacing: 0; }

/* buttons */
.btn { display: inline-block; background: var(--primary); color: #fff; border: 0; border-radius: 6px; padding: 10px 16px; font: 600 15px 'Open Sans', Arial, sans-serif; text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { background: var(--primary-dark); }
.btn.ghost { background: #fff; color: var(--primary); border: 2px solid var(--primary); }
.btn.block { display: block; width: 100%; }
.btn.big { padding: 14px; font-size: 17px; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkish { background: none; border: 0; color: var(--primary); text-decoration: underline; cursor: pointer; padding: 0; font: inherit; }

/* home */
.hero { background: var(--band); border-radius: 10px; padding: 28px; margin-top: 6px; }
.hero h1 { margin: 0 0 6px; font-size: 40px; }
.hero p { margin: 8px 0; max-width: 640px; }
.dept-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.dept-tile { display: block; padding: 16px; border: 1px solid #e6e1d8; border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 600; background: #fff; }
.dept-tile span { display: block; font-weight: 400; color: #777; font-size: 13px; }
.dept-tile:hover { border-color: var(--primary); }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.scroll-row { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: minmax(180px, 200px); overflow-x: auto; padding-bottom: 8px; }
.card { position: relative; border: 1px solid #e6e1d8; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; background: #fff; }
.card-img { display: block; aspect-ratio: 1; }
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.badge { position: absolute; top: 8px; left: 8px; background: var(--sale); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.badge.ad { background: var(--accent); }
.card-body { flex: 1; margin: 8px 0; }
.price strong { font-size: 18px; }
.price s { color: #777; font-size: 13px; margin-left: 6px; }
.on-sale .price strong, .price.on-sale strong { color: var(--sale); }
.card .name { display: block; color: var(--text); text-decoration: none; font-size: 14px; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.meta { color: #777; font-size: 12px; margin-top: 2px; }
.add { margin: 0; }
.add-btn { width: 100%; }
.stepper { display: flex; align-items: center; justify-content: space-between; border: 2px solid var(--primary); border-radius: 6px; overflow: hidden; }
.stepper button { background: var(--primary); color: #fff; border: 0; width: 40px; height: 38px; font-size: 20px; cursor: pointer; }
.stepper span { font-weight: 700; }

/* shop page */
.shop-layout { display: grid; grid-template-columns: 230px 1fr; gap: 24px; }
.filters summary { font-weight: 700; cursor: pointer; margin-bottom: 6px; }
.dept-list, .dept-list ul { list-style: none; margin: 0; padding: 0; }
.dept-list li { margin: 2px 0; }
.dept-list a { color: var(--text); text-decoration: none; display: block; padding: 3px 0; }
.dept-list li.open > a { font-weight: 700; color: var(--accent); }
.dept-list ul { padding-left: 12px; border-left: 2px solid var(--band); margin: 4px 0 8px; }
.dept-list ul a { font-size: 14px; }
.dept-list ul a.on { font-weight: 700; color: var(--primary); }
.dept-list span { color: #999; font-size: 12px; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.results-head h1 { margin: 0; font-size: 30px; }
.sort { display: flex; gap: 12px; align-items: center; }
.sort select { padding: 6px; }
.pager { display: flex; gap: 6px; justify-content: center; margin: 24px 0; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 12px; border: 1px solid #ddd; border-radius: 6px; text-decoration: none; }
.pager .cur { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager .gap { border: 0; }

/* item page */
.crumbs { font-size: 13px; margin-bottom: 10px; }
.item-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.item-img img { width: 100%; border: 1px solid #eee; border-radius: 8px; }
.item-info h1 { font-family: 'Open Sans', Arial, sans-serif; text-transform: none; color: var(--text); font-size: 24px; font-weight: 700; margin: 0; letter-spacing: 0; }
.brand { color: #777; margin: 0; font-weight: 600; }
.price.big strong { font-size: 30px; }
.ends { display: block; color: var(--sale); font-size: 13px; }
.item-info .add { max-width: 280px; margin: 16px 0; }
.aisle { background: var(--band); padding: 8px 12px; border-radius: 6px; display: inline-block; }
.note { background: #f4f8fc; padding: 8px 12px; border-radius: 6px; font-size: 14px; }

/* weekly ad */
.ad-pages { display: grid; gap: 16px; }
.ad-page { position: relative; width: 100%; max-width: 1000px; margin: 0 auto; }
.ad-page img { width: 100%; height: 100%; display: block; }
.hotspot { position: absolute; background: rgba(255, 255, 255, 0); border: 2px solid transparent; border-radius: 6px; cursor: pointer; padding: 0; }
.hotspot:hover, .hotspot:focus { background: rgba(31, 114, 188, .12); border-color: var(--primary); outline: none; }
.ad-pages.show-boxes .hotspot { border-color: rgba(31, 114, 188, .5); }
.hotspot-dialog { border: 0; border-radius: 10px; padding: 20px; width: min(720px, 94vw); max-height: 86vh; }
.hotspot-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.hotspot-dialog h2 { margin: 0 30px 12px 0; font-size: 24px; }
.hotspot-dialog .close { position: absolute; right: 12px; top: 8px; background: none; border: 0; font-size: 28px; cursor: pointer; }
.hs-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }

/* cart & checkout */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.cart-line { display: grid; grid-template-columns: 80px 1fr 150px 90px; gap: 12px; align-items: center; border-bottom: 1px solid #eee; padding: 12px 0; }
.cart-line .name { font-weight: 600; color: var(--text); text-decoration: none; }
.cl-total { text-align: right; font-weight: 700; }
.cl-total .small { display: block; font-weight: 400; }
.sub-pref { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.sub-pref input[type=text] { padding: 5px 8px; border: 1px solid #ddd; border-radius: 4px; max-width: 380px; }
.summary { border: 1px solid #e6e1d8; border-radius: 8px; padding: 16px; position: sticky; top: 120px; background: #fff; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin: 0 0 12px; }
.totals dd { margin: 0; text-align: right; }
.totals .grand { font-weight: 700; font-size: 18px; border-top: 1px solid #ddd; padding-top: 8px; }
.totals .save { color: var(--sale); }
.warn { background: #fff4e5; border: 1px solid #f0c27b; padding: 8px 12px; border-radius: 6px; }
.warn-text { color: #a64b00; }
.error { background: #fdecec; border: 1px solid #e8a3a3; padding: 8px 12px; border-radius: 6px; color: #8a1010; }
fieldset { border: 1px solid #e6e1d8; border-radius: 8px; margin: 0 0 16px; padding: 14px 16px; }
legend { font-weight: 700; padding: 0 6px; }
label { display: block; margin: 8px 0; font-weight: 600; font-size: 14px; }
input:not([type=checkbox]):not([type=radio]), select, textarea { display: block; width: 100%; padding: 9px 10px; border: 1px solid #cfc8bb; border-radius: 6px; font: inherit; font-weight: 400; margin-top: 4px; }
.sub-pref label, .sort label { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
.row2, .row3 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { grid-template-columns: 2fr 1fr 1fr; }
.mode-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.mode-tabs a { flex: 1; text-align: center; padding: 10px; border: 2px solid var(--primary); border-radius: 6px; text-decoration: none; font-weight: 600; }
.mode-tabs a.on { background: var(--primary); color: #fff; }
.slot-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.slot-day h3 { font-size: 14px; margin: 0 0 6px; }
.tag { background: var(--band); color: var(--accent); font-size: 11px; padding: 1px 6px; border-radius: 4px; font-weight: 700; }
.slot { display: flex; align-items: center; gap: 6px; border: 1px solid #ddd; border-radius: 6px; padding: 6px 8px; margin: 4px 0; font-weight: 400; cursor: pointer; }
.slot:has(input:checked) { border-color: var(--primary); background: #eef5fc; font-weight: 700; }
.slot.full { opacity: .45; cursor: not-allowed; }
.slot .small { margin-left: auto; color: #a64b00; }
.narrow { max-width: 460px; margin: 0 auto; }
.stack .btn { margin-top: 12px; }
.store-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.store-choice { border: 1px solid #e6e1d8; border-radius: 10px; padding: 18px; }
.store-choice h2 { margin: 0 0 6px; }
.pay-box { max-width: 560px; }
#payment-element { margin: 16px 0; }
.progress { display: flex; list-style: none; padding: 0; gap: 4px; margin: 0 0 18px; flex-wrap: wrap; }
.progress li { flex: 1; min-width: 90px; text-align: center; padding: 8px 4px; background: #eee; font-size: 13px; border-radius: 4px; color: #777; }
.progress li.done { background: #d9ead3; color: #2f5f1f; }
.progress li.now { background: var(--primary); color: #fff; font-weight: 700; }
table.lines { width: 100%; border-collapse: collapse; }
table.lines th, table.lines td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #eee; vertical-align: top; }
table.lines .num { text-align: right; }
tr.st-substituted td { color: #999; text-decoration: line-through; }
tr.st-substituted td .small { text-decoration: none; }

/* footer, toast */
.site-foot { background: #222; color: #ddd; margin-top: 30px; }
.foot-row { display: flex; gap: 32px; padding-top: 24px; padding-bottom: 24px; flex-wrap: wrap; align-items: flex-start; }
.foot-row > div { display: flex; gap: 32px; flex-wrap: wrap; }
.foot-logo { height: 70px; }
.foot-row .small { max-width: 320px; color: #aaa; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 18px; border-radius: 20px; z-index: 50; }

@media (max-width: 860px) {
  .shop-layout, .item-page, .cart-layout { grid-template-columns: 1fr; }
  .filters details:not([open]) { margin-bottom: 8px; }
  .dept-bar .site-link { display: none; }
  .summary { position: static; }
  .cart-line { grid-template-columns: 64px 1fr; }
  .cl-qty, .cl-total { grid-column: 2; }
  .cl-total { text-align: left; }
  .head-links { width: 100%; justify-content: space-between; }
  .logo img { height: 42px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hero h1 { font-size: 30px; }
  .row3 { grid-template-columns: 1fr 1fr; }
}
