/* Bootstrap (CDN, loaded before this file in the layout) supplies layout/grid/forms/nav
 * mechanics; everything below is the storefront's own look on top of it. Bootstrap's CDN build
 * bakes its component colors (--bs-btn-bg etc.) into fixed values at their own build time, so
 * simply redefining --bs-primary here wouldn't recolor .btn-primary — the handful of components
 * actually used in this small app are overridden directly instead.
 *
 * Look: classic WooCommerce theme (Botiga/Storefront family) — the shape most real online
 * shops actually use: a slim utility bar, a big Amazon-style "category + search" combo box
 * front and center in the header, a category nav bar with a "Sve kategorije" mega-menu trigger,
 * white rounded product cards with a quick-add button that slides up on image hover, and a dark
 * footer. Strictly monochrome on purpose — black, a couple of grays, white, nothing else —
 * "accent" here means near-black, not a brand hue. Poppins (a rounded, friendly geometric sans
 * used by most WP shop themes) carries headings, Inter carries body copy. */

:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-alt: #f0f0f1;
  --border: #e0e0e2;
  --text: #1a1a1a;
  --text-muted: #6b6b6f;
  --accent: #3d3d40;
  --accent-dark: #000000;
  --accent-soft: #ececed;
  --success: #2e8f5a;
  --success-soft: #e5f4ec;
  --danger: #d63638;
  --danger-soft: #fbe8e8;
  --warn: #b5730a;
  --warn-soft: #fbf0dc;
  --dark: #1a1a1c;
  --dark-2: #2c2c2f;
  --radius-sm: 0.4rem;
  --radius-md: 0.65rem;
  --radius-lg: 1rem;
  --shadow-sm: 0 1px 3px rgba(28, 28, 30, 0.08);
  --shadow-md: 0 0.5rem 1.5rem rgba(28, 28, 30, 0.1);
  --shadow-lg: 0 1rem 2.5rem rgba(28, 28, 30, 0.16);
  /* A gentle diagonal sheen on every black/dark fill — not a flat tint — so the light/dark
     surfaces this theme is built from (dark chrome, dark bars, white cards) each have a little
     depth instead of reading as solid color blocks. */
  --gradient-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  --gradient-dark: linear-gradient(135deg, var(--dark-2) 0%, var(--dark) 100%);
}

body {
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1 0 auto;
}

.site-footer {
  flex-shrink: 0;
}

/* ── Flash messages — float above content, top-right, auto-dismiss ──────────────────────────── */

.flash-container {
  position: fixed;
  top: 8rem;
  right: 1rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(22rem, calc(100vw - 2rem));
}

.flash-message {
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: flash-in 0.2s ease-out;
  transition: opacity 0.2s ease-in, transform 0.2s ease-in;
}

.flash-message--hide {
  opacity: 0;
  transform: translateX(1rem);
}

.flash-close {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.5rem 0.75rem;
  background: none;
  border: 0;
  line-height: 1;
  font-size: 1.1rem;
  color: inherit;
  opacity: 0.5;
}

.flash-close:hover {
  opacity: 1;
}

