@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&display=swap');
@import url('variables.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a  { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--text-dark);
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); font-weight: 600; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
p  { color: var(--text-mid); }

/* ── Container ── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 14px 32px;
  border-radius: var(--r-full);
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--t);
  white-space: nowrap;
}
.btn-primary {
  background: var(--green-primary);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(27,95,173,0.35);
}
.btn-primary:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(27,95,173,0.4);
}
.btn-outline {
  background: transparent;
  color: var(--green-primary);
  border: 2px solid var(--green-primary);
}
.btn-outline:hover {
  background: var(--green-primary);
  color: var(--white);
  transform: translateY(-2px);
}
.btn-teal {
  background: var(--teal);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(15,179,160,0.35);
}
.btn-teal:hover {
  background: #0a9d8b;
  transform: translateY(-2px);
}
.btn-sm { padding: 10px 22px; font-size: 0.875rem; }
.btn-lg { padding: 18px 40px; font-size: 1.05rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ── Glass card ── */
.glass {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
}

/* ── Section ── */
.section { padding: var(--sp-20) 0; }
.section-sm { padding: var(--sp-12) 0; }
.section-header { text-align: center; margin-bottom: var(--sp-12); }
.section-header .eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--green-mid);
  margin-bottom: var(--sp-3);
}
.section-header h2 { margin-bottom: var(--sp-4); }
.section-header p { max-width: 560px; margin: 0 auto; font-size: 1.05rem; }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-sale   { background: #ff4757; color: #fff; }
.badge-new    { background: var(--teal); color: #fff; }
.badge-stock  { background: var(--green-pale); color: var(--green-dark); }
.badge-out    { background: #eee; color: #888; }

/* ── Numeric font — sve cjene i brojevi ── */
.product-price-original,
.cart-item-price, .cart-item-total,
.summary-row .value,
.checkout-item-price,
.product-detail-price,
[class*="-price"], [class*="-total"], [class*="-discount"] {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ── Flash message ── */
.flash {
  padding: var(--sp-4) var(--sp-6);
  border-radius: var(--r);
  margin-bottom: var(--sp-6);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.flash-success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
.flash-error   { background: #f8d7da; color: #721c24; border-left: 4px solid #dc3545; }
.flash-warning { background: #fff3cd; color: #856404; border-left: 4px solid #ffc107; }
.flash-info    { background: #cce5ff; color: #004085; border-left: 4px solid #0080ff; }

/* ── Form ── */
.form-group { margin-bottom: var(--sp-5); }
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: var(--sp-2);
}
.form-control {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border-strong);
  border-radius: var(--r);
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--white);
  transition: var(--t);
  outline: none;
}
.form-control:focus {
  border-color: var(--green-mid);
  box-shadow: 0 0 0 4px rgba(46,155,104,0.1);
}
.form-control.error { border-color: #dc3545; }
.form-error { color: #dc3545; font-size: 0.8rem; margin-top: 4px; }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: var(--sp-8) 0; }

/* ── Pagination ── */
.pagination { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r);
  font-weight: 600; font-size: 0.9rem;
  border: 2px solid var(--border);
  transition: var(--t);
}
.pagination a:hover       { border-color: var(--green-mid); color: var(--green-mid); }
.pagination .current      { background: var(--green-primary); color: #fff; border-color: var(--green-primary); }
.pagination .disabled     { opacity: 0.4; pointer-events: none; }

/* ── Toast ── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.toast {
  min-width: 280px; max-width: 360px;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r);
  background: var(--green-dark);
  color: var(--white);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  transform: translateX(120%);
  transition: transform 0.35s var(--t);
}
.toast.show { transform: translateX(0); }
.toast-success { background: var(--green-primary); }
.toast-error   { background: #c0392b; }
.toast-info    { background: var(--teal); }

/* ── Stars ── */
.stars { color: #f59e0b; letter-spacing: 2px; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: 0.875rem; color: var(--text-muted);
  padding: var(--sp-4) 0;
}
.breadcrumb a:hover { color: var(--green-primary); }
.breadcrumb .sep { opacity: 0.5; }

/* ── Logo image ── */
.logo-img {
  display: block;
  height: 44px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}
.logo-img-footer    { height: 52px; max-width: 220px; }
.logo-img-admin     { height: 36px; max-width: 160px; filter: brightness(0) invert(1); }
.logo-img-auth      { height: 44px; max-width: 200px; }
.logo-img-auth-hero { height: 90px; max-width: 260px; filter: brightness(0) invert(1); opacity: 0.95; }

/* ── Visually hidden ── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Product Card (shared: homepage + shop) ── */
.product-card {
  background: var(--white);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(27,95,173,0.09), 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.32s cubic-bezier(.22,.68,0,1.2),
              box-shadow 0.32s ease,
              border-color 0.22s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border: 1.5px solid var(--border);
}
.product-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-primary), var(--teal-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(.22,.68,0,1.2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  z-index: 3;
}
.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 48px rgba(27,95,173,0.16);
  border-color: rgba(27,95,173,0.18);
}
.product-card:hover::after { transform: scaleX(1); }

/* Image */
.product-card-image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--cream);
}
.product-card-img-link {
  display: block;
  position: absolute;
  inset: 0;
}
.product-card-image img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: var(--sp-5);
  transition: transform 0.5s cubic-bezier(.22,.68,0,1.2), filter 0.3s ease;
  display: block;
}
.product-card:hover .product-card-image img {
  transform: scale(1.08);
  filter: brightness(0.86);
}

/* "Pogledaj" slide-up overlay */
.product-card-view-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(135deg, var(--green-dark), var(--green-primary));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 13px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(.22,.68,0,1.2);
  text-decoration: none;
  z-index: 2;
}
.product-card:hover .product-card-view-overlay { transform: translateY(0); }

/* Badges */
.product-card-badges {
  position: absolute;
  top: var(--sp-3); left: var(--sp-3);
  display: flex; flex-direction: column; gap: var(--sp-2);
  z-index: 2;
}

/* Floating action buttons */
.product-card-actions {
  position: absolute;
  top: var(--sp-3); right: var(--sp-3);
  display: flex; flex-direction: column; gap: var(--sp-2);
  opacity: 0; transform: translateX(12px);
  transition: opacity 0.25s ease, transform 0.28s cubic-bezier(.22,.68,0,1.2);
  z-index: 2;
}
.product-card:hover .product-card-actions { opacity: 1; transform: translateX(0); }
.product-action-btn {
  width: 40px; height: 40px;
  border-radius: var(--r);
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dark);
  border: 1.5px solid var(--border);
  transition: var(--t-fast);
}
.product-action-btn:hover {
  background: var(--green-primary);
  color: var(--white);
  border-color: var(--green-primary);
  transform: scale(1.1);
}
.product-action-btn.wishlisted { color: #ff4757; }

/* Card body */
.product-card-body { padding: var(--sp-5); flex: 1; display: flex; flex-direction: column; }
.product-category-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-mid);
  margin-bottom: var(--sp-2);
}
.product-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: var(--sp-2);
  line-height: 1.3;
  transition: color 0.2s ease;
}
.product-card:hover .product-card-name { color: var(--green-primary); }
.product-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: var(--sp-4);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: auto;
}
.product-price { display: flex; align-items: baseline; gap: var(--sp-2); }
.product-price-current {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  transition: transform 0.2s ease;
}
.product-card:hover .product-price-current { transform: scale(1.04); }
.product-price-original {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: line-through;
}
.product-add-btn {
  width: 40px; height: 40px;
  border-radius: var(--r);
  background: var(--green-primary);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  transition: var(--t-bounce);
  flex-shrink: 0;
  border: none;
}
.product-add-btn:hover { background: var(--green-dark); transform: scale(1.12); }
