/* ============================================
   Components
   - Buttons, Cards, Badges, Forms, Icons,
     Stats, Accordion, Tabs, Toast, Image frame
   ============================================ */

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  --btn-pad-y: 0.85rem;
  --btn-pad-x: 1.6rem;
  --btn-fs: var(--fs-base);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--btn-pad-y) var(--btn-pad-x);
  font-family: var(--font-body);
  font-size: var(--btn-fs);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--t-base),
    border-color var(--t-base),
    color var(--t-base),
    transform var(--t-fast),
    box-shadow var(--t-base);
  white-space: nowrap;
  text-align: center;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Sizes */
.btn--sm {
  --btn-pad-y: 0.55rem;
  --btn-pad-x: 1.1rem;
  --btn-fs: var(--fs-sm);
}

.btn--lg {
  --btn-pad-y: 1.05rem;
  --btn-pad-x: 2rem;
  --btn-fs: var(--fs-md);
}

/* Variants */
.btn--primary {
  background: var(--brand);
  color: var(--text);
  border-color: var(--brand);
  box-shadow: var(--shadow-brand);
}

.btn--primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: var(--text);
}

.btn--dark {
  background: var(--text);
  color: var(--text-on-dark);
  border-color: var(--text);
}

.btn--dark:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: var(--text-on-dark);
}

.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--outline:hover {
  background: var(--bg-accent);
  border-color: var(--brand);
  color: var(--text);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: transparent;
  padding-inline: var(--space-3);
}

.btn--ghost:hover {
  background: var(--bg-accent);
  color: var(--brand-deep);
}

.btn--block {
  width: 100%;
}

/* ============================================
   ICONS
   ============================================ */
.icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  vertical-align: middle;
  flex-shrink: 0;
  stroke-width: 1.75;
}

.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-accent);
  color: var(--brand-deep);
  flex-shrink: 0;
}

.icon-circle .icon {
  width: 26px;
  height: 26px;
}

.icon-circle--brand {
  background: var(--brand);
  color: var(--text);
}

.icon-circle--accent {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.icon-circle--lg {
  width: 72px;
  height: 72px;
}

.icon-circle--lg .icon {
  width: 32px;
  height: 32px;
}

/* ============================================
   BADGES / PILLS / TAGS
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.35em 0.85em;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  border-radius: var(--r-pill);
  background: var(--bg-accent);
  color: var(--brand-deep);
  line-height: 1;
}

.badge--brand {
  background: var(--brand);
  color: var(--text);
}

.badge--accent {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.badge--outline {
  background: transparent;
  border: 1.5px solid var(--border-strong);
  color: var(--text-muted);
}

.badge--dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition:
    transform var(--t-base) var(--ease-out),
    box-shadow var(--t-base),
    border-color var(--t-base);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-accent);
}

.card__media img,
.card__media svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease-out);
}

.card:hover .card__media img {
  transform: scale(1.04);
}

.card__media-tag {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 2;
}

.card__body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: var(--space-3);
}

.card__title {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: var(--lh-snug);
  color: var(--text);
  margin: 0;
}

.card__desc {
  color: var(--text-muted);
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  margin: 0;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--text-subtle);
}

.card__footer {
  margin-top: auto;
  padding-top: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

/* Card link arrow */
.card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--brand-deep);
}

.card__link .icon {
  width: 18px;
  height: 18px;
  transition: transform var(--t-base) var(--ease-out);
}

.card:hover .card__link .icon {
  transform: translateX(4px);
}

/* Card variants */
.card--ghost {
  background: var(--bg-soft);
  border-color: transparent;
}

.card--accent {
  background: var(--bg-warm);
  border-color: var(--accent-soft);
}

.card--feature {
  background: var(--brand);
  color: var(--text);
  border-color: var(--brand);
}

.card--feature .card__title,
.card--feature .card__desc {
  color: var(--text);
}

/* Service card (no image, icon-driven) */
.card--service {
  padding: var(--space-8);
  gap: var(--space-4);
  text-align: left;
}

.card--service .card__body {
  padding: 0;
}

/* Location card – special layout with map */
.card--location {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.card--location .card__media {
  aspect-ratio: 16 / 9;
}

.card--location .card__title {
  font-size: var(--fs-2xl);
}

/* Sale card (akcija) */
.card--sale {
  border-color: var(--brand-soft);
}

.card--sale .card__media {
  aspect-ratio: 1;
  background: var(--bg-soft);
  padding: var(--space-6);
}

.card--sale .card__media img {
  object-fit: contain;
}

.price {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.price__old {
  font-size: var(--fs-sm);
  color: var(--text-subtle);
  text-decoration: line-through;
}

.price__new {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--brand-deep);
}

.price__discount {
  margin-left: auto;
  background: var(--brand);
  color: var(--text);
  padding: 0.15em 0.5em;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 700;
}

/* ============================================
   STATS
   ============================================ */
.stat {
  text-align: center;
}

.stat__num {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--brand-deep);
  letter-spacing: var(--ls-tight);
}

