/* Web shop (catalog, item page, cart, checkout, order page, header cart) */

/* Header cart icon */
.nav-cart { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 999px; color: var(--muted); flex: none; }
/* The icon takes header space: tighten the gaps only while it is shown */
.nav-right:has(.nav-cart) { gap: 6px; }
@media (max-width: 560px) {
    .nav-right:has(.nav-cart) { gap: 2px; }
    .nav-right:has(.nav-cart) .lang-switch a { padding: 5px 6px; }
    .nav-right:has(.nav-cart) .account-link { padding: 8px 6px; }
    .nav-cart { width: 30px; }
}
.nav-cart:hover { color: var(--text); background: rgba(15, 23, 42, .05); }
.nav-cart-count { position: absolute; top: 1px; right: -1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.nav-cart-count[hidden] { display: none; }
.nav-cart.bump .nav-cart-count { animation: shopBump .45s ease; }
@keyframes shopBump { 40% { transform: scale(1.35); } }

/* Layout */
.shop-section { padding-top: 60px; }
.shop-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: flex-start; }
.shop-main { min-width: 0; }
@media (max-width: 960px) { .shop-layout { grid-template-columns: 1fr; gap: 20px; } }

/* Filters */
.shop-filters { position: sticky; top: 96px; }
@media (max-width: 960px) { .shop-filters { position: static; } }
.shop-filter-box { padding: 20px; }
.shop-filter-box:hover { transform: none; box-shadow: none; }
.shop-filter-box > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.shop-filter-box > summary::-webkit-details-marker { display: none; }
@media (min-width: 961px) { .shop-filter-box > summary { display: none; } }
.shop-filter-box h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 0 10px; }
.shop-filter-box h4:first-child { margin-top: 0; }
@media (max-width: 960px) { .shop-filter-box[open] .shop-cats h4 { margin-top: 16px; } }
.shop-cats { display: grid; gap: 2px; }
.shop-cats a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-size: 14.5px; font-weight: 500; }
.shop-cats a:hover { background: var(--bg-2); color: var(--text); }
.shop-cats a.active { background: rgba(94, 159, 31, .1); color: var(--brand); font-weight: 700; }
.shop-cats small { color: var(--muted); font-weight: 600; }
.shop-filter-form .check { margin: 6px 0; }
.shop-range { display: flex; align-items: center; gap: 8px; }
.shop-range .input { padding: 10px 12px; min-width: 0; }
.shop-filter-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }

/* Toolbar */
.shop-toolbar { display: flex; gap: 12px; flex-wrap: wrap; }
.shop-search { position: relative; flex: 1 1 260px; min-width: 0; }
.shop-search .ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.shop-search .input { padding-left: 44px; width: 100%; }
.shop-sort { width: auto; flex: 0 1 220px; min-width: 0; }
.shop-count { font-size: 14px; margin: 12px 0 18px; }

/* Grid + cards */
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 1180px) { .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .shop-grid { grid-template-columns: 1fr; } }
.shop-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.shop-card-img { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--bg-2); overflow: hidden; }
.shop-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.shop-card:hover .shop-card-img img { transform: scale(1.04); }
.shop-sale { position: absolute; top: 12px; left: 12px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 999px; }
.shop-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.shop-card-body h3 { font-size: 18px; margin-bottom: 6px; }
.shop-card-body h3 a:hover { color: var(--brand); }
.shop-card-body p { font-size: 14px; margin-bottom: 14px; }
.shop-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.shop-price b { font-size: 19px; }
.shop-price s { margin-left: 6px; font-size: 14px; }
.shop-from { font-size: 13px; }

