/* Moj kutak — base layout. Colours, shapes and type come from theme variables in themes.css. */
:root {
  --radius: 12px;
  --btn-radius: 8px;
  --gap: 1rem;
  --max-width: 1180px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --heading-font: var(--font);
  --heading-weight: 700;
  --heading-transform: none;
  --heading-spacing: normal;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5f6670;
  --border: #e3e3df;
  --primary: #2f5d50;
  --primary-text: #ffffff;
  --accent: #c8862a;
  --accent-text: #ffffff;
  --price: var(--text);
  --header-bg: var(--surface);
  --header-text: var(--text);
  --hero-bg: transparent;
  --hero-text: var(--text);
  --shadow: 0 1px 2px rgb(0 0 0 / .05);
  --shadow-hover: 0 10px 24px rgb(0 0 0 / .10);
  --card-border: 1px solid var(--border);
  --danger: #b42318;
  --success: #1a7f37;
  --warning: #a15c07;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; font-family: var(--heading-font); font-weight: var(--heading-weight); letter-spacing: var(--heading-spacing); }
h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h2 { font-size: 1.3rem; margin-top: 1.5em; }
.section-title { text-transform: var(--heading-transform); }

.container { width: min(100% - 2rem, var(--max-width)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: .5rem; background: var(--primary); color: var(--primary-text); padding: .5rem 1rem; border-radius: 8px; z-index: 30; }
.skip-link:focus { left: .5rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.inline { display: inline; }
.num { text-align: right; white-space: nowrap; }
.empty { padding: 2rem; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); border: var(--card-border); }
@media (max-width: 560px) { .hide-sm { display: none !important; } }

/* Header */
.site-header { background: var(--header-bg); color: var(--header-text); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .7rem 0; }
.brand { font-family: var(--heading-font); font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--header-text); margin-right: auto; letter-spacing: var(--heading-spacing); }
.brand-mark { color: var(--accent); }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.site-header .btn-ghost { color: var(--header-text); }
.btn-cart { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn-cart .badge { background: var(--surface); color: var(--text); }

.search { position: relative; display: flex; gap: .5rem; flex: 1 1 320px; order: 3; }
.search input { flex: 1; min-width: 0; }
@media (min-width: 900px) { .search-header { order: 0; max-width: 460px; } }
.search-hero { max-width: 680px; margin: 1.25rem auto 0; order: 0; }
.search-hero input { font-size: 1.1rem; padding: .85rem 1.1rem; border-radius: var(--btn-radius); box-shadow: var(--shadow); }
.search-hero .btn { padding-inline: 1.4rem; }
.search-suggestions { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgb(0 0 0 / .16); padding: .5rem; max-height: 70vh; overflow: auto; z-index: 20; text-align: left; }
.search-suggestions h4 { margin: .4rem .4rem .2rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.search-suggestions a { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; border-radius: 8px; color: var(--text); text-decoration: none; }
.search-suggestions a:hover, .search-suggestions a:focus, .search-suggestions a[aria-selected="true"] { background: var(--bg); outline: none; }
.search-suggestions img, .search-suggestions .thumb-ph { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex: 0 0 40px; background: var(--bg); }
.search-suggestions .all-results { justify-content: center; font-weight: 600; color: var(--primary); border-top: 1px solid var(--border); margin-top: .3rem; border-radius: 0; }

.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface); }
.lang { border: 0; background: transparent; padding: .35rem .6rem; font: inherit; font-size: .8rem; cursor: pointer; color: var(--muted); min-height: 2rem; }
.lang.is-active { background: var(--primary); color: var(--primary-text); }

/* Controls */
input, select, textarea { font: inherit; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); width: 100%; min-height: 2.6rem; }
textarea { min-height: 6rem; resize: vertical; }
input[type="number"] { width: 5.5rem; }
input[type="radio"], input[type="checkbox"] { width: 1.15rem; height: 1.15rem; min-height: 0; accent-color: var(--primary); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 1px; }
[aria-invalid="true"] { border-color: var(--danger); }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field > label { font-weight: 600; font-size: .9rem; }
.field-error { color: var(--danger); font-size: .85rem; margin: .2rem 0 0; }
.hint { color: var(--muted); font-size: .85rem; margin: .2rem 0 0; }
.form-grid { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: 1 / -1; } }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .55rem 1rem; border-radius: var(--btn-radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; text-decoration: none; cursor: pointer; white-space: nowrap; min-height: 2.6rem; transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease; }
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); font-weight: 600; }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-block { width: 100%; }
.btn-large { padding: .8rem 1.3rem; font-size: 1.05rem; }
.btn-small { padding: .3rem .6rem; font-size: .85rem; min-height: 2rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn.is-added { background: var(--success); border-color: var(--success); color: #fff; }
.badge { display: inline-block; min-width: 1.4rem; padding: 0 .35rem; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: .75rem; text-align: center; font-weight: 700; }
.badge.bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.35); } }
@media (prefers-reduced-motion: reduce) { .badge.bump { animation: none; } .btn, .card { transition: none; } }
.pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; background: var(--primary); color: var(--primary-text); font-size: .8rem; text-decoration: none; font-weight: 600; }
.pill-muted { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.add-feedback { font-size: .8rem; color: var(--success); min-height: 1em; }
.add-feedback.is-error { color: var(--danger); }

.alert { padding: .8rem 1rem; border-radius: var(--radius); margin: 1rem 0; border: 1px solid var(--border); background: var(--surface); }
.alert-error { border-color: var(--danger); color: var(--danger); }
.alert-success { border-color: var(--success); color: var(--success); }
.alert-info { border-color: var(--primary); }
.hint-box { padding: .75rem 1rem; border-radius: var(--radius); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--primary) 40%, var(--border)); }