.stat__label {
  margin-top: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
}

/* ============================================
   FORMS
   ============================================ */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

.form-label .req {
  color: var(--error);
  margin-left: 2px;
}

.form-help {
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  transition:
    border-color var(--t-fast),
    box-shadow var(--t-fast),
    background-color var(--t-fast);
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--brand-dark);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
  background: var(--bg);
}

.textarea {
  resize: vertical;
  min-height: 140px;
  line-height: var(--lh-relaxed);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231F2A14' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.checkbox-group input[type='checkbox'] {
  appearance: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-xs);
  background: var(--bg);
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
}

.checkbox-group input[type='checkbox']:hover {
  border-color: var(--brand-dark);
}

.checkbox-group input[type='checkbox']:checked {
  background: var(--brand);
  border-color: var(--brand);
}

.checkbox-group input[type='checkbox']:checked::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231F2A14' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
}

.checkbox-group label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
  cursor: pointer;
}

.checkbox-group label .req {
  color: var(--error);
  margin-left: 2px;
}

.form-consent-error {
  font-size: var(--fs-sm);
  color: var(--error);
  margin: var(--space-2) 0 0;
}

/* ============================================
   ACCORDION
   ============================================ */
.accordion {
  border-top: 1px solid var(--border);
}

.accordion-item {
  border-bottom: 1px solid var(--border);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: color var(--t-fast);
}

.accordion-trigger:hover {
  color: var(--brand-deep);
}

.accordion-trigger .icon {
  transition: transform var(--t-base);
  flex-shrink: 0;
}

.accordion-item[data-open='true'] .accordion-trigger .icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-slow) var(--ease-out);
}

.accordion-item[data-open='true'] .accordion-content {
  max-height: 1000px;
}

.accordion-content-inner {
  padding-bottom: var(--space-5);
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
}

/* ============================================
   TABS / FILTERS
   ============================================ */
.tabs {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.4rem;
  background: var(--bg-soft);
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
}

.tab {
  padding: 0.55rem 1.2rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab[aria-selected='true'] {
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   TOAST (notification)
   ============================================ */
.toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: var(--text-on-dark);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-xl);
  font-weight: 600;
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  opacity: 0;
  pointer-events: none;
  transition: all var(--t-base) var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast--success { background: var(--brand-deep); }
.toast--error   { background: var(--error); }

/* ============================================
   IMAGE FRAME (decorative)
   ============================================ */
.image-frame {
  position: relative;
  border-radius: var(--r-2xl);
  overflow: hidden;
}

.image-frame--brand::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 2px solid var(--brand);
  border-radius: calc(var(--r-2xl) + 8px);
  opacity: 0.5;
  z-index: -1;
}

.image-frame::after {
  content: '';
  position: absolute;
  bottom: -16px;
  right: -16px;
  width: 80px;
  height: 80px;
  background: var(--brand);
  border-radius: var(--r-lg);
  z-index: -1;
}

/* ============================================
   QUOTE / TESTIMONIAL
   ============================================ */
.quote {
  position: relative;
  padding: var(--space-8);
  background: var(--bg-soft);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
}

.quote__mark {
  font-family: var(--font-heading);
  font-size: 4rem;
  line-height: 0.5;
  color: var(--brand);
  position: absolute;
  top: var(--space-4);
  left: var(--space-6);
  opacity: 0.3;
}

.quote__text {
  font-size: var(--fs-md);
  font-style: italic;
  color: var(--text);
  line-height: var(--lh-relaxed);
  position: relative;
  z-index: 1;
}

.quote__author {
  margin-top: var(--space-4);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color var(--t-fast);
}

.breadcrumb a:hover {
  color: var(--brand-deep);
}

.breadcrumb [aria-current='page'] {
  color: var(--text);
  font-weight: 500;
}

.breadcrumb-sep {
  color: var(--border-strong);
}

/* ============================================
   TIME TABLE (radno vrijeme)
   ============================================ */
.hours {
  display: grid;
  gap: var(--space-2);
}

.hours__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px dashed var(--border);
  gap: var(--space-4);
}

.hours__row:last-child {
  border-bottom: none;
}

.hours__day {
  font-weight: 500;
  color: var(--text);
}

.hours__time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.hours__row.is-today {
  font-weight: 700;
}

.hours__row.is-today .hours__day::before {
  content: '●';
  color: var(--brand);
  margin-right: var(--space-2);
  font-size: 0.7em;
  vertical-align: middle;
}

.hours__row.is-closed .hours__time {
  color: var(--error);
}
