/* Produkta lapa (product.php) — mobile first, bez ārējiem CSS ietvariem */
:root { --bg: #f8fafc; --text: #09090b; --card: #fff; --border: rgba(9, 9, 11, .1); --soft: rgba(9, 9, 11, .05); --blue: #2563eb; --blue-d: #1d4ed8; --muted: rgba(9, 9, 11, .62); }
@media (prefers-color-scheme: dark) { :root { --bg: #050506; --text: #fafafa; --card: #0d0d10; --border: rgba(255, 255, 255, .1); --soft: rgba(255, 255, 255, .06); --muted: rgba(250, 250, 250, .62); } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
.pp-body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; line-height: 1.5; padding-bottom: 84px; }
a { color: inherit; }
img { max-width: 100%; }
.pp-nav { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); }
.pp-nav-in { display: flex; align-items: center; gap: 16px; max-width: 1200px; margin: 0 auto; padding: 10px 16px; }
.pp-logo { margin-right: auto; font-size: 19px; font-weight: 800; letter-spacing: -.03em; text-decoration: none; }
.pp-logo span { color: var(--blue); }
.pp-nav-links { display: none; gap: 4px; }
.pp-nav-links a { padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; text-decoration: none; opacity: .7; }
.pp-nav-links a:hover { opacity: 1; background: var(--soft); }
.pp-cart-link { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: 99px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 800; text-decoration: none; }
.pp-cart-link svg { width: 18px; height: 18px; }
.pp-cart-link b { min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 99px; background: rgba(255, 255, 255, .22); font-size: 12px; }
.pp-cart-link.has-items b { background: #fff; color: var(--blue); }
.pp-crumbs { max-width: 1200px; margin: 0 auto; padding: 12px 16px 0; overflow-x: auto; scrollbar-width: none; }
.pp-crumbs::-webkit-scrollbar { display: none; }
.pp-crumbs ol { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; white-space: nowrap; font-size: 12px; color: var(--muted); }
.pp-crumbs li + li::before { content: '/'; margin-right: 8px; opacity: .5; }
.pp-crumbs a { text-decoration: none; }
.pp-crumbs li[aria-current] { opacity: .8; }

.pp { display: grid; gap: 20px; max-width: 1200px; margin: 0 auto; padding: 14px 16px 8px; }
.pp-gallery { min-width: 0; }
.pp-stage { position: relative; overflow: hidden; border-radius: 20px; background: var(--card); border: 1px solid var(--border); aspect-ratio: 1 / 1; touch-action: pan-y; }
.pp-stage img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pp-badge { position: absolute; top: 12px; left: 12px; padding: 6px 12px; border-radius: 99px; background: #e11d48; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pp-arrow { position: absolute; top: 50%; width: 40px; height: 40px; margin-top: -20px; display: none; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .9); color: #09090b; font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.pp-prev { left: 10px; } .pp-next { right: 10px; }
.pp-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; }
.pp-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 1px rgba(0, 0, 0, .2); }
.pp-dots i.on { background: #fff; width: 18px; border-radius: 4px; }
.pp-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.pp-thumbs::-webkit-scrollbar { display: none; }
.pp-thumbs button { flex: 0 0 auto; width: 64px; height: 64px; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 12px; background: var(--card); cursor: pointer; opacity: .65; }
.pp-thumbs button.on { border-color: var(--blue); opacity: 1; }
.pp-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pp-info { min-width: 0; }
.pp-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.pp-chip { padding: 4px 10px; border-radius: 99px; background: rgba(37, 99, 235, .12); color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pp-stock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.pp-stock::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pp-stock.in { color: #16a34a; } .pp-stock.pre { color: #d97706; } .pp-stock.out { color: #dc2626; }
.pp-title { margin: 0 0 8px; font-size: 26px; line-height: 1.12; font-weight: 800; letter-spacing: -.03em; text-wrap: balance; overflow-wrap: anywhere; }
.pp-rating { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13px; text-decoration: none; color: var(--muted); }
.pp-rating b { color: var(--text); }
.pp-stars { position: relative; display: inline-block; font-size: 15px; letter-spacing: 2px; color: rgba(127, 127, 127, .35); background: linear-gradient(90deg, #f59e0b calc(var(--r) / 5 * 100%), transparent 0) text; -webkit-background-clip: text; background-clip: text; }
.pp-stars { background: linear-gradient(90deg, #f59e0b calc(var(--r) / 5 * 100%), rgba(127, 127, 127, .35) 0); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.pp-price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 4px; }
.pp-price { font-size: 34px; font-weight: 800; letter-spacing: -.03em; color: var(--blue); line-height: 1.1; }
.pp-old { font-size: 18px; font-weight: 700; color: var(--muted); }
.pp-tiers { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 4px; font-size: 13px; color: var(--muted); }
.pp-tiers b { padding: 4px 10px; border-radius: 8px; background: rgba(37, 99, 235, .1); color: var(--blue); font-size: 12px; }

.pp-block { margin-top: 18px; }
.pp-label { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 800; }
.pp-label span { font-weight: 600; color: var(--muted); }
.pp-h2 { margin: 0 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pp-variants { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; scroll-snap-type: x proximity; }
.pp-variants::-webkit-scrollbar { display: none; }
.variant-choice { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; max-width: 240px; padding: 8px 14px 8px 8px; border: 2px solid var(--border); border-radius: 16px; background: var(--card); color: inherit; font: inherit; text-align: left; cursor: pointer; scroll-snap-align: start; }
.variant-choice.active { border-color: var(--blue); background: rgba(37, 99, 235, .08); }
.variant-choice img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
.variant-choice strong { display: block; font-size: 13px; font-weight: 800; line-height: 1.2; }
.variant-choice small { display: block; font-size: 12px; color: var(--muted); }
.pp-input { width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: inherit; font: inherit; font-size: 16px; outline: none; }
.pp-input:focus { border-color: var(--blue); }
.pp-input.bad { border-color: #ef4444; }

.pp-buy { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 10px; margin-top: 20px; }
.pp-qty { display: flex; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.pp-qty button { width: 40px; border: 0; background: transparent; color: inherit; font-size: 22px; font-weight: 700; cursor: pointer; }
.pp-qty input { width: 100%; min-width: 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: 17px; font-weight: 800; text-align: center; -moz-appearance: textfield; outline: none; }
.pp-qty input::-webkit-outer-spin-button, .pp-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pp-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 22px; border: 0; border-radius: 14px; background: var(--blue); color: #fff; font: inherit; font-size: 16px; font-weight: 800; text-decoration: none; cursor: pointer; box-shadow: 0 10px 22px rgba(37, 99, 235, .28); transition: background .15s, transform .1s; }
.pp-btn:hover:not(:disabled) { background: var(--blue-d); }
.pp-btn:active:not(:disabled) { transform: scale(.98); }
.pp-btn:disabled { background: #a1a1aa; box-shadow: none; cursor: not-allowed; }
.pp-btn.ok { background: #16a34a; }

.pp-trust { display: grid; gap: 8px; margin: 18px 0 0; padding: 14px; list-style: none; border-radius: 16px; background: var(--soft); font-size: 13px; font-weight: 600; }
.pp-trust li { display: flex; align-items: flex-start; gap: 10px; }
.pp-trust svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; color: #16a34a; }
.pp-desc { margin: 0; font-size: 16px; line-height: 1.7; color: var(--muted); color: color-mix(in srgb, var(--text) 82%, transparent); overflow-wrap: anywhere; }
.pp-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.pp-specs > div { padding: 10px 12px; border-radius: 12px; background: var(--soft); }
.pp-specs dt { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pp-specs dd { margin: 2px 0 0; font-size: 15px; font-weight: 800; }
.pp-reviews { display: grid; gap: 10px; }
.pp-review { padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.pp-review header { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.pp-review p { margin: 0; font-size: 14px; color: var(--muted); }

.pp-more { max-width: 1200px; margin: 0 auto; padding: 26px 0 0; }
.pp-more h2 { margin: 0 16px 12px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.pp-rail { display: flex; gap: 12px; overflow-x: auto; padding: 2px 16px 10px; scroll-snap-type: x proximity; scrollbar-width: none; }
.pp-rail::-webkit-scrollbar { display: none; }
.pp-card { flex: 0 0 156px; scroll-snap-align: start; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--card); text-decoration: none; transition: transform .2s, box-shadow .2s; }
.pp-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(0, 0, 0, .12); }
.pp-card-img { aspect-ratio: 1 / 1; overflow: hidden; background: var(--soft); }
.pp-card-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pp-card-body { padding: 10px 12px 12px; }
.pp-card-body h3 { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; font-weight: 700; line-height: 1.3; min-height: 2.6em; }
.pp-card-body p { margin: 6px 0 0; font-size: 15px; font-weight: 800; color: var(--blue); }
.pp-all { display: inline-block; margin: 6px 16px 0; font-size: 14px; font-weight: 700; color: var(--blue); text-decoration: none; }

.pp-sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; align-items: center; gap: 14px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(14px); box-shadow: 0 -10px 24px rgba(0, 0, 0, .08); }
.pp-sticky-price { display: grid; line-height: 1.15; }
.pp-sticky-price small { font-size: 11px; color: var(--muted); }
.pp-sticky-price strong { font-size: 20px; font-weight: 800; }
.pp-sticky .pp-btn { flex: 1; min-height: 50px; }
.pp-toast { position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 460px; margin: 0 auto; padding: 14px 16px; border-radius: 14px; background: #09090b; color: #fff; font-size: 14px; font-weight: 700; box-shadow: 0 14px 34px rgba(0, 0, 0, .35); animation: pp-up .25s ease; }
.pp-toast[hidden] { display: none; }
.pp-toast a { color: #93c5fd; text-decoration: none; font-weight: 800; }
@keyframes pp-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.pp-missing { max-width: 560px; margin: 0 auto; padding: 80px 16px; text-align: center; }
.pp-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; max-width: 1200px; margin: 30px auto 0; padding: 22px 16px 28px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.pp-foot a { text-decoration: none; }
.pp-foot p { width: 100%; margin: 6px 0 0; text-align: center; }

@media (min-width: 768px) {
    .pp-body { padding-bottom: 0; }
    .pp-nav-links { display: flex; }
    .pp-nav-in { padding: 12px 28px; }
    .pp-crumbs { padding: 16px 28px 0; }
    .pp { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; padding: 20px 28px 8px; align-items: start; }
    .pp-gallery { position: sticky; top: 84px; }
    .pp-stage { border-radius: 26px; }
    .pp-arrow { display: block; }
    .pp-title { font-size: 36px; }
    .pp-sticky { display: none; }
    .pp-toast { bottom: 24px; left: auto; right: 24px; margin: 0; }
    .pp-more h2 { margin-left: 28px; font-size: 24px; }
    .pp-rail { padding: 2px 28px 12px; }
    .pp-card { flex-basis: 210px; }
    .pp-all { margin-left: 28px; }
}
@media (min-width: 1200px) {
    .pp-rail { flex-wrap: wrap; overflow: visible; }
    .pp-card { flex: 0 0 calc(25% - 9px); }
}
@media (max-width: 420px) {
    .pp-cart-text { display: none; }
    .pp-buy { grid-template-columns: 112px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .pp-toast { animation: none; } .pp-card { transition: none; } }

.pp-share { position: relative; margin-left: auto; }
.pp-share[hidden] { display: none; }
.pp-share-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid rgba(127, 127, 127, .3); border-radius: 99px; background: transparent; color: inherit; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: border-color .15s, color .15s; }
.pp-share-btn:hover { border-color: #2563eb; color: #2563eb; }
.pp-share-btn svg { width: 16px; height: 16px; }
.share-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: grid; min-width: 190px; padding: 6px; border: 1px solid rgba(127, 127, 127, .25); border-radius: 14px; background: var(--card, var(--bg, #fff)); color: inherit; box-shadow: 0 14px 34px rgba(0, 0, 0, .22); }
.share-pop[hidden] { display: none; }
.share-pop button, .share-pop a { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; font-size: 14px; font-weight: 700; text-align: left; text-decoration: none; cursor: pointer; }
.share-pop button:hover, .share-pop a:hover { background: rgba(37, 99, 235, .1); color: #2563eb; }

/* Dalīties: kompakta ikona labajā augšējā stūrī */
.pp-info { position: relative; }
.pp-share { position: absolute; top: 0; right: 0; margin: 0; }
.pp-kicker { padding-right: 52px; min-height: 40px; }
.pp-share-btn { width: 40px; height: 40px; min-height: 0; padding: 0; justify-content: center; border-radius: 50%; }
.pp-share-btn span { display: none; }
.pp-share-btn svg { width: 18px; height: 18px; }
@media (min-width: 768px) {
    .pp-share-btn { width: auto; height: 40px; padding: 0 14px; border-radius: 99px; }
    .pp-share-btn span { display: inline; }
    .pp-kicker { padding-right: 140px; }
}
@media (max-width: 767px) {
    .share-pop { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); top: auto; z-index: 80; padding: 8px; border-radius: 18px; box-shadow: 0 -8px 40px rgba(0, 0, 0, .35); }
    .share-pop button, .share-pop a { padding: 15px 14px; font-size: 16px; }
}

.pp-expand { position: absolute; right: 12px; bottom: 12px; z-index: 5; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #09090b; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); cursor: pointer; transition: transform .15s; }
.pp-expand:hover { transform: scale(1.08); }
.pp-expand svg { width: 20px; height: 20px; }
..pp-stage img { cursor: zoom-in; }
.pp-dots { padding-right: 0; }

/* Pele bez ritināšanas žesta: variantu, sīktēlu un saistīto preču saraksti pārlūzt rindās */
@media (hover: hover) and (pointer: fine) {
    .pp-variants { flex-wrap: wrap; overflow: visible; margin: 0; padding: 2px 0 6px; }
    .pp-thumbs { flex-wrap: wrap; overflow: visible; }
    .pp-rail { flex-wrap: wrap; overflow: visible; }
    .pp-card { flex: 0 0 calc(25% - 9px); }
}
@media (hover: hover) and (pointer: fine) and (max-width: 900px) { .pp-card { flex-basis: calc(33.333% - 8px); } }

.pp-pct { padding: 3px 10px; border-radius: 99px; background: #e11d48; color: #fff; font-size: 13px; font-weight: 800; }
.pp-tiers b s { opacity: .55; font-weight: 600; margin-right: 2px; }

/* Variantu izvēle: krāsa → izmērs (stili arī store-ux.css) */
.vp { display: grid; gap: 14px; }
.vp-step { display: grid; gap: 8px; }
.vp-step[hidden] { display: none; }
.vp-label { margin: 0; font-size: 13px; font-weight: 800; }
.vp-label span { margin-left: 4px; font-weight: 600; opacity: .6; }
.vp-colors, .vp-sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.vp-chip { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border: 2px solid var(--line, rgba(127, 127, 127, .25)); border-radius: 16px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.vp-chip:hover { border-color: rgba(37, 99, 235, .55); }
.vp-chip.is-selected { border-color: var(--blue, #2563eb); background: rgba(37, 99, 235, .08); }
.vp-chip:focus-visible { outline: 2px solid var(--blue, #2563eb); outline-offset: 2px; }
.vp-chip strong { display: block; font-size: 14px; font-weight: 800; line-height: 1.2; }
.vp-chip small { display: block; margin-top: 1px; font-size: 12px; color: var(--muted, inherit); opacity: .8; }
.vp-color { padding: 6px 14px 6px 6px; }
.vp-color img { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 11px; object-fit: cover; }
.vp-size { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; min-width: 96px; }
@media (max-width: 640px) { .vp-chip { min-height: 52px; } .vp-size { flex: 1 1 calc(50% - 8px); } }

.vp-note { margin: 0; font-size: 13px; font-weight: 600; opacity: .7; }
.vp-note[hidden] { display: none; }