/* Content */
main { padding: 1.5rem 0 3rem; min-height: 60vh; }
.hero { padding: 1.5rem 0 .5rem; }
.hero-home { text-align: center; padding: 2.5rem 1rem 2rem; margin-bottom: 1rem; border-radius: var(--radius); background: var(--hero-bg); color: var(--hero-text); }
.hero-home .muted { color: inherit; opacity: .85; }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.grid-3x3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .grid-3x3 { gap: .5rem; } .grid-3x3 .card-body { padding: .5rem; } .grid-3x3 .card-title { font-size: .85rem; } .grid-3x3 .card-shop { display: none; } .grid-3x3 .btn-block { font-size: .8rem; padding: .4rem; min-height: 2.2rem; white-space: normal; } }

.card { background: var(--surface); border: var(--card-border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: box-shadow .15s ease, transform .15s ease; }
.card:hover { box-shadow: var(--shadow-hover); }
.card-media { aspect-ratio: 1 / 1; background: var(--bg); display: grid; place-items: center; position: relative; cursor: zoom-in; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.zoom-hint { position: absolute; right: .4rem; bottom: .4rem; width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border-radius: 50%; background: rgb(0 0 0 / .45); color: #fff; font-size: .95rem; opacity: 0; transition: opacity .15s; }
.card-media:hover .zoom-hint, .card-media:focus-visible .zoom-hint { opacity: 1; }
.card-body { padding: .75rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.card-body form { margin-top: auto; display: flex; flex-direction: column; gap: .25rem; }
.card-title { font-size: 1rem; margin: 0; }
.card-title a { color: var(--text); text-decoration: none; }
.card-shop { margin: 0; }
.card-shop a { color: var(--muted); }
.card-text { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 700; margin: 0; color: var(--price); }
.price.large { font-size: 1.5rem; }
.placeholder { display: grid; place-items: center; width: 100%; height: 100%; font-size: 2.2rem; font-weight: 700; color: var(--muted); background: linear-gradient(135deg, var(--bg), var(--border)); }
.placeholder.large { aspect-ratio: 1 / 1; border-radius: var(--radius); }

/* Storefront */
.shop-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1.5rem; padding: 1.25rem; border-radius: var(--radius); background: var(--hero-bg); color: var(--hero-text); border: var(--card-border); }
.shop-hero h1 { margin: 0 0 .2rem; }
.shop-hero h1 a { color: inherit; text-decoration: none; }
.shop-hero-text { flex: 1 1 220px; }
.shop-meta { margin: 0; font-size: .92rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.shop-meta a { color: inherit; }
.shop-logo { width: 76px; height: 76px; object-fit: contain; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); padding: 4px; }
.shop-logo-initial { display: grid; place-items: center; font-size: 2rem; font-weight: 800; color: var(--primary); font-family: var(--heading-font); }
.shop-hero .btn-ghost { color: inherit; border-color: currentColor; }
.category-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); margin-bottom: 1.5rem; }
.category-card { display: flex; flex-direction: column; gap: .25rem; padding: .5rem; border-radius: var(--radius); background: var(--surface); border: var(--card-border); color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: box-shadow .15s ease, border-color .15s; }
.category-card:hover { box-shadow: var(--shadow-hover); }
.category-card.is-active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.category-cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: calc(var(--radius) - 4px); font-size: 1.6rem; }
.category-name { font-weight: 600; font-size: .92rem; }
.category-count { color: var(--muted); }
.shop-contact { margin-top: 2rem; padding: 1rem; background: var(--surface); border-radius: var(--radius); border: var(--card-border); }

