/* WebShop styles. The page shell (reset, tokens, navbar, footer, page header) is
   inline in webshop.html like on every other page; everything shop-specific is here. */

.muted { color: var(--text-light); }
.small { font-size: 0.85rem; }
.left { text-align: left; }
.loading { padding: 8rem 24px 4rem; color: var(--text-light); text-align: center; }

.page-header h1:focus { outline: none; } /* focused programmatically on route change for screen readers */
.page-header-compact { padding: 100px 0 36px; }
.page-header-compact h1 { font-size: 2.2rem; }
.page-header-compact p { font-size: 1.05rem; max-width: 760px; }

.shop-body { padding: 2rem 0 4rem; }

/* ---- Cards and text ---- */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.card h2 { font-size: 1.25rem; color: var(--primary-color); margin-bottom: 0.75rem; }
.card h3 { font-size: 1rem; color: var(--primary-color); margin: 1.25rem 0 0.5rem; }
.card p { margin-bottom: 0.75rem; }
.card p:last-child { margin-bottom: 0; }
.card.sticky { position: sticky; top: 84px; }
.card.empty { text-align: center; padding: 3rem 1.5rem; color: var(--text-light); }
.card.empty svg { color: var(--accent-color); margin-bottom: 1rem; }
.card.empty .btn { margin-top: 1rem; }
.ok-mark {
    display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
    background: rgba(76, 175, 80, 0.12); color: var(--success); margin-bottom: 1rem;
}
.bullets { margin: 0 0 0.75rem 1.2rem; }
.bullets li { margin: 0.3rem 0; }
.bullets.small { font-size: 0.88rem; color: var(--text-dark); }
.links { list-style: none; margin: 0; padding: 0; }
.links li { margin: 0.35rem 0; }
.ext-link { color: #0e7490; text-decoration: none; display: inline-flex; align-items: center; gap: 0.3rem; }
.ext-link:hover { text-decoration: underline; }
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.6rem 0; }

