:root {
  --primary: #f97316;
  /* Uchmatni Oranžová */
  --primary-dark: #ea580c;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --pd-text-secondary: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius-lg: 1.25rem;
  --radius-md: 0.75rem;
  --pd-transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  /* --pd-border: #e2e8f0; */
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  /* --font: 'Inter', system-ui, -apple-system, sans-serif; */
  --pd-accent: var(--orange-500, #f97316);
  --pd-accent-rgb: 249, 115, 22;
  /* Pre potreby priehľadnosti (rgba) */
  --pd-success: #22c55e;
  --pd-danger: #ef4444;
  --pd-border: #e2e8f0;
  --pd-hover-border: #cbd5e1;
  /* Špecifické premenné pre tagy */
  --pd-tag-hover-bg: rgba(var(--pd-accent-rgb), 0.05);
  --pd-tag-disabled-bg: var(--pd-bg-tertiary-light);
}

.app {
  display: block;
}

/* Dark Mode Variables */
body.dark {
  --bg: #020617;
  --surface: #0f172a;
  --text-main: #f1f5f9;
  --pd-text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #1e293b;
  /* --pd-border: #334155; */
}

.menu-row span {
  /* letter-spacing: -0.02em; */
}

/* ============================================
   3. PRODUCT PAGE LAYOUT
============================================ */
.main-detail {
  padding-top: 2rem;
  max-width: var(--app-width);
  margin-inline: auto;
}

/* ============================================
   BREADCRUMB
============================================ */
.breadcrumb {
  margin-bottom: var(--spacing-xl);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 0.5rem;
  padding: 0;
}

.breadcrumb li {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--pd-text-secondary);
}

.breadcrumb a {
  color: inherit;
  opacity: 0.8;
  text-decoration: none;
  transition: var(--pd-transition);
}

.breadcrumb a:hover {
  opacity: 1;
  color: var(--pd-accent);
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 968px) {
  .product-layout {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   4. GALLERY
============================================ */
.main-image-container {
  background: var(--item-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  position: relative;
}

.main-image-container:hover .nav-btn {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.gallery {

  /* img {
    opacity: 0.5;
  } */
  .next-btn {
    right: 1rem;
  }

  .prev-btn {
    left: 1rem;
  }

  .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    background: var(--surface);
    border: 1px solid var(--border);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    opacity: 0;
    transition: var(--pd-transition);
    z-index: 2;
    color: var(--pd-text-primary);
  }
}

#debug button {
  color: var(--text-main);
}

.price-divider {
  border-left: .25rem solid var(--color-border, #e2e8f0);
  /* farba čiary */
  height: 40px;
  /* nastav si výšku podľa potreby */
  align-self: center;
  /* vycentruje čiaru vertikálne */
}

.main-image-container {
  container-type: inline-size;
}

.main-image-container .p-img-wrapper {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  max-height: 70vh;
  margin-inline: auto;
}

@container (width < 600px) {
  .main-image-container .p-img-wrapper {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    max-height: 50vh;
    margin-inline: auto;
  }
}

.main-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.thumbnails {
  display: flex;
  gap: 0.75rem;
}

.thumbnail {
  width: 80px;
  height: 80px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  object-fit: cover;
}

.thumbnail.active {
  border-color: var(--primary);
}

/* ============================================
   5. PRICE & BUY SECTION
============================================ */
.product-title {
  font-size: var(--size-step-4);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: var(--space-l);
  letter-spacing: -0.02em;
}

.product-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: var(--space-l);
}

.product-brand.info {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Price Box */
.details-section-2 {
  background: var(--surface);
  border: .25rem solid var(--border);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  width: 100%;
  justify-content: space-around;
}

.price-text {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--text-muted);
  display: block;
}

.price-vat {
  color: var(--pd-accent, #f97316);
}

.text-6xl {
  font-size: 3rem;
  font-weight: 900;
  color: var(--text-main);
}

.price-section-old .price {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 1.5rem;
}

.price-saved span {
  background: #dcfce7;
  color: #166534;
  padding: 0.2rem 0.5rem;
  border-radius: 0.5rem;
  font-weight: 800;
  font-size: 0.85rem;
  text-wrap: nowrap;
}

/* Tags */
.variant-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.variant-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--pd-bg-white);
  border: 2px solid var(--pd-border);
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pd-text-primary);
  cursor: pointer;
  transition: var(--pd-transition);
  position: relative;
  overflow: hidden;
}