/* Availability */
.shop-avail { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.shop-avail::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.shop-avail-ok { background: rgba(94, 159, 31, .12); color: var(--brand); }
.shop-avail-warn { background: #fef9c3; color: #854d0e; }
.shop-avail-info { background: #e0f2fe; color: #075985; }

/* Empty state */
.shop-empty { text-align: center; padding: 48px 28px; }
.shop-empty:hover { transform: none; }
.shop-empty .card-icon { margin: 0 auto 16px; }
.shop-empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.shop-pages { margin-top: 36px; }
.shop-pages a.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* Toast */
.shop-toast { position: fixed; left: 50%; bottom: 24px; z-index: 1200; transform: translate(-50%, 140%); display: flex; align-items: center; gap: 16px; max-width: calc(100% - 32px);
    background: var(--text); color: #fff; padding: 14px 18px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 600; font-size: 15px; transition: transform .3s, opacity .3s, visibility .3s; opacity: 0; visibility: hidden; pointer-events: none; }
.shop-toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; pointer-events: auto; }
.shop-toast.error { background: var(--danger); }
.shop-toast a { color: #c5f08f; white-space: nowrap; text-decoration: underline; }

/* Item page */
.shop-item-section { padding-top: 120px; }
.shop-crumbs { margin-bottom: 22px; }
.shop-item { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: flex-start; }
@media (max-width: 900px) { .shop-item { grid-template-columns: 1fr; gap: 26px; } .shop-item-section { padding-top: 100px; } }
.shop-gallery-main { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); aspect-ratio: 4 / 3; }
.shop-gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.shop-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.shop-thumbs a { flex: 0 0 76px; height: 60px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--bg-2); }
.shop-thumbs a.active { border-color: var(--brand); }
.shop-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.shop-title { font-size: clamp(26px, 3.4vw, 38px); margin: 6px 0 10px; }
.shop-summary { color: var(--muted); font-size: 17px; }
.shop-buy-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin: 18px 0 10px; }
.shop-buy-price b { font-size: 32px; letter-spacing: -.02em; }
.shop-buy-price s { font-size: 18px; }
.shop-buy-price small { flex-basis: 100%; font-size: 13px; }
.shop-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 14px; margin-bottom: 18px; }
.shop-meta .ic { vertical-align: -3px; }
.shop-meta [hidden] { display: none; }
.shop-options { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.shop-options legend, .shop-label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.shop-variant-list { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-variant { cursor: pointer; }
.shop-variant input { position: absolute; opacity: 0; pointer-events: none; }
.shop-variant span { display: inline-block; padding: 9px 16px; border: 1px solid var(--line-2); border-radius: 999px; font-weight: 600; font-size: 14px; }
.shop-variant input:checked + span { border-color: var(--brand); background: rgba(94, 159, 31, .08); color: var(--brand); }
.shop-variant input:focus-visible + span { box-shadow: 0 0 0 4px rgba(94, 159, 31, .2); }
.shop-tier .shop-tier-name { flex: 1; }
.shop-tier .shop-tier-price { font-weight: 800; }
.shop-hint { font-size: 13px; margin-top: 6px; }
.shop-buy-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.shop-buy-actions .btn-lg { padding-left: 22px; padding-right: 22px; }
.shop-qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; height: 52px; }
.shop-qty button { width: 42px; height: 100%; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--text); }
.shop-qty button:hover { background: var(--bg-2); }
.shop-qty input { width: 48px; border: 0; text-align: center; font: inherit; font-weight: 700; -moz-appearance: textfield; background: none; color: var(--text); }
.shop-qty input::-webkit-outer-spin-button, .shop-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.shop-qty-sm { height: 40px; }
.shop-qty-sm button { width: 34px; font-size: 17px; }
.shop-qty-sm input { width: 40px; }
.shop-demo-btn { margin-top: 12px; }
.shop-trust { list-style: none; padding: 18px 0 0; margin: 22px 0 0; border-top: 1px solid var(--line); display: grid; gap: 9px; font-size: 14px; color: var(--muted); }
.shop-trust li { display: flex; gap: 10px; align-items: center; }
.shop-trust .ic { color: var(--brand); }
@media (max-width: 480px) {
    .shop-buy-actions .btn-lg { flex: 1 1 100%; }
    .shop-qty { flex: 1 1 100%; justify-content: space-between; }
}