/* ---- Badges and buttons ---- */
.badge {
    display: inline-block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
    border-radius: 999px; padding: 0.15rem 0.55rem; color: var(--accent-color); background: rgba(6, 182, 212, 0.1);
}
.badge-soft { color: #0e7490; background: rgba(6, 182, 212, 0.1); }
.badge-count { color: var(--text-light); background: var(--bg-light); padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.badge-warn { color: #92400e; background: #fef3c7; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    font: inherit; font-size: 0.95rem; font-weight: 600; text-decoration: none; cursor: pointer;
    min-height: 44px; padding: 0.55rem 1.2rem; border-radius: 999px; border: 1px solid transparent;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primary { background: var(--accent-color); color: var(--white); }
.btn-primary:hover, .btn-primary:focus-visible { background: #0891b2; }
.btn-ghost { background: var(--white); color: #0e7490; border-color: rgba(6, 182, 212, 0.4); }
.btn-ghost:hover, .btn-ghost:focus-visible { background: rgba(6, 182, 212, 0.08); }
.btn-danger { background: var(--white); color: var(--danger); border-color: rgba(244, 67, 54, 0.35); }
.btn-danger:hover { background: rgba(244, 67, 54, 0.06); }
.btn-danger-ghost { background: none; color: var(--danger); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid rgba(6, 182, 212, 0.45); outline-offset: 2px; }

/* ---- Breadcrumb ---- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.75rem; padding: 0; font-size: 0.85rem; color: rgba(255, 255, 255, 0.75); position: relative; z-index: 1; }
.crumbs li + li::before { content: '›'; margin-right: 0.35rem; opacity: 0.6; }
.crumbs a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---- Catalogue ---- */
.shop-intro { background: var(--white); border-radius: 12px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07); padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; }
.shop-intro ol { margin: 0.5rem 0 0 1.25rem; color: var(--text-light); font-size: 0.95rem; }
.shop-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.shop-search-wrap { position: relative; flex: 1 1 260px; max-width: 480px; color: var(--text-light); }
.shop-search-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.shop-search {
    width: 100%; font: inherit; font-size: 0.95rem; padding: 0.6rem 1rem 0.6rem 2.6rem; min-height: 44px;
    border: 1px solid rgba(15, 23, 42, 0.15); border-radius: 999px; background: var(--white); color: var(--text-dark);
}
.shop-search:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 1px; }

.vendor { margin-bottom: 2.5rem; }
.vendor-head h2 { font-size: 1.6rem; color: var(--primary-color); margin-bottom: 0.4rem; }
.vendor-blurb { color: var(--text-dark); max-width: 900px; margin-bottom: 0.5rem; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 1.25rem; }
.chip {
    font: inherit; font-size: 0.85rem; font-weight: 500; color: var(--primary-color); background: var(--white);
    border: 1px solid rgba(15, 23, 42, 0.12); border-radius: 999px; padding: 0.4rem 0.85rem; cursor: pointer; min-height: 38px;
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.chip:hover, .chip:focus-visible { border-color: var(--accent-color); color: #0e7490; }
.chip-count { font-size: 0.75rem; color: var(--text-light); }

.shop-group { background: var(--white); border-radius: 12px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07); margin-bottom: 1.25rem; overflow: hidden; scroll-margin-top: 90px; }
.shop-group > summary { display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.5rem; cursor: pointer; user-select: none; list-style: none; }
.shop-group > summary::-webkit-details-marker { display: none; }
.shop-group > summary:hover { background: rgba(6, 182, 212, 0.04); }
.shop-group > summary:focus-visible { outline: 2px solid var(--accent-color); outline-offset: -2px; }
.shop-group > summary > svg { flex: 0 0 auto; color: var(--text-light); transition: transform 0.25s ease; }
.shop-group[open] > summary > svg { transform: rotate(180deg); }
.group-text { flex: 1 1 auto; min-width: 0; }
.group-title { display: block; font-size: 1.15rem; font-weight: 600; color: var(--primary-color); line-height: 1.3; }
.group-sub { display: block; font-size: 0.85rem; color: var(--text-light); margin-top: 0.15rem; }
.sub-title { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-light); padding: 0.5rem 1.5rem 0.4rem; }

.product-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; padding: 0.25rem 1.5rem 1.5rem; }
.search-results .product-grid { padding: 0; }
.product-card {
    display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; border: 1px solid rgba(15, 23, 42, 0.08); border-radius: 10px;
    background: var(--white); transition: border-color 0.2s, box-shadow 0.2s;
}
.product-card:hover, .product-card:focus-within { border-color: rgba(6, 182, 212, 0.5); box-shadow: 0 6px 18px rgba(6, 182, 212, 0.14); }
.product-card-body { flex: 1 1 auto; }
.product-card-name { font-size: 1.02rem; font-weight: 600; line-height: 1.3; margin-bottom: 0.25rem; }
.product-card-name a { color: var(--primary-color); text-decoration: none; }
.product-card-name a:hover { text-decoration: underline; }
.product-card-desc { font-size: 0.86rem; color: var(--text-light); line-height: 1.45; }
.product-card-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.product-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.product-card-actions .btn { flex: 1 1 auto; min-height: 40px; padding: 0.4rem 0.9rem; font-size: 0.88rem; }

/* ---- Product page ---- */
.product-layout { display: grid; grid-template-columns: 1fr; gap: 1.25rem; align-items: start; }
.edition-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.edition { border: 1px solid rgba(15, 23, 42, 0.08); border-radius: 10px; padding: 1rem; }
.edition h3 { margin: 0 0 0.35rem; }
.edition .bullets { margin-bottom: 0.5rem; }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0; font-size: 0.92rem; }
.summary dt { font-weight: 600; color: var(--text-light); }
.summary dd { margin: 0; color: var(--text-dark); word-break: break-word; }

/* ---- Configurator ---- */
.configure-layout { max-width: 860px; }
.stepper { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 0 0 1.25rem; padding: 0; }
.step { display: flex; align-items: center; }
.step > a, .step > span { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; font-weight: 500; color: var(--text-light); text-decoration: none; }
.step > a:hover .step-title { text-decoration: underline; }
.step-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 0.8rem; font-weight: 600; background: var(--bg-light); border: 1px solid rgba(15, 23, 42, 0.12); }
.step-current > span { color: var(--primary-color); font-weight: 600; }
.step-current .step-num { background: var(--accent-color); color: var(--white); border-color: var(--accent-color); }
.step-done .step-num { background: rgba(76, 175, 80, 0.15); color: var(--success); border-color: rgba(76, 175, 80, 0.4); }
.step-done > a { color: var(--text-dark); }