.breadcrumbs { margin-bottom: 1rem; color: var(--muted); }
.product-detail { display: grid; gap: 1.5rem; }
@media (min-width: 800px) { .product-detail { grid-template-columns: 1fr 1fr; } }
.product-media img { border-radius: var(--radius); width: 100%; }
.add-to-cart { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1rem 0; }
.description { margin-top: 1rem; white-space: pre-line; }
.lightbox-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .6rem; }
.chip-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-block; padding: .4rem .8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); }

/* Lightbox (native <dialog>: Escape closes, focus is trapped by the browser) */
.lightbox { border: 0; padding: 0; border-radius: var(--radius); background: var(--surface); color: var(--text); width: min(960px, 100% - 1.5rem); max-height: calc(100vh - 2rem); box-shadow: 0 30px 80px rgb(0 0 0 / .35); }
.lightbox::backdrop { background: rgb(10 12 16 / .72); backdrop-filter: blur(3px); }
.lightbox[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
@media (prefers-reduced-motion: reduce) { .lightbox[open] { animation: none; } }
.lightbox-inner { display: grid; position: relative; max-height: calc(100vh - 2rem); overflow: auto; }
@media (min-width: 760px) { .lightbox-inner { grid-template-columns: 1.15fr 1fr; } }
.lightbox-media { background: var(--bg); display: grid; place-items: center; min-height: 240px; }
.lightbox-media img { width: 100%; max-height: 80vh; object-fit: contain; }
.lightbox-info { padding: 1.25rem 1.25rem 1.5rem; display: flex; flex-direction: column; gap: .3rem; }
.lightbox-info h2 { margin: 0; font-size: 1.45rem; }
.lightbox-info .description { max-height: 40vh; overflow: auto; margin-top: .5rem; }
.lightbox-close { position: absolute; top: .5rem; right: .5rem; z-index: 2; width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 0; background: rgb(0 0 0 / .55); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.lightbox-close:hover { background: rgb(0 0 0 / .75); }
body.has-dialog { overflow: hidden; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: .65rem .75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table tfoot th { text-align: right; font-weight: 500; }
.table td.num, .table th.num { text-align: right; }
.table tr.grand th, .table tr.grand td { font-size: 1.1rem; border-bottom: 0; }
@media (max-width: 640px) {
  .cart-table thead, .responsive-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td, .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .cart-table tr, .responsive-table tr { border-bottom: 1px solid var(--border); padding: .5rem 0; }
  .cart-table td, .responsive-table td { border: 0; padding: .3rem .75rem; text-align: left; }
  .cart-table td[data-label]::before, .responsive-table td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--muted); }
}

/* Cart & checkout */
.cart-group { margin-bottom: 2rem; padding: 1rem; background: var(--surface); border: var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow); }
.cart-group h2 { margin-top: 0; }
.cart-group .table { border-radius: 0; }
.cart-product { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; }
.cart-product img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.qty-form { display: flex; align-items: center; gap: .35rem; }
.cart-totals { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1.25rem; max-width: 380px; margin: 1rem 0 0 auto; }
.cart-totals dt { color: var(--muted); }
.cart-totals dd { margin: 0; text-align: right; font-weight: 600; white-space: nowrap; }
.cart-totals .grand { font-size: 1.2rem; color: var(--text); font-weight: 800; border-top: 1px solid var(--border); padding-top: .35rem; }
.saving { color: var(--success); }
p.saving { text-align: right; margin: .35rem 0 0; }
.cart-actions { display: flex; justify-content: flex-end; margin-top: 1rem; }
.checkout-grid, .account-grid { display: grid; gap: 1.25rem; }
@media (min-width: 860px) { .checkout-grid { grid-template-columns: 1fr 1.1fr; align-items: start; } .account-grid { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.panel-box { background: var(--surface); border: var(--card-border); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.panel-box > h2 { margin-top: 0; font-size: 1.15rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.subhead { margin-top: 1.5rem; font-size: 1.05rem; }

.confirmation { max-width: 640px; margin: 0 auto; text-align: center; }
.confirmation .panel-box { text-align: left; }
.confirmation-icon { width: 4rem; height: 4rem; margin: 0 auto .75rem; display: grid; place-items: center; border-radius: 50%; background: var(--success); color: #fff; font-size: 2rem; }
.confirmation-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.lead { font-size: 1.1rem; }

/* Auth & account */
.auth-card { max-width: 440px; margin: 2rem auto; background: var(--surface); padding: 1.5rem; border-radius: var(--radius); border: var(--card-border); box-shadow: var(--shadow); }
.auth-card-wide { max-width: 720px; }
.form { display: flex; flex-direction: column; gap: .7rem; }
.form > label { font-weight: 600; font-size: .9rem; }
.form button { margin-top: .5rem; }
.auth-switch { text-align: center; margin: 1rem 0 0; }
.choice-group { border: 0; padding: 0; margin: .5rem 0 0; display: grid; gap: .5rem; }
.choice-group legend { font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
@media (min-width: 640px) { .choice-group { grid-template-columns: 1fr 1fr; } .choice-group legend, .choice-group .field-error { grid-column: 1 / -1; } }
.choice { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 35%, transparent); }
.choice input { margin-top: .2rem; }
.activation-options { display: grid; gap: 1rem; margin-top: 1rem; }
@media (min-width: 640px) { .activation-options { grid-template-columns: 1fr 1fr; } }
.activation-options .panel-box { margin: 0; }
.otp-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.resend-form { margin-top: .75rem; }
.verify-card { text-align: center; }
.verify-card .form { text-align: left; }
.loyalty-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.loyalty-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .2rem; border-bottom: 1px solid var(--border); }

/* Shared with panels */
.stats { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 1.5rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .25rem; }
.stat-label { color: var(--muted); font-size: .85rem; }
.status { padding: .15rem .55rem; border-radius: 999px; font-size: .8rem; border: 1px solid var(--border); white-space: nowrap; }
.status-active { color: var(--success); border-color: var(--success); }
.status-expired, .status-inactive { color: var(--danger); border-color: var(--danger); }
.status-placed, .status-confirmed { color: var(--primary); border-color: var(--primary); }
.status-shipped { color: var(--accent); border-color: var(--accent); }
.status-completed { color: var(--success); border-color: var(--success); }
.status-cancelled, .status-blocked { color: var(--danger); border-color: var(--danger); }
.yes { color: var(--success); font-weight: 600; }
.no { color: var(--muted); }

.summary-table td, .summary-table th { padding: .45rem .5rem; }
.shop-register { margin: 0 0 1.25rem; }
.product-info .lightbox-badges { margin-top: .25rem; }
.pagination { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin: 1.5rem 0; }
.pagination a, .pagination span { padding: .35rem .7rem; border-radius: var(--btn-radius); border: 1px solid var(--border); background: var(--surface); text-decoration: none; }
.pagination [aria-current] { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }

.site-footer { border-top: 1px solid var(--border); padding: 1.5rem 0; color: var(--muted); font-size: .875rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }
.site-footer a { color: var(--muted); }
.error-page { text-align: center; padding: 4rem 0; }
.error-code { font-size: 4rem; font-weight: 800; margin: 0; color: var(--muted); }
