/* Semantic colors follow the shop surface, including an explicit merchant
   background when the visitor's device uses the opposite color scheme. */
.design-theme {
    --surface: var(--paper);
    --shop-success: light-dark(#146c43, #9de9c2);
    --shop-warning: light-dark(#805800, #ffe099);
    --shop-danger: light-dark(#ad2633, #ffb9c1);
    --shop-link: light-dark(#3450a0, #adc4ff);
}
.design-theme .availability { color: var(--shop-success); }
.design-theme .availability.unavailable { color: var(--muted); }
.design-theme .detail-description, .design-theme .product-details p,
.design-theme .product-details li { color: var(--text); }
.theme-market {
    --market-card: var(--paper);
    --market-card-border: var(--line);
    --market-card-text: var(--ink);
    --market-card-muted: var(--muted);
    --market-cyan: var(--shop-link);
}
.theme-market .product-card .product-photo,
.theme-market .products-showcase .product-photo,
.theme-market .detail-photo.gallery-main,
.theme-market .gallery-thumbs button { background: #fff; }
.theme-market .product-card .product-photo img, .theme-market .detail-photo.gallery-main img { filter: none; }
.theme-market .product-card { box-shadow: 0 3px 14px #0000000a; }
.theme-market .product-card:hover { border-color: var(--market-action); }
.theme-market .product-details, .theme-market .detail-benefit { background: var(--wash); }
.theme-market .header-main {
    display: grid;
    grid-template-columns: minmax(120px,180px) minmax(180px,1fr) auto;
    align-items: center;
    gap: 28px;
    height: auto;
    min-height: 106px;
    padding-block: 18px;
}
.theme-market .header-main .brand { grid-column: 1; grid-row: 1; min-width: 0; }
.theme-market .header-main .brand img { width: auto; max-width: 100%; height: 64px; max-height: 64px; object-fit: contain; }
.theme-market .header-main .header-search {
    grid-column: 2; grid-row: 1; order: initial; min-width: 0; width: 100%;
    max-width: none; min-height: 48px; margin: 0; background: var(--paper); color: var(--ink);
}
.theme-market .header-main .header-actions { grid-column: 3; grid-row: 1; justify-content: flex-end; gap: 18px; }
.theme-market .header-actions .icon-button, .theme-market .header-actions .cart-button { min-height: 44px; }
.theme-market .header-actions .market-action-label { white-space: nowrap; }
.theme-market .header-actions .count { min-width: 18px; height: 18px; font-size: 10px; }
.theme-market .announcement { background: var(--tint); color: var(--on-tint); padding-inline: max(24px,calc((100% - var(--theme-width,1280px))/2)); }
.announcement { gap: 12px; }
.announcement-tools { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.store-admin-link { display: inline-flex; align-items: center; gap: 6px; color: inherit; font-weight: 700; white-space: nowrap; }
.store-admin-link .icon { width: 14px; height: 14px; }
.store-admin-link:hover, .store-admin-link:focus-visible { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.store-admin-link[hidden], .announcement[hidden] { display: none; }
@media (max-width:760px) {
    .announcement { flex-wrap: wrap; justify-content: center; gap: 4px 12px; }
    .announcement-tools { justify-content: center; }
}
/* Navigation and announcement retain the merchant's editable primary/accent palette. */
.theme-market .nav-band { background: var(--market-action); color: var(--market-on-action); }
.theme-market .main-nav { flex-wrap: nowrap; justify-content: center; height: auto; min-height: 52px; gap: clamp(10px,1.1vw,18px); padding: 8px 0; border: 0; }
.theme-market .main-nav > * { flex: 0 0 auto; }
.theme-market .main-nav a, .theme-market .main-nav summary { line-height: 1.5; }
.theme-market .main-nav .nav-contact { margin-left: 0; color: inherit; }
.theme-menu-group summary { display: flex; align-items: center; gap: 6px; }
.menu-caret { width: 12px; height: 12px; flex: 0 0 12px; fill: currentColor; transition: transform 180ms ease; }
details[open] > summary > .menu-caret { transform: rotate(180deg); }
.theme-market .main-nav > a:not(.market-offers):hover,
.theme-market .main-nav > .theme-menu-group > summary:hover { color: var(--tint); }
.theme-market .announcement, .theme-market .site-header { border: 0; }
.theme-market .cart-button { border: 0; }
.theme-market .main-nav > .market-offers { padding: 8px 16px; }
.theme-market .market-departments .icon { width: 19px; height: 19px; stroke-width: 1.7; }
.theme-market .market-category-menu, .theme-market .theme-menu-links { border: 0; box-shadow: 0 12px 36px #00000018; border-radius: 14px; }
.theme-market .market-category-menu { color: var(--ink); overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: color-mix(in srgb,var(--ink) 35%,var(--paper)) transparent; }
.theme-market .main-nav .market-category-menu a,
.theme-market .main-nav .theme-menu-links a { color: var(--ink); white-space: normal; }
/* Use the compact, rounded scrollbar where supported; keep native scrolling. */
@supports selector(::-webkit-scrollbar) {
    .theme-market .market-category-menu { scrollbar-width: auto; scrollbar-color: auto; }
    .theme-market .market-category-menu::-webkit-scrollbar { width: 6px; }
    .theme-market .market-category-menu::-webkit-scrollbar-track { background: transparent; }
    .theme-market .market-category-menu::-webkit-scrollbar-thumb { background: color-mix(in srgb,var(--ink) 35%,var(--paper)); border-radius: 999px; }
    .theme-market .market-category-menu::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb,var(--ink) 55%,var(--paper)); }
    .theme-market .market-category-menu::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
}
.theme-market .market-category-menu a, .theme-market .theme-menu-links a { border-radius: 8px; padding: 10px 12px; }
.theme-market .market-category-menu a:hover, .theme-market .theme-menu-links a:hover { background: var(--wash); color: var(--ink); }
@media (prefers-reduced-motion:reduce) { .menu-caret { transition: none; } }
/* Merchant section colors belong to the contained card, never a viewport-wide stripe. */
.theme-section-shell:has(> .design-content) { background: transparent; }
.theme-v2 .theme-section-shell > .design-content { background: var(--element-bg,var(--wash)); color: var(--element-text,var(--ink)); }
.theme-market .design-content, .theme-market .design-hero { border: 0; box-shadow: none; }
.theme-market .hero-split .design-hero-copy { border: 0; }
.theme-market .design-content-image { padding: 0; margin: 0; align-self: stretch; }
.theme-market .design-category-list > a { border: 0; }
.theme-market .design-category-list > a > img { width: 100%; height: 170px; object-fit: contain; padding: 12px; background: #fffefa; }
.theme-market .product-carousel-progress { display: none; }
.theme-market .product-carousel-footer { justify-content: space-between; }
/* Slides overlap only during their animated handover; inactive slides remain hidden and inert. */
.hero-stage { display: grid; position: relative; isolation: isolate; }
.hero-stage > [data-shop-slide] { grid-area: 1 / 1; min-width: 0; width: 100%; }
.hero-stage .design-hero-photo { overflow: hidden; }
/* Honor editor header layouts without flex order moving search after actions. */
.theme-market.theme-header-stacked .header-main { grid-template-columns: minmax(120px,180px) 1fr auto; }
.theme-market.theme-header-stacked .header-main .header-search { grid-column: 1/-1; grid-row: 2; }
.theme-market.theme-header-center .header-main .brand { grid-column: 1/-1; grid-row: 1; justify-self: center; }
.theme-market.theme-header-center .header-main .header-search { grid-column: 1/3; grid-row: 2; }
.theme-market.theme-header-center .header-main .header-actions { grid-row: 2; }
@media (max-width:1100px) {
    .theme-market .header-main { gap: 18px; grid-template-columns: minmax(100px,140px) minmax(180px,1fr) auto; }
    .theme-market .header-main .header-actions { gap: 8px; }
    .theme-market .mobile-menu-toggle { display: inline-flex; }
    .theme-market .main-nav { display: none; min-height: 0; padding-block: 12px; }
    .theme-market .main-nav.open { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px 14px; }
    .theme-market .main-nav > * { min-width: 0; }
    .theme-market .main-nav > .market-departments { grid-column: 1 / -1; }
    .theme-market .main-nav.open .market-category-menu, .theme-market .main-nav.open .theme-menu-links { position: static; box-shadow: none; margin-block: 8px; }
}
@media (max-width:760px) {
    .theme-market .header-main, .theme-market.theme-header-stacked .header-main,
    .theme-market.theme-header-center .header-main { grid-template-columns: minmax(0,1fr) auto; gap: 14px; padding-block: 15px; min-height: 0; }
    .theme-market .header-main .brand, .theme-market.theme-header-center .header-main .brand { grid-column: 1; grid-row: 1; justify-self: start; }
    .theme-market .header-main .brand img { max-width: 130px; height: 52px; }
    .theme-market .header-main .header-search, .theme-market.theme-header-center .header-main .header-search { grid-column: 1/-1; grid-row: 2; min-height: 46px; }
    .theme-market .header-main .header-actions, .theme-market.theme-header-center .header-main .header-actions { grid-column: 2; grid-row: 1; gap: 5px; }
    .theme-market .main-nav { display: none; min-height: 0; }
    .theme-market .main-nav.open { display: grid; }
    .theme-market .announcement { padding-inline: 16px; font-size: 10px; line-height: 1.5; }
    .theme-market .categories-tiles .design-category-list { grid-template-columns: repeat(var(--element-mobile-columns,2),minmax(0,1fr)) !important; }
    .theme-market .design-category-list > a > img { height: 130px; padding: 10px; }
}