.choices { display: grid; grid-template-columns: 1fr; gap: 0.75rem; margin-top: 1rem; }
.choices-compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.choice {
    position: relative; display: flex; gap: 0.85rem; padding: 1rem 1rem 1rem 0.9rem; border: 2px solid rgba(15, 23, 42, 0.1); border-radius: 10px;
    cursor: pointer; background: var(--white); transition: border-color 0.15s, box-shadow 0.15s;
}
.choice:hover { border-color: rgba(6, 182, 212, 0.5); }
.choice.is-checked { border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15); background: rgba(6, 182, 212, 0.03); }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice:focus-within { outline: 3px solid rgba(6, 182, 212, 0.45); outline-offset: 2px; }
.choice-mark { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(15, 23, 42, 0.25); display: grid; place-items: center; color: transparent; margin-top: 1px; }
.choice input[type="checkbox"] + .choice-mark { border-radius: 6px; }
.choice.is-checked .choice-mark { background: var(--accent-color); border-color: var(--accent-color); color: var(--white); }
.choice-body { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; flex: 1 1 auto; }
.choice-title { font-weight: 600; color: var(--primary-color); }
.choice-summary { font-size: 0.88rem; color: var(--text-light); }
.choice-details { margin: 0.2rem 0 0 1.1rem; font-size: 0.85rem; color: var(--text-dark); }
.choice-details li { margin: 0.15rem 0; }
.choice-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.option-set { border: none; padding: 0; margin: 1.25rem 0 0; }
.option-set legend { font-weight: 600; color: var(--primary-color); }
.addon-size-wrap { margin-top: 0.4rem; }
.addon-size { font: inherit; font-size: 0.9rem; padding: 0.45rem 0.6rem; min-height: 40px; border: 1px solid rgba(15, 23, 42, 0.2); border-radius: 8px; max-width: 100%; }
.step-card { min-height: 240px; }
.step-error { margin-top: 1rem; }
.step-actions { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.review-box { border: 1px solid rgba(15, 23, 42, 0.08); border-radius: 10px; padding: 1rem; margin: 1rem 0; }
.review-box h3 { margin: 0 0 0.75rem; }
.review-box .small { margin-top: 0.75rem; }
.review-box a { color: #0e7490; }
.field { margin-bottom: 1rem; }
.field-label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text-dark); margin: 0.75rem 0 0.3rem; }
textarea, .checkout-form input {
    display: block; width: 100%; font: inherit; font-size: 0.95rem; padding: 0.6rem 0.75rem; min-height: 44px;
    border: 1px solid rgba(15, 23, 42, 0.2); border-radius: 8px; color: var(--text-dark); background: var(--white);
}
textarea { resize: vertical; }
textarea:focus-visible, .checkout-form input:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 0; }