@keyframes flash-in {
  from {
    opacity: 0;
    transform: translateX(1rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Poppins", "Inter", sans-serif;
  color: var(--text);
  letter-spacing: -0.005em;
  font-weight: 600;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.3rem;
}

.fb-section-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  text-align: center;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
}

hr {
  border-color: var(--border);
  opacity: 1;
}

/* Bootstrap's .text-muted/.text-body ship light-ish grays already, but pinned to their own
   variables rather than this theme's — pinned here so both always match --text-muted/--text
   exactly instead of drifting a shade apart. */
.text-muted {
  color: var(--text-muted) !important;
}

.text-body {
  color: var(--text) !important;
}

/* ── Header — three rows: a slim dark utility bar, a main row with a big search-combo box,
   and a category nav bar with a "Sve kategorije" mega-menu trigger ─────────────────────────── */

/* Sticks as one unit — topbar through the category nav line — so it stays visible while
   scrolling instead of just the nav row. Below the flash toasts (z-index 1080) but above
   page content. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
}

.topbar {
  background: var(--gradient-accent);
  color: #fff;
  font-size: 0.78rem;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  flex-wrap: wrap;
}

.topbar-msg {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.topbar-msg svg {
  width: 1rem;
  height: 1rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #fff;
  font-weight: 600;
}

.topbar-phone svg {
  width: 0.95rem;
  height: 0.95rem;
}

.topbar-phone:hover {
  color: #fff;
  opacity: 0.85;
}

.topbar-social {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-social-link {
  display: inline-flex;
  color: #fff;
  opacity: 0.9;
}

.topbar-social-link svg {
  width: 0.9rem;
  height: 0.9rem;
}

.topbar-social-link:hover {
  opacity: 1;
}

.header-main {
  background: var(--surface);
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.header-main-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Poppins", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.header-brand:hover {
  color: var(--accent);
}

.brand-logo {
  height: 1.9rem;
  width: auto;
  max-width: 10.5rem;
  vertical-align: middle;
}

@media (max-width: 420px) {
  .brand-logo {
    height: auto;
    max-height: 1.6rem;
    max-width: 7rem;
  }
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: "Poppins", sans-serif;
}

/* The Amazon-style combo: a category <select>, a text input and a submit button all fused
   into one bordered pill so it reads as a single control instead of three separate fields. */
.header-search-combo {
  display: flex;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 40rem;
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.search-category-select {
  flex-shrink: 0;
  max-width: 9rem;
  border: none;
  border-right: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0 0.6rem;
}

.search-category-select:focus {
  outline: none;
}

.header-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: var(--surface);
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
}

.header-search-input:focus {
  outline: none;
  box-shadow: none;
}

.header-search-input::placeholder {
  color: var(--text-muted);
}

.header-search-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  background: var(--gradient-accent);
  border: none;
  color: #fff;
}

.header-search-btn:hover {
  background: var(--accent-dark);
}

.header-search-btn svg {
  width: 1.2rem;
  height: 1.2rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

/* Icon on top, small label underneath — the classic WooCommerce-theme account/cart button. */
.header-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  background: none;
  border: none;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text);
}

.header-action-btn svg {
  width: 1.35rem;
  height: 1.35rem;
}

.header-action-btn:hover {
  background: var(--surface-alt);
  color: var(--accent);
}

.header-action-btn::after {
  display: none;
}

.header-action-label {
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  max-width: 6rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-cart-btn {
  position: relative;
}

.cart-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cart-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.cart-count {
  background: var(--accent-dark);
  color: #fff;
  border-radius: 50%;
  width: 1.05rem;
  height: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  position: absolute;
  top: -0.35rem;
  right: -0.5rem;
  border: 2px solid var(--surface);
}

.header-login-panel,
.header-account-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 1.25rem;
  width: 18rem;
}

.header-account-panel {
  width: auto;
  min-width: 12rem;
  padding: 0.4rem 0;
}

.header-login-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.header-login-sub {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

.header-login-footer {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.85rem 0 0;
}

@media (max-width: 767.98px) {
  .header-main-inner {
    row-gap: 0.85rem;
  }

  .header-search-combo {
    order: 5;
    flex-basis: 100%;
    max-width: none;
  }

  .search-category-select {
    display: none;
  }
}

/* Category nav bar — dark, houses the "Sve kategorije" mega-menu trigger plus a couple of
   plain links; collapses behind a hamburger below the lg breakpoint. */
.header-catnav {
  background: var(--gradient-dark);
}

.header-catnav-inner {
  display: flex;
  align-items: stretch;
  min-height: 3rem;
}

.catnav-all {
  flex-shrink: 0;
}

.catnav-all-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
  background: var(--gradient-accent);
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0 1.25rem;
  white-space: nowrap;
}

.catnav-all-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}

.catnav-all-toggle:hover,
.catnav-all-toggle.show {
  background: var(--accent-dark);
}

.catnav-all-toggle::after {
  display: none;
}

.header-catnav .navbar-toggler {
  border: none;
  color: #fff;
  padding: 0.5rem 0.9rem;
}

.header-catnav .navbar-toggler svg {
  width: 1.3rem;
  height: 1.3rem;
}

.header-catnav .navbar-toggler:focus {
  box-shadow: none;
}

.catnav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0 0.5rem;
  height: 100%;
}

.catnav-link {
  display: flex;
  align-items: center;
  height: 100%;
  color: #d8d5df;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0 1rem;
}

