/* css_shop.css */
:root {
  --shop-primary:   #f59e0b;
  --shop-primary-d: #d97706;
  --shop-text:      #0f172a;
  --shop-muted:     #64748b;
  --shop-border:    #e2e8f0;
  --shop-bg:        #f8fafc;
  --shop-card-bg:   #ffffff;
  --shop-radius:    12px;
}

* { box-sizing: border-box; }
body { background: var(--shop-bg); color: var(--shop-text); font-family: system-ui, sans-serif; margin: 0; }

/* ── Topbar ── */
.shop-topbar {
  background: #fff;
  border-bottom: 1px solid var(--shop-border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}
.shop-logo { font-weight: 700; font-size: 18px; color: var(--shop-primary); text-decoration: none; }
.topbar-search {
  flex: 1;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--shop-bg);
  border: 1px solid var(--shop-border);
  border-radius: 8px;
  padding: 6px 12px;
}
.topbar-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  width: 100%;
  color: var(--shop-text);
}
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* ── Košarica ikona ── */
.cart-btn {
  position: relative;
  background: none;
  border: 1px solid var(--shop-border);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 20px;
  color: var(--shop-text);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color .15s;
}
.cart-btn:hover { border-color: var(--shop-primary); }
.cart-badge {
  background: var(--shop-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  display: none;
}
.cart-badge.show { display: inline-block; }

/* ── Auth btn ── */
.auth-btn {
  background: var(--shop-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.auth-btn:hover { background: var(--shop-primary-d); }
.auth-btn.outline {
  background: transparent;
  color: var(--shop-text);
  border: 1px solid var(--shop-border);
}
.auth-btn.outline:hover { border-color: var(--shop-primary); color: var(--shop-primary); background: #fffbeb; }

/* ── Layout ── */
.shop-layout {
  display: flex;
  gap: 24px;
  max-width: 1280px;
  margin: 24px auto;
  padding: 0 16px;
  align-items: flex-start;
}

/* ── Sidebar ── */
.shop-sidebar {
  width: 220px;
  flex-shrink: 0;
}
.sidebar-section { margin-bottom: 24px; }
.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--shop-muted);
  margin-bottom: 10px;
}
.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--shop-text);
  transition: color .1s;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
}
.filter-item:hover { color: var(--shop-primary); }
.filter-item.active { color: var(--shop-primary); font-weight: 600; }
.filter-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--shop-muted);
  background: var(--shop-bg);
  border: 1px solid var(--shop-border);
  border-radius: 10px;
  padding: 1px 6px;
}

/* ── Katalog ── */
.shop-main { flex: 1; min-width: 0; }
.katalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.katalog-count { font-size: 13px; color: var(--shop-muted); }
.sort-select {
  font-size: 13px;
  border: 1px solid var(--shop-border);
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  color: var(--shop-text);
  cursor: pointer;
  outline: none;
}