.notice { border-radius: 8px; padding: 0.85rem 1rem; font-size: 0.9rem; margin: 0.75rem 0; }
.notice a { color: inherit; font-weight: 600; }
.notice-error { background: rgba(244, 67, 54, 0.06); border: 1px solid rgba(244, 67, 54, 0.35); color: #991b1b; }
.notice-warn { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.notice-ok { background: rgba(76, 175, 80, 0.08); border: 1px solid rgba(76, 175, 80, 0.35); color: #166534; }

/* ---- Cart and checkout ---- */
.cart-layout, .checkout-layout { display: grid; grid-template-columns: 1fr; gap: 1.25rem; align-items: start; }
.cart-item { background: var(--white); border-radius: 12px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07); padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
.cart-item-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.cart-item-head h2 { font-size: 1.15rem; margin: 0; }
.cart-item-head a { color: var(--primary-color); text-decoration: none; }
.cart-item-head a:hover { text-decoration: underline; }
.cart-item-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.cart-item-actions .btn { min-height: 40px; padding: 0.4rem 0.9rem; font-size: 0.88rem; }
.cart-list-foot { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; }
.checkout-form .btn-primary { width: 100%; margin-top: 0.5rem; }
.recaptcha-box { margin: 1rem 0 0.5rem; min-height: 78px; }
.checkout-item { border-top: 1px solid rgba(15, 23, 42, 0.08); padding: 0.75rem 0; }
.checkout-item:first-of-type { border-top: none; }
.checkout-item h3 { margin: 0 0 0.4rem; }
.checkout-side .btn { margin-top: 1rem; width: 100%; }

/* ---- Shell: resume banner, cart button, toasts ---- */
.resume { background: #ecfeff; border-bottom: 1px solid rgba(6, 182, 212, 0.3); color: #155e75; font-size: 0.9rem; }
.resume .container { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; padding-top: 0.6rem; padding-bottom: 0.6rem; }
.resume a { color: #0e7490; font-weight: 600; }
.view-catalogue .page-header, .view .page-header { margin-top: 0; }
.resume + .view .page-header { margin-top: 0; }
#app > .resume { margin-top: 60px; }
#app > .resume + .view .page-header { padding-top: 48px; }

.cart-fab {
    position: fixed; right: 20px; bottom: 20px; z-index: 900; display: inline-flex; align-items: center; gap: 0.6rem;
    font-weight: 600; color: var(--white); background: var(--primary-color); border-radius: 999px; padding: 0.85rem 1.3rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3); text-decoration: none;
}
.cart-fab:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; }
.cart-count { background: var(--accent-color); border-radius: 999px; min-width: 24px; padding: 0 0.45rem; text-align: center; font-size: 0.85rem; }
.cart-fab.has-items .cart-count { background: var(--warning); color: var(--primary-color); }

#toasts { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 950; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; width: min(420px, calc(100% - 32px)); }
.toast { background: var(--primary-color); color: var(--white); border-radius: 10px; padding: 0.75rem 1rem; font-size: 0.9rem; opacity: 0; transform: translateY(8px); transition: opacity 0.25s, transform 0.25s; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3); }
.toast.show { opacity: 1; transform: translateY(0); }

/* ---- Responsive ---- */
@media (min-width: 600px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .edition-grid { grid-template-columns: repeat(2, 1fr); }
    .choices-compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (min-width: 1000px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .product-layout { grid-template-columns: minmax(0, 1fr) 340px; }
    .cart-layout { grid-template-columns: minmax(0, 1fr) 320px; }
    .checkout-layout { grid-template-columns: minmax(0, 1fr) 380px; }
    .edition-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 599px) {
    .shop-body { padding: 1.5rem 0 6rem; }
    .page-header-compact { padding: 90px 0 28px; }
    .page-header-compact h1 { font-size: 1.7rem; }
    .card { padding: 1.15rem; }
    .shop-group > summary { padding: 1rem; }
    .group-sub { display: none; }
    .product-grid { padding: 0.25rem 1rem 1.25rem; }
    .sub-title { padding-left: 1rem; }
    .summary { grid-template-columns: 1fr; gap: 0.1rem; }
    .summary dd { margin-bottom: 0.4rem; }
    .step-actions {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 890; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(8px);
        padding: 0.75rem 16px calc(0.75rem + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    }
    .step-actions .btn-primary { flex: 1 1 auto; }
    body[data-route="p-configure"] .cart-fab, body[data-route="checkout"] .cart-fab { display: none; }
    .cart-fab { right: 16px; bottom: 16px; padding: 0.75rem 1rem; }
    .cart-fab-label { display: none; }
    #toasts { top: 72px; bottom: auto; }
    .cart-item-actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
    .toast, .choice, .product-card, .shop-group > summary > svg { transition: none; }
}