.catnav-link:hover,
.catnav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 991.98px) {
  .header-catnav-inner {
    flex-wrap: wrap;
  }

  .navbar-collapse {
    flex-basis: 100%;
  }

  .catnav-links {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 0.25rem 0;
  }

  .catnav-link {
    height: auto;
    padding: 0.65rem 1rem;
  }
}

/* ── Buttons — filled purple primary, moderate rounding ─────────────────────────────────────── */

.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.65rem 1.4rem;
}

.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--accent-dark);
  --bs-btn-hover-border-color: var(--accent-dark);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--accent-dark);
  --bs-btn-active-border-color: var(--accent-dark);
  --bs-btn-disabled-bg: var(--accent);
  --bs-btn-disabled-border-color: var(--accent);
  background-image: var(--gradient-accent);
}

.btn-primary:hover,
.btn-primary:active {
  background-image: var(--accent-dark);
}

.btn-outline-primary {
  --bs-btn-color: var(--accent);
  --bs-btn-border-color: var(--border);
  --bs-btn-hover-bg: var(--accent);
  --bs-btn-hover-border-color: var(--accent);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--accent);
  --bs-btn-active-border-color: var(--accent);
  --bs-btn-active-color: #fff;
}

.btn-light {
  --bs-btn-bg: var(--surface-alt);
  --bs-btn-border-color: var(--border);
  --bs-btn-color: var(--text);
  --bs-btn-hover-bg: #e4e4e6;
}

.btn-outline-danger {
  --bs-btn-color: var(--danger);
  --bs-btn-border-color: #f0c4c4;
}

.btn-check:checked + .btn-outline-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── "Sve kategorije" mega-menu — a category with children opens a nested flyout to the side
   rather than expanding inline ──────────────────────────────────────────────────────────────── */

.category-menu {
  min-width: 16rem;
}

.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  padding: 0.5rem;
}

.dropdown-item {
  color: var(--text);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--accent-soft);
  color: var(--accent);
}

.menu-submenu {
  position: relative;
}

.menu-submenu-row {
  display: flex;
  align-items: stretch;
}

.menu-submenu-row .dropdown-item {
  flex: 1 1 auto;
}

.menu-submenu-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.menu-submenu-toggle svg {
  width: 0.95rem;
  height: 0.95rem;
}