/* ── Grid artikala ── */
.artikli-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* ── Kartica artikla ── */
.art-card {
  background: var(--shop-card-bg);
  border: 1px solid var(--shop-border);
  border-radius: var(--shop-radius);
  overflow: hidden;
  transition: box-shadow .2s, transform .15s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.art-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.art-card-img {
  aspect-ratio: 1;
  background: var(--shop-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.art-card-img img { width: 100%; height: 100%; object-fit: cover; }
.art-card-img .no-img {
  font-size: 40px;
  color: var(--shop-border);
}
.art-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.art-badge.novo    { background: #dcfce7; color: #166534; }
.art-badge.akcija  { background: #fee2e2; color: #991b1b; }
.art-badge.popust  { background: #fef3c7; color: #92400e; }

.art-card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.art-brand { font-size: 11px; color: var(--shop-muted); text-transform: uppercase; letter-spacing: .04em; }
.art-naziv { font-size: 14px; font-weight: 600; color: var(--shop-text); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.art-sifra { font-size: 11px; color: var(--shop-muted); }
.art-card-footer { padding: 0 12px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ── Cijena ── */
.art-cijena { font-size: 18px; font-weight: 700; color: var(--shop-text); }
.art-cijena.akcija { color: #dc2626; }
.art-cijena-old { font-size: 12px; color: var(--shop-muted); text-decoration: line-through; }
.cijena-lock {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--shop-muted);
  background: var(--shop-bg);
  border: 1px solid var(--shop-border);
  border-radius: 6px;
  padding: 4px 8px;
}

/* ── Gumb dodaj u košaricu ── */
.btn-dodaj {
  background: var(--shop-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
}
.btn-dodaj:hover { background: var(--shop-primary-d); }
.btn-dodaj:active { transform: scale(.92); }
.btn-dodaj:disabled { background: var(--shop-border); cursor: not-allowed; }

/* ── Paginacija ── */
.paginacija { display: flex; justify-content: center; gap: 6px; margin-top: 32px; }
.page-btn {
  border: 1px solid var(--shop-border);
  background: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  color: var(--shop-text);
}
.page-btn:hover { border-color: var(--shop-primary); color: var(--shop-primary); }
.page-btn.active { background: var(--shop-primary); color: #fff; border-color: var(--shop-primary); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Loading / Empty ── */
.loading-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.skeleton { background: linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%); background-size: 200%; animation: skel 1.2s infinite; border-radius: var(--shop-radius); }
@keyframes skel { 0%{background-position:200%}100%{background-position:-200%} }
.empty-state { text-align: center; padding: 60px 20px; color: var(--shop-muted); }
.empty-state i { font-size: 48px; display: block; margin-bottom: 16px; }

/* ── Modal Košarica ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 200;
  align-items: flex-start;
  justify-content: flex-end;
}
.modal-overlay.open { display: flex; }
.cart-panel {
  background: #fff;
  width: 400px;
  max-width: 100vw;
  height: 100vh;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: -8px 0 32px rgba(0,0,0,.12);
}
.cart-panel h2 { font-size: 18px; font-weight: 700; margin: 0; display: flex; align-items: center; justify-content: space-between; }
.cart-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--shop-muted); padding: 0; }
.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--shop-border);
}
.cart-item-img { width: 56px; height: 56px; background: var(--shop-bg); border-radius: 8px; object-fit: cover; flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cart-item-img i { font-size: 24px; color: var(--shop-border); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-naziv { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-meta { font-size: 12px; color: var(--shop-muted); margin-top: 2px; }
.cart-item-actions { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.qty-btn { width: 24px; height: 24px; border: 1px solid var(--shop-border); border-radius: 4px; background: #fff; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.qty-val { font-size: 13px; font-weight: 600; min-width: 20px; text-align: center; }
.cart-item-ukloni { background: none; border: none; color: var(--shop-muted); cursor: pointer; font-size: 16px; margin-left: auto; }
.cart-item-ukloni:hover { color: #dc2626; }
.cart-ukupno { font-size: 20px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; padding-top: 8px; }
.btn-checkout {
  background: var(--shop-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: background .15s;
}
.btn-checkout:hover { background: var(--shop-primary-d); }

/* ── Modal Login ── */
.login-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.login-overlay.open { display: flex; }
.login-panel {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: 380px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 24px 64px rgba(0,0,0,.15);
}
.login-panel h2 { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.login-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--shop-border); margin-bottom: 24px; }
.login-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--shop-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
}
.login-tab.active { color: var(--shop-primary); border-bottom-color: var(--shop-primary); }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--shop-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.form-group input, .form-group select {
  width: 100%;
  border: 1px solid var(--shop-border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
  background: #fff;
  color: var(--shop-text);
}
.form-group input:focus, .form-group select:focus { border-color: var(--shop-primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-submit {
  width: 100%;
  background: var(--shop-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background .15s;
}
.btn-submit:hover { background: var(--shop-primary-d); }
.form-error { font-size: 12px; color: #dc2626; margin-top: 8px; display: none; }
.form-error.show { display: block; }

/* ── Toast ── */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 500; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1e293b;
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  animation: toastIn .25s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.toast.success i { color: #4ade80; }
.toast.error   i { color: #f87171; }
.toast.info    i { color: #60a5fa; }
@keyframes toastIn { from{transform:translateX(100%);opacity:0} to{transform:none;opacity:1} }

/* ── Checkout forma ── */
#checkout-panel { display: none; flex-direction: column; gap: 16px; }
#checkout-panel.show { display: flex; }
#cart-items-panel { display: flex; flex-direction: column; gap: 0; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .shop-sidebar { display: none; }
  .shop-layout { flex-direction: column; }
  .cart-panel { width: 100vw; }
}