/* 1. Hover efekt LEN pre neaktívne a dostupné tagy */
.variant-tag:not(.disabled):not(.active):hover {
  transform: translateY(-2px);
  border-color: var(--pd-accent);
  background: var(--pd-tag-hover-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 2. Aktívny (vybraný) tag - tento kód tam už máš, len ho nechaj takto */
.variant-tag.active {
  background: var(--pd-accent);
  border-color: var(--pd-accent);
  color: white;
  box-shadow: 0 4px 12px rgba(var(--pd-accent-rgb), 0.3);
}

/* 3. NOVÉ: Hover efekt pre AKTÍVNY tag */
.variant-tag.active:hover {
  transform: translateY(-2px);
  /* Pozadie a farba textu sa nemenia (zostávajú solidné z .active),
     len sa tlačidlo jemne dvihne a tieň sa trochu zosilní pre pekný 3D efekt */
  box-shadow: 0 6px 16px rgba(var(--pd-accent-rgb), 0.4);
}

.variant-tag.active {
  background: var(--pd-accent);
  border-color: var(--pd-accent);
  color: white;
  box-shadow: 0 4px 12px rgba(var(--pd-accent-rgb), 0.3);
}

.variant-tag.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--pd-tag-disabled-bg);
  text-decoration: line-through;
}

/* Tag Icons */
.variant-tag .check-icon,
.variant-tag .x-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.variant-tag.active .check-icon {
  color: white;
  /* Trik na "zhrubnutie" SVG ikony */
  stroke: currentColor;
  stroke-width: 0.125rem;
  /* 0.8px je ideálne, pri 1px+ by už ikona mohla stratiť tvar */
}

.variant-tag:not(.active) .check-icon {
  color: var(--pd-success);
}

.variant-tag .x-icon {
  color: var(--pd-danger);
}

.variant-text {
  font-weight: 600;
  line-height: 1;
}

.quantity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 1rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 0.25rem;
}

.variant-tag.active .quantity-badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* CTA BUTTON */
.redirect-wrapper {
  margin-top: 2rem;
  text-align: center;
}

.redirect-wrapper a {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  text-decoration: none;
  font-weight: 900;
  padding: 1.25rem;
  border-radius: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 10px 20px -5px rgba(249, 115, 22, 0.4);
  transition: transform 0.2s, background 0.2s;

  &.btn-link {
    display: flex;
    gap: 1rem;
  }
}

.redirect-wrapper a:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
}

.redirect-wrapper p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* ============================================
   6. SIMILAR PRODUCTS
============================================ */
/* ============================================
   7. UTILS
============================================ */
.description {
  margin-block: var(--space-l);
  padding: 2rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.description h3 {
  margin-bottom: 1rem;
}

.description.price-text {
  color: var(--pd-text-primary);
}

.price-text {
  display: block;
  font-weight: 900;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--pd-text-tertiary);
  margin-bottom: var(--space-2xs);
}

.spec-text {
  display: block;
  font-weight: 900;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.description p {
  color: var(--pd-text-secondary);
  line-height: 1.625;
  margin-block: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.grid-cols-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.product-specs {
  margin-block: 2rem;

  .desc {
    color: var(--pd-text-primary);
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 700;
  }
}

/* ============================================
   SIMILAR PRODUCTS & FULL WIDTH
============================================ */
/* ============================================
   HORIZONTÁLNY SCROLL PRE PODOBNÉ PRODUKTY
============================================ */
.similar-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 240px;
  gap: 1.5rem;
  padding: 0.5rem 0 1.5rem 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--pd-text-tertiary) transparent;
  width: 100%;
  /* Gradient na okrajoch pre "fade" efekt pri scrollovaní */
  /* Výrazný fade efekt na oboch stranách */
  /* mask-image: linear-gradient(to right,
      transparent 0%,
      rgba(0, 0, 0, 0.15) 5%,
      black 8%,
      black 92%,
      rgba(0, 0, 0, 0.15) 95%,
      transparent 100%);
  -webkit-mask-image: linear-gradient(to right,
      transparent 0%,
      rgba(0, 0, 0, 0.15) 5%,
      black 8%,
      black 92%,
      rgba(0, 0, 0, 0.15) 95%,
      transparent 100%); */
}

.similar-grid::-webkit-scrollbar {
  height: 6px;
}

.similar-grid::-webkit-scrollbar-track {
  background: var(--pd-bg-tertiary-light);
  border-radius: 10px;
}

.similar-grid::-webkit-scrollbar-thumb {
  background: var(--pd-text-tertiary);
  border-radius: 10px;
}

.similar-item {
  scroll-snap-align: start;
  width: 100%;
  background: var(--pd-bg-white);
  border: 1px solid var(--pd-border);
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: var(--pd-transition);
}

.similar-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--pd-shadow);
}

.similar-item img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.similar-item .item-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.similar-item .brand {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--pd-accent);
  text-transform: uppercase;
}

.similar-item .name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--pd-text-secondary);
}

.similar-item .price {
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--pd-text-primary);
}

.section-title {
  margin-block: var(--space-l) var(--space-xs);
}

/* Responzivita */
@media screen and (max-width: 768px) {
  .similar-grid {
    grid-auto-columns: 260px;
    gap: 1rem;
  }

  .redirect-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;

    .btn-link {
      padding: 1.25rem 5rem;
    }
  }
}

/* Poistka proti roztiahnutiu stránky */
.main-detail ~ .similar-products .rollable-container {
  max-width: var(--app-width);
  margin-inline: auto;
}

.full-width-section {
  overflow-x: hidden;
  max-width: min(calc(100vw - 1rem), var(--app-width));
}