:root { --shop-primary: #052767; --shop-accent: #f39c12; --shop-border: #e5e7eb; --shop-muted: #6b7280; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", sans-serif; color: #111827; background: #fff; }
a { color: var(--shop-primary); text-decoration: none; }
img { max-width: 100%; display: block; }

.shop-container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.shop-main { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
.shop-loading, .shop-empty, .shop-center { text-align: center; padding: 32px 0; }
.shop-muted { color: var(--shop-muted); font-size: .9em; }
.shop-error { color: #b91c1c; }
.shop-warn { color: #b45309; }
.shop-join { margin: 4px 0 12px; padding: 12px 14px; border: 1px dashed var(--shop-border); border-radius: 10px; background: #f9fafb; }
.shop-join .shop-hint { margin: 4px 0 0; }

/* account page */
.shop-acct-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; border: 1px solid var(--shop-border); border-radius: 12px; margin-bottom: 16px; background: #fff; }
.shop-acct-name { font-weight: 700; font-size: 1.15rem; margin-bottom: 2px; }
.shop-acct-card .shop-btn.light { border: 1px solid var(--shop-border); font-size: .9rem; padding: 8px 18px; }
.shop-acct-card .shop-btn.light:hover { background: #f3f4f6; color: var(--shop-primary); }
.shop-verify { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 10px; margin-bottom: 24px; }
.shop-verify .shop-btn { padding: 8px 18px; font-size: .9rem; white-space: nowrap; }
.shop-verify-ok { color: #15803d; font-weight: 600; }
.shop-orders { display: flex; flex-direction: column; gap: 10px; }
.shop-order { border: 1px solid var(--shop-border); border-radius: 10px; overflow: hidden; background: #fff; }
.shop-order.open { border-color: var(--shop-primary); }
.shop-order-head { width: 100%; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 24px; align-items: center; gap: 8px; padding: 14px 16px; background: #fff; border: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.shop-order-head:hover { background: #f9fafb; }
.shop-order-no { font-weight: 700; }
.shop-order-total { font-weight: 600; text-align: right; }
.shop-order-chev { color: var(--shop-muted); text-align: right; }
.shop-status { justify-self: start; font-size: .8rem; padding: 2px 10px; border-radius: 99px; background: #f3f4f6; color: #374151; }
.shop-status.s-A { background: #fef3c7; color: #92400e; }
.shop-status.s-P { background: #dbeafe; color: #1e40af; }
.shop-status.s-S { background: #e0e7ff; color: #3730a3; }
.shop-status.s-C { background: #dcfce7; color: #166534; }
.shop-status.s-X { background: #fee2e2; color: #991b1b; }
.shop-order-body { padding: 4px 16px 16px; border-top: 1px solid var(--shop-border); background: #fcfcfd; }
.shop-order-body .r { text-align: right; }
.shop-order-body .small { font-size: .78rem; }
.shop-order-sum td { font-weight: 700; border-bottom: 0; }
.shop-order-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; font-size: .92rem; }
@media (max-width: 640px) { .shop-order-head { grid-template-columns: 1fr auto; } .shop-order-head > .shop-muted, .shop-order-chev { display: none; } .shop-acct-card { flex-direction: column; align-items: flex-start; } }
.shop-ok { color: #047857; }
.shop-h1 { font-size: 1.6rem; margin: 0 0 16px; }

.shop-topbar { background: var(--shop-primary); color: #fff; text-align: center; padding: 6px; font-size: .9rem; }
.shop-header { border-bottom: 1px solid var(--shop-border); position: sticky; top: 0; background: #fff; z-index: 10; }
.shop-header-row { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.shop-brand img { max-height: 44px; width: auto; }
.shop-brand span { font-weight: 700; font-size: 1.3rem; }
.shop-search { flex: 1; }
.shop-search input { width: 100%; padding: 8px 12px; border: 1px solid var(--shop-border); border-radius: 20px; }
.shop-actions { display: flex; gap: 14px; align-items: center; }
.shop-cats { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 10px; white-space: nowrap; }
.shop-cats a { color: #374151; }
.shop-cart { position: relative; font-weight: 600; }
.shop-badge { background: var(--shop-accent); color: #fff; border-radius: 10px; padding: 0 6px; font-size: .75rem; margin-left: 4px; }

.shop-btn { display: inline-block; background: var(--shop-primary); color: #fff; border: 0; border-radius: 6px; padding: 10px 22px; font-size: 1rem; cursor: pointer; }
.shop-btn:disabled, .shop-btn.disabled { opacity: .5; pointer-events: none; }
.shop-link { background: none; border: 0; color: var(--shop-primary); cursor: pointer; padding: 0; font-size: inherit; }

.shop-banners { display: grid; gap: 12px; margin-bottom: 24px; }
.shop-banner { position: relative; display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 3 / 1; background: #f3f4f6; }
.shop-banner img { width: 100%; height: 100%; object-fit: cover; }
.shop-banner-text { position: absolute; left: 24px; bottom: 20px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.shop-banner-text h2 { margin: 0; }
.shop-highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 28px; }
.shop-highlight { border: 1px solid var(--shop-border); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }

.shop-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.shop-card { color: inherit; display: flex; flex-direction: column; gap: 6px; }
.shop-card-img { position: relative; aspect-ratio: 1; background: #f3f4f6; border-radius: 8px; overflow: hidden; }
.shop-card-img img { width: 100%; height: 100%; object-fit: cover; }
.shop-card-name { font-size: .95rem; line-height: 1.3; }
.shop-card-price, .shop-price { font-weight: 700; }
.shop-card-price s, .shop-price s { color: var(--shop-muted); font-weight: 400; margin-left: 6px; }
.shop-tag { position: absolute; top: 8px; left: 8px; background: var(--shop-accent); color: #fff; font-size: .75rem; padding: 2px 8px; border-radius: 4px; }
.shop-tag-out { background: #6b7280; }
.shop-pager { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.shop-pager a { border: 1px solid var(--shop-border); padding: 4px 10px; border-radius: 4px; }
.shop-pager a.active { background: var(--shop-primary); color: #fff; }

.shop-product { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.shop-gallery-main { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: #f3f4f6; }
.shop-thumbs { display: flex; gap: 8px; margin-top: 8px; }
.shop-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; cursor: pointer; opacity: .6; }
.shop-thumbs img.active { opacity: 1; outline: 2px solid var(--shop-primary); }
.shop-price { font-size: 1.4rem; margin: 12px 0; }
.shop-buy { display: flex; gap: 12px; align-items: center; margin: 16px 0; }
.shop-qty { display: inline-flex; align-items: center; border: 1px solid var(--shop-border); border-radius: 6px; }
.shop-qty button { background: none; border: 0; width: 34px; height: 34px; font-size: 1.1rem; cursor: pointer; }
.shop-qty span { min-width: 32px; text-align: center; }
.shop-desc, .shop-page-text { white-space: pre-wrap; line-height: 1.6; }

.shop-cart-line { display: grid; grid-template-columns: 64px 1fr auto 100px auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--shop-border); }
.shop-cart-line img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: #f3f4f6; }
.shop-cart-amt { text-align: right; font-weight: 600; }
.shop-summary { border: 1px solid var(--shop-border); border-radius: 10px; padding: 16px; margin-top: 20px; display: flex; flex-direction: column; gap: 8px; align-self: start; }
.shop-summary > div { display: flex; justify-content: space-between; gap: 12px; }
.shop-total { font-size: 1.15rem; }

.shop-checkout { display: grid; grid-template-columns: 3fr 2fr; gap: 28px; }
.shop-form { display: flex; flex-direction: column; gap: 10px; }
.shop-form h2 { font-size: 1.1rem; margin: 14px 0 0; }
.shop-form label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.shop-form input:not([type=radio]):not([type=checkbox]), .shop-form textarea, .shop-form select { padding: 9px 10px; border: 1px solid var(--shop-border); border-radius: 6px; font-size: 1rem; }
.shop-form label.shop-radio, .shop-form label.shop-check { flex-direction: row; align-items: center; gap: 8px; }
.shop-auth { max-width: 420px; margin: 0 auto; }

.shop-table { width: 100%; border-collapse: collapse; }
.shop-table th, .shop-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--shop-border); }

.shop-footer { background: #f9fafb; border-top: 1px solid var(--shop-border); padding: 28px 0; font-size: .9rem; }
.shop-footer-row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.shop-footer-links { display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 760px) {
    .shop-header-row { flex-wrap: wrap; }
    .shop-search { order: 3; flex-basis: 100%; }
    .shop-product, .shop-checkout { grid-template-columns: 1fr; }
    .shop-cart-line { grid-template-columns: 56px 1fr auto; }
    .shop-cart-amt { grid-column: 2; text-align: left; }
}

#blazor-error-ui { background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* FocusOnNavigate (Routes.razor) focuses the page h1 after each navigation for screen readers.
   Headings are not interactive, so hide the focus ring there; keyboard focus on links/inputs is unaffected. */
h1:focus, h1:focus-visible, [tabindex="-1"]:focus { outline: none; }

/* ---- Home page ---- */
.shop-hero { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin-bottom: 20px; border-radius: 14px; scrollbar-width: none; }
.shop-hero::-webkit-scrollbar { display: none; }
.shop-hero.multi { grid-auto-columns: 92%; }
.shop-hero-slide { position: relative; display: block; aspect-ratio: 3 / 1; min-height: 200px; border-radius: 14px; overflow: hidden; scroll-snap-align: start; background: linear-gradient(135deg, var(--shop-primary) 0%, #1d4fb8 60%, #3b82f6 100%); }
.shop-hero-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shop-hero-slide:has(img)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.15) 55%, rgba(0,0,0,0) 100%); }
.shop-hero-text { position: absolute; left: 0; top: 0; bottom: 0; z-index: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 0 clamp(20px, 5vw, 56px); max-width: 640px; color: #fff; }
.shop-hero-text h2 { margin: 0; font-size: clamp(1.5rem, 3.6vw, 2.6rem); line-height: 1.15; font-weight: 800; }
.shop-hero-text p { margin: 0; font-size: clamp(.95rem, 1.6vw, 1.15rem); opacity: .92; }
.shop-hero-cta { align-self: flex-start; margin-top: 8px; background: #fff; color: var(--shop-primary); font-weight: 700; padding: 9px 20px; border-radius: 99px; font-size: .95rem; }
.shop-hero-slide:hover .shop-hero-cta { background: var(--shop-accent); color: #fff; }

.shop-usps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 36px; }
.shop-usp { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: #f6f8fc; border: 1px solid #e8edf6; }
.shop-usp .ic { width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: #fff; font-size: 1.25rem; box-shadow: 0 1px 3px rgba(5,39,103,.12); }
.shop-usp strong { display: block; color: var(--shop-primary); }
.shop-usp span { color: var(--shop-muted); font-size: .9rem; }

.shop-section { margin-bottom: 40px; }
.shop-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.shop-section-head h1, .shop-section-head h2 { margin: 0; font-size: 1.45rem; font-weight: 800; }
.shop-section-head a { font-weight: 600; font-size: .95rem; white-space: nowrap; }

.shop-catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.shop-cattile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; border-radius: 12px; border: 1px solid var(--shop-border); color: #111827; font-weight: 600; transition: transform .15s, box-shadow .15s, border-color .15s; }
.shop-cattile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(5,39,103,.1); border-color: transparent; }
.shop-cattile .ini { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; font-size: 1.35rem; font-weight: 800; }
.shop-cattile.c0 .ini { background: #e0e9ff; color: #1d4fb8; }
.shop-cattile.c1 .ini { background: #fde7d3; color: #c2410c; }
.shop-cattile.c2 .ini { background: #dcfce7; color: #15803d; }
.shop-cattile.c3 .ini { background: #fce7f3; color: #be185d; }
.shop-cattile.c4 .ini { background: #ede9fe; color: #6d28d9; }
.shop-cattile.c5 .ini { background: #fef9c3; color: #a16207; }
.shop-cattile .nm { text-align: center; font-size: .95rem; }

.shop-grid .shop-card img, .shop-grid a img { transition: transform .25s; }
.shop-grid a:hover img { transform: scale(1.03); }

.shop-cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 28px clamp(20px, 4vw, 40px); border-radius: 14px; background: linear-gradient(135deg, var(--shop-primary), #1d4fb8); color: #fff; }
.shop-cta h2 { margin: 0 0 4px; font-size: 1.35rem; }
.shop-cta p { margin: 0; opacity: .85; }
.shop-btn.light { background: #fff; color: var(--shop-primary); font-weight: 700; border-radius: 99px; }
.shop-btn.light:hover { background: var(--shop-accent); color: #fff; }

@media (max-width: 600px) {
    .shop-hero-slide { aspect-ratio: 16 / 9; }
    .shop-catgrid { grid-template-columns: repeat(3, 1fr); }
    .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}


/* ---- Header icons ---- */
.shop-icon { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--shop-primary); transition: background .15s; }
.shop-icon:hover { background: #eef2fb; }
.shop-icon .shop-badge { position: absolute; top: 0; right: -2px; margin: 0; min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 5px; font-size: .7rem; font-weight: 700; }
.shop-dot { position: absolute; bottom: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: #16a34a; border: 2px solid #fff; }
.shop-actions { gap: 6px; }

/* Keep the header action group from being squeezed by the flexible search box. */
.shop-actions { flex-shrink: 0; gap: 4px; margin-left: 8px; }
.shop-actions > * { flex-shrink: 0; }
.shop-actions > button.shop-link { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 99px; font-weight: 600; font-size: .9rem; display: inline-grid; place-items: center; }
.shop-actions > button.shop-link:hover { background: #eef2fb; }

/* ---- Checkout required fields ---- */
.shop-req { color: #dc2626; font-weight: 700; }
.shop-req-note { margin: 0 0 4px; font-size: .85rem; }
.shop-check-todo { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 6px; padding: 6px 8px; }
.shop-todo { margin-top: 10px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 8px; padding: 10px 12px; font-size: .9rem; }
.shop-todo ul { margin: 6px 0 0; padding-left: 18px; }
.shop-todo li { margin: 2px 0; }

/* ---- Checkout layout polish ---- */
.shop-form label .shop-req { display: inline; margin-left: 2px; }
.shop-consent { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 6px; padding-top: 10px; border-top: 1px solid var(--shop-border); }
.shop-consent .shop-check { display: flex; align-items: flex-start; gap: 8px; font-size: .92rem; cursor: pointer; padding: 6px 8px; border: 1px solid transparent; border-radius: 6px; }
.shop-consent .shop-check input { margin-top: 3px; flex-shrink: 0; }
.shop-consent a { text-decoration: underline; }
.shop-place { width: 100%; padding: 12px; font-weight: 700; font-size: 1.05rem; }
.shop-place:disabled { opacity: .55; cursor: not-allowed; }
.shop-todo { display: block; }
.shop-todo strong { display: block; }
.shop-summary { position: sticky; top: 90px; }

.shop-hint { margin: -4px 0 4px; font-size: .82rem; }

/* account: address book */
.shop-addr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; margin-bottom: .75rem; }
.shop-addr { border: 1px solid #e3e6ea; border-radius: .6rem; padding: .8rem 1rem; background: #fff; line-height: 1.5; text-align: left; }
.shop-addr.def { border-color: #052767; box-shadow: inset 3px 0 0 #052767; }
.shop-addr-top { display: flex; align-items: center; gap: .5rem; margin-bottom: .2rem; }
.shop-addr-badge { font-size: .72rem; font-weight: 600; padding: .05rem .5rem; border-radius: 999px; background: #e8edf7; color: #052767; }
.shop-addr-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .5rem; align-items: center; }
.shop-addr-add { border-style: dashed; color: #052767; font-weight: 600; cursor: pointer; min-height: 110px; display: flex; align-items: center; justify-content: center; }
.shop-addr-add:hover { background: #f5f7fb; }
.shop-addr-form { max-width: 560px; margin-bottom: 1.5rem; }
.shop-link { background: none; border: 0; padding: 0; color: #052767; font-size: .9rem; text-decoration: underline; cursor: pointer; }
.shop-link.danger { color: #b91c1c; }
.shop-link:disabled { opacity: .5; cursor: default; }

.shop-form select { background: #fff; color: inherit; font-family: inherit; cursor: pointer; }