.shop-details { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; margin-top: 56px; align-items: flex-start; }
@media (max-width: 900px) { .shop-details { grid-template-columns: 1fr; margin-top: 36px; } }
.shop-details-main, .shop-details-side { display: grid; gap: 24px; min-width: 0; }
.shop-block:hover { transform: none; box-shadow: none; }
.shop-block h2 { font-size: 21px; margin-bottom: 16px; }
.shop-specs { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.shop-specs th, .shop-specs td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.shop-specs th { color: var(--muted); font-weight: 600; padding-right: 14px; width: 42%; }
.shop-specs tr:last-child th, .shop-specs tr:last-child td { border-bottom: 0; }
.shop-bundle { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.shop-bundle li { display: flex; gap: 14px; align-items: center; }
.shop-bundle img { width: 64px; height: 50px; object-fit: cover; border-radius: 10px; background: var(--bg-2); flex: none; }
.shop-bundle a { color: var(--brand); }
.shop-bundle .muted { font-size: 13.5px; }
.shop-compat { display: grid; gap: 10px; }
.shop-compat a { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; border: 1px solid var(--line); }
.shop-compat a:hover { border-color: var(--brand); }
.shop-compat img, .shop-compat-ph { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; flex: none; display: grid; place-items: center; background: var(--bg-2); color: var(--brand); }
.shop-compat span { display: grid; min-width: 0; }
.shop-compat small { font-size: 12.5px; }
.shop-related { margin-top: 60px; }
.shop-related h2 { font-size: 26px; margin-bottom: 20px; }

/* Live preview */
.shop-demo { width: min(1280px, calc(100% - 24px)); height: min(860px, calc(100% - 24px)); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: #e8edf3; box-shadow: var(--shadow); }
.shop-demo::backdrop { background: rgba(15, 23, 42, .6); }
.shop-demo[open] { display: flex; flex-direction: column; }
.shop-demo-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.shop-demo-bar > b { margin-right: auto; }
.shop-demo-devices { display: flex; gap: 4px; background: var(--bg-2); padding: 3px; border-radius: 999px; }
.shop-demo-devices button { display: inline-flex; gap: 6px; align-items: center; border: 0; background: none; padding: 7px 12px; border-radius: 999px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.shop-demo-devices button.active { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(15, 23, 42, .12); }
.shop-demo-close { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 6px; }
.shop-demo-stage { flex: 1; display: flex; justify-content: center; overflow: auto; padding: 0; }
.shop-demo-stage iframe { width: 100%; height: 100%; border: 0; background: #fff; transition: width .3s, height .3s; }
.shop-demo[data-view="tablet"] .shop-demo-stage { padding: 18px; }
.shop-demo[data-view="tablet"] iframe { width: 768px; max-width: 100%; height: 100%; border-radius: 14px; box-shadow: 0 0 0 10px #1f2937; }
.shop-demo[data-view="phone"] .shop-demo-stage { padding: 18px; }
.shop-demo[data-view="phone"] iframe { width: 390px; max-width: 100%; height: min(100%, 780px); border-radius: 24px; box-shadow: 0 0 0 10px #1f2937; }
@media (max-width: 640px) {
    .shop-demo-bar > b, .shop-demo-devices span, .shop-hide-sm { display: none; }
    .shop-demo-bar { justify-content: space-between; }
}

/* Cart */
.shop-cart-lines { padding: 8px 26px; }
.shop-cart-lines:hover, .shop-summary:hover, .shop-step:hover { transform: none; box-shadow: none; }
.shop-line { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto auto 36px; gap: 18px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.shop-line:last-of-type { border-bottom: 0; }
.shop-line-img img { width: 84px; height: 66px; object-fit: cover; border-radius: 12px; background: var(--bg-2); }
.shop-line-info b { font-size: 16px; }
.shop-line-info a:hover b { color: var(--brand); }
.shop-line-meta { display: flex; flex-direction: column; font-size: 13.5px; margin: 2px 0 6px; }
.shop-line-meta .ic { vertical-align: -2px; }
.shop-line-warn { font-size: 12.5px; color: #854d0e; margin-top: 4px; }
.shop-line-qty { display: grid; justify-items: center; gap: 4px; }
.shop-line-qty small { font-size: 12px; white-space: nowrap; }
.shop-line-total { min-width: 90px; text-align: right; font-size: 16px; white-space: nowrap; }
.shop-line-remove { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; }
.shop-line-remove:hover { color: var(--danger); background: rgba(220, 38, 38, .07); }
@media (max-width: 640px) {
    .shop-cart-lines { padding: 4px 16px !important; }
    .shop-line { grid-template-columns: 64px minmax(0, 1fr) 32px; gap: 10px 12px; align-items: start; }
    .shop-line-img img { width: 64px; height: 52px; }
    .shop-line-info { grid-column: 2; }
    .shop-line-remove { grid-column: 3; grid-row: 1; }
    .shop-line-qty { grid-column: 2; justify-items: start; }
    .shop-line-total { grid-column: 2 / 4; grid-row: 2; justify-self: end; align-self: center; min-width: 0; }
}

/* Checkout */
.shop-steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.shop-step { min-width: 0; }
.shop-step .input { max-width: 100%; min-width: 0; }
.shop-step { padding: 30px; }
.shop-step h3 { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.shop-step-no { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: 15px; flex: none; }
.shop-ship-fields { margin-top: 18px; }
.shop-ship-fields[hidden] { display: none; }
.shop-method .shop-method-name { flex: 1; }
.shop-method .shop-method-cost { font-weight: 800; white-space: nowrap; }
.shop-summary-lines { display: grid; gap: 12px; margin: 16px 0 6px; }
.shop-summary-line { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 14px; }
.shop-summary-line img { width: 48px; height: 40px; object-fit: cover; border-radius: 8px; background: var(--bg-2); }
.shop-summary-line small { display: block; font-size: 12.5px; }
.shop-summary-line > span { font-weight: 700; white-space: nowrap; }
@media (max-width: 560px) { .shop-step { padding: 22px !important; } .shop-step h3 { font-size: 18px; } }

/* Order page (shop orders) */
.shop-order-lines { margin: 8px 0 22px; }
.shop-order-line { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.shop-order-line small { display: block; color: var(--muted); font-size: 13px; }
.shop-order-line > span:last-child { white-space: nowrap; font-weight: 700; }
.shop-dl { display: grid; gap: 12px; margin: 10px 0 24px; }
.shop-dl-item { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.shop-dl-item .muted { font-size: 13px; }
.shop-dl-versions { flex-basis: 100%; font-size: 13.5px; }
.shop-dl-versions summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.shop-dl-versions ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.shop-dl-versions li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.shop-dl-versions a { color: var(--brand); font-weight: 600; }
.shop-track { background: var(--bg-2); border-radius: 14px; padding: 16px 18px; margin: 4px 0 22px; font-size: 15px; }
.shop-track b { display: block; margin-bottom: 4px; }
.shop-track a { color: var(--brand); font-weight: 600; word-break: break-all; }
.shop-address { font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.shop-ful { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #e0f2fe; color: #075985; }
.shop-ful-done, .shop-ful-delivered, .shop-ful-picked_up { background: rgba(94, 159, 31, .12); color: var(--brand); }
.shop-step [data-submit] { white-space: normal; flex-wrap: wrap; text-align: center; line-height: 1.35; height: auto; }