.menu-submenu-toggle:hover,
.menu-submenu-toggle[aria-expanded="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

/* No overflow/max-height here (or on .menu-submenu-panel) even though a branch can run to
   15-20 items — a scrolling ancestor clips *both* axes once either is non-"visible" (overflow-x
   computes to "auto" the moment overflow-y isn't "visible"), which would silently hide every
   flyout the instant it tries to escape to the right. Only one branch is ever open at a time,
   so an occasional panel taller than the viewport is an acceptable trade for flyouts actually
   being visible. */
.menu-submenu-panel {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 6px;
}

.menu-submenu-panel.show {
  display: block;
}

/* ── Full-bleed homepage sections (see home/index.html.erb + layout's full_bleed hook) ──────── */

.fb-section {
  width: 100%;
  background: var(--surface);
  padding: 3.5rem 0;
}

.fb-band-alt {
  background: linear-gradient(180deg, var(--surface-alt) 0%, #e6e6e8 100%);
}

.fb-band-trust {
  background: var(--gradient-dark);
}

.fb-feature-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 1.5rem;
}

@media (min-width: 768px) {
  .fb-feature-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

.fb-feature {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.fb-feature svg {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.55rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #d6d6d8;
}

.fb-feature h3 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.fb-feature p {
  color: #a9a6b3;
  font-size: 0.8rem;
  margin: 0;
}

/* ── Hero (homepage) — a light, bold sale-banner slider, purple CTA ──────────────────────────── */

.hero-slider {
  margin-bottom: 0;
}

.hero-slide {
  display: flex;
  align-items: center;
  min-height: 20rem;
  padding: 3rem 1.5rem;
  color: var(--text);
  position: relative;
  overflow: hidden;
}

@media (min-width: 992px) {
  .hero-slide {
    min-height: 24rem;
    padding: 3.5rem 3rem;
  }
}

.hero-slide-1 {
  background: linear-gradient(120deg, #d9d9db 0%, #f7f7f8 65%);
}

.hero-slide-2 {
  background: linear-gradient(120deg, #e4e4e6 0%, #f7f7f8 65%);
}

.hero-slide-3 {
  background: linear-gradient(120deg, #cfcfd1 0%, #f7f7f8 65%);
}

.hero-slide-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Just enough of a light scrim directly behind the text (left side, see .hero-slide-content)
   to keep it readable over an arbitrary uploaded photo — fading out to fully clear by 70% so
   the banner image itself is actually visible, not washed out edge-to-edge like the old flat
   0.94->0.55 two-stop gradient did. */
.hero-slide-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(247, 247, 249, 0.82) 0%, rgba(247, 247, 249, 0.4) 40%, rgba(247, 247, 249, 0) 70%);
}

.hero-slide-content {
  position: relative;
  z-index: 1;
  max-width: 34rem;
}

.hero-slide h1 {
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 0.85rem;
}

.hero-slide p {
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  font-size: 1.05rem;
}

.hero-slider .carousel-control-prev,
.hero-slider .carousel-control-next {
  width: 3rem;
  opacity: 0.4;
  filter: invert(1);
}

.hero-slider .carousel-control-prev:hover,
.hero-slider .carousel-control-next:hover {
  opacity: 0.8;
}

.hero-slider .carousel-indicators [data-bs-target] {
  background-color: rgba(35, 32, 42, 0.25);
  border-radius: 50%;
  width: 7px;
  height: 7px;
}

.hero-slider .carousel-indicators .active {
  background-color: var(--accent);
}

/* ── Category tiles (homepage "Kupujte po kategoriji") — colorful circular icon, card lifts on
   hover, the classic WooCommerce-theme category-icon row ───────────────────────────────────── */

/* "Kupujte po kategoriji" — every top-level category as a horizontally scrollable strip
   (category_scroller_controller.js scrolls .category-track on an arrow click) instead of a
   grid that wraps onto more rows once there are more than ~6 categories. */
.category-scroller {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-track {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  padding: 0.25rem 0.1rem 0.5rem;
  /* Firefox + WebKit: keep the strip's own scrollbar out of the layout entirely — the arrow
     buttons are the intended way to move it, a visible native scrollbar would just compete
     with them for the same job. Drag-to-scroll/trackpad swipe still work either way. */
  scrollbar-width: none;
}

.category-track::-webkit-scrollbar {
  display: none;
}

.category-item {
  flex: 0 0 auto;
  width: 5.5rem;
  scroll-snap-align: start;
}

.category-scroll-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.category-scroll-btn:hover {
  background: var(--surface-alt);
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  padding: 0.5rem;
  border-radius: var(--radius-lg);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: inherit;
}

.category-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 4.5rem;
  height: 4.5rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  font-family: "Poppins", sans-serif;
  position: relative;
}

/* Soft/neumorphic treatment — same flat tone as the section behind it (not the per-category
   gradient the Ruby helper still sets inline; !important is what wins over that), depth coming
   only from a light+dark offset shadow pair instead of any gradient or highlight. Scoped to the
   <div> circle (categories, and the brand-placeholder fallback that reuses this same class),
   not plain img.category-tile (an actual uploaded *brand* logo keeps its own white card look —
   see .category-tile.category-tile-photo just below for the category-cover-image circle, which
   wants this same shadow, not that one). */
div.category-tile,
.category-tile.category-tile-photo {
  box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.1), -6px -6px 12px rgba(255, 255, 255, 0.8);
}

div.category-tile {
  background: var(--surface-alt) !important;
}

div.category-tile .category-tile-icon {
  stroke: var(--text);
}

/* A real Category#cover_image (see ApplicationHelper#category_placeholder_tile) — same circle
   the generic icon/initials tile uses, just filled with the uploaded image instead. The
   two-class selector's higher specificity is what lets this override both the base
   .category-tile size rule and the plain img.category-tile rule (brand logos: a white rounded
   square with padding) rather than either of those winning instead. The generated placeholder
   SVGs (script/attach_category_cover_icons.rb, sirius-erp) already bake in their own #f0f0f1
   circle background, so this only needs to crop/frame whatever image arrives — a real photo
   uploaded later fills the same circle exactly the same way. */
.category-tile.category-tile-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: none;
  background: none;
  padding: 0;
  object-fit: cover;
}

.category-tile-icon {
  width: 1.9rem;
  height: 1.9rem;
}

img.category-tile {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
  padding: 0.85rem;
}

.category-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

/* ── Prices — bold; the accent never touches price text, only badges/buttons ─────────────────── */

.price {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.price-lg {
  font-family: "Poppins", sans-serif;
  font-size: 2rem;
  color: var(--accent);
}

/* ── Product tiles (placeholder art) ────────────────────────────────────────────────────────── */

.product-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  color: #fff;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  font-family: "Poppins", sans-serif;
}

.product-tile.product-tile-lg {
  border-radius: var(--radius-md);
  font-size: 2.1rem;
  aspect-ratio: 1 / 1;
}

img.product-tile {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The product detail page's own large photo, unlike every other product-tile use (cards,
   thumbnails), is never cropped — a coiled hose and a straight pipe have wildly different
   proportions, and "cover" would slice off whatever doesn't fit a fixed box. contain + a white
   backing (product photos are rarely shot on pure white) leaves the whole photo visible; the
   surrounding .product-gallery card below supplies the actual frame (border/padding/shadow). */
img.product-tile.product-tile-lg {
  object-fit: contain;
  background: #fff;
}

/* ── Product detail page ─────────────────────────────────────────────────────────────────────
   Deliberately independent of body/.site-main's sticky-footer flex rules above — this section
   only ever adds spacing/borders within the content column, never a height/min-height, so a
   short product (no attributes, single price) stays its natural height instead of being
   stretched to push the footer down. */

.product-gallery {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}

.product-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.product-title {
  margin-bottom: 0.35rem;
}

.product-sku {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.product-price-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.product-specs {
  margin: 0 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.product-specs > div {
  display: flex;
  gap: 1rem;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
}

.product-specs > div:nth-child(odd) {
  background: var(--surface-alt);
}

.product-specs dt {
  flex: 0 0 40%;
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
}

.product-specs dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

.product-purchase {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ── Product detail gallery thumbnails (gallery_controller.js) ─────────────────────────────── */

.gallery-thumbs {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}

.gallery-thumb {
  width: 3.25rem;
  height: 3.25rem;
  object-fit: cover;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  opacity: 0.65;
}

.gallery-thumb:hover {
  opacity: 1;
}

.gallery-thumb.active {
  opacity: 1;
  border-color: var(--accent);
  border-width: 2px;
}

/* ── Product cards — white, rounded, soft shadow; a "Dodaj u korpu" button slides up over the
   image on hover, the signature WooCommerce/Botiga quick-add interaction ──────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.product-card {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.product-card-media {
  position: relative;
  background: var(--surface-alt);
  overflow: hidden;
}

.product-card-image-link {
  display: block;
}

/* The info area below the image gets a shade distinct from the plain white .card-body used
   elsewhere (settings, quote cards, ...) — only scoped to product cards, so this doesn't leak
   into every other .card-body in the app. */
.product-card .card-body {
  background: var(--surface-alt);
}

.stock-ribbon {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.stock-ribbon-in {
  background: var(--success-soft);
  color: var(--success);
}

.stock-ribbon-out {
  background: var(--surface-alt);
  color: var(--text-muted);
}

.quick-add-form {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: -3rem;
  transition: bottom 0.18s ease;
}

.product-card:hover .quick-add-form {
  bottom: 0.6rem;
}

.quick-add-btn {
  display: block;
  width: 100%;
  background: var(--gradient-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.quick-add-btn:hover {
  background: var(--accent-dark);
}

/* .card is already a flex column (Bootstrap default) stretched to h-100 by the grid — this
   link and the card-body inside it need to flex-grow too, so the price row can be pushed to
   the bottom (margin-top: auto) and land on the same baseline across a row of cards no matter
   how many lines the title or attribute badges above it wrap to. */
.card-body-link {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  background: var(--surface);
  padding: 0.9rem 1rem;
}

/* Pinned to the card's bottom as a pair with .price-row right after it — the margin-top: auto
   goes on this one (the first of the pair), not .price-row, so the flexible gap lands above the
   SKU instead of between SKU and price, keeping the SKU directly above the price rather than
   right under the title. */
.sku-row {
  margin-top: auto;
}

.price-row {
  padding-top: 0.5rem;
}

.card-title {
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--text);
  font-weight: 600;
}

.card-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sku-pill {
  display: inline-block;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge.text-bg-light {
  background: var(--surface-alt) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border);
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.badge.text-bg-success {
  background: var(--success-soft) !important;
  color: var(--success) !important;
  border-radius: var(--radius-sm);
}

.badge.text-bg-primary {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
  border-radius: var(--radius-sm);
}

.badge.text-bg-secondary {
  background: var(--surface-alt) !important;
  color: var(--text-muted) !important;
  border-radius: var(--radius-sm);
}

/* ── Category filter bar — plain rounded selects ─────────────────────────────────────────────── */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.filter-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  color: var(--text);
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 0.15rem var(--accent-soft);
}

.filter-reset {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: underline;
}

.filter-reset:hover {
  color: var(--accent);
}

/* ── Footer — dark, matching the category nav bar; the classic WooCommerce-theme bookend ────── */

.site-footer {
  background: var(--gradient-dark);
  color: #a9a6b3;
  margin-top: 0;
  font-size: 0.85rem;
}

.site-footer a {
  color: #a9a6b3;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

.footer-muted {
  color: #a9a6b3;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Poppins", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.footer-heading {
  color: #fff;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 0.9rem;
}

.footer-social {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #a9a6b3;
}

.footer-social-link svg {
  width: 1rem;
  height: 1rem;
}

.footer-social-link:hover {
  background: var(--accent);
  color: #fff;
}

.site-footer hr {
  border-color: rgba(255, 255, 255, 0.12);
}

/* ── Forms (generic) ─────────────────────────────────────────────────────────────────────── */

.form-control,
.form-select {
  background-color: #fff;
  border-color: var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.form-control:focus,
.form-select:focus {
  background-color: #fff;
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 0.15rem var(--accent-soft);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.table {
  color: var(--text);
  --bs-table-color: var(--text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--border);
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumb-item.active {
  color: var(--text-muted);
}

.breadcrumb-item a {
  color: var(--text-muted);
}

.breadcrumb-item a:hover {
  color: var(--accent);
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--border);
}

.alert {
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.alert-danger {
  background: var(--danger-soft);
  border-color: #f0c4c4;
  color: var(--danger);
}

.alert-success {
  background: var(--success-soft);
  border-color: #c7e4d3;
  color: var(--success);
}

.alert-warning {
  background: var(--warn-soft);
  border-color: #ecd9a4;
  color: var(--warn);
}

/* ── Address autocomplete (searchable_select_controller.js) ───────────────────────────────── */

[data-controller="searchable-select"] {
  position: relative;
  display: block;
  width: 100%;
}

.searchable-select-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1050; /* above Bootstrap's own dropdowns/navbar */
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  min-width: 220px;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.searchable-select-item {
  padding: 5px 10px;
  cursor: pointer;
}

.searchable-select-item:hover,
.searchable-select-item.active {
  background: var(--surface-alt);
}

/* ── Product-list pagination — rounded squares, purple for the active page ──────────────────── */

.pagination .page-link {
  color: var(--text);
  border-color: var(--border);
  border-radius: var(--radius-sm);
  margin: 0 0.15rem;
  font-weight: 600;
}

.pagination .page-link:hover,
.pagination .page-link:focus {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--border);
}

.pagination .page-item.active .page-link {
  background: var(--gradient-accent);
  border-color: var(--accent);
  color: #fff;
}

.pagination .page-item.disabled .page-link {
  color: var(--border);
  background: transparent;
}

/* Rekapitulacija PDV-a — the last rows of an items table (shared/_vat_recap_rows,
   shared/_vat_recap_columns): labels right-aligned next to their amounts, the amount to pay set apart. */
.vat-recap-rows th {
  font-weight: 500;
  color: var(--bs-secondary-color, #6c757d);
  text-align: right;
  border-bottom: 0;
}

.vat-recap-rows td {
  border-bottom: 0;
  font-variant-numeric: tabular-nums;
}

.vat-recap-rows tr.vat-recap-first th,
.vat-recap-rows tr.vat-recap-first td {
  border-top: 2px solid currentColor;
  padding-top: 0.6rem;
}

.vat-recap-rows tr.vat-recap-total th,
.vat-recap-rows tr.vat-recap-total td {
  border-top: 1px solid var(--bs-border-color, #dee2e6);
  font-weight: 700;
  color: inherit;
}

.vat-recap-rows tr.vat-recap-grand th,
.vat-recap-rows tr.vat-recap-grand td {
  border-top: 1px solid var(--bs-border-color, #dee2e6);
  padding-top: 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: inherit;
}
