/**
 * Skeleton Loaders — Perceived performance boost
 * Shimmer placeholders for banners, category sliders, product lists
 *
 * Two reveal modes:
 *   .skeleton-content   — wrapper fade (banners, cat-slider)
 *   .skeleton-item      — per-item fade (product lists, direct grid children)
 *
 * JS adds .skeleton-section--loaded to trigger transition
 */

/* ── Section wrapper ── */
.skeleton-section {
  position: relative;
  min-height: 80px;
}

.skeleton-section--loaded .skeleton-placeholder {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Mode A: wrapper fade (banners, cat-slider) */
.skeleton-section--loaded .skeleton-content {
  opacity: 1;
  transition: opacity 0.4s ease 0.15s;
}

/* Mode B: per-item fade (product lists — grid-safe, targets product-miniature directly) */
.skeleton-section .product-miniature {
  opacity: 0;
}

.skeleton-section--loaded .product-miniature {
  opacity: 1;
  transition: opacity 0.4s ease 0.15s;
}

/* ── Placeholder container ── */
.skeleton-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  gap: 1rem;
  pointer-events: none;
}

/* ── Real content wrapper (Mode A) ── */
.skeleton-content {
  opacity: 0;
}

/* ── Shimmer animation ── */
@keyframes skeleton-shimmer {
  0% {
    background-position: -400px 0;
  }
  100% {
    background-position: 400px 0;
  }
}

.skeleton-shimmer {
  background: linear-gradient(
    90deg,
    var(--bs-tertiary-bg, #e9ecef) 25%,
    var(--bs-body-bg, #f8f9fa) 50%,
    var(--bs-tertiary-bg, #e9ecef) 75%
  );
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--bs-border-radius, 0.5rem);
}

/* ═══════════════════════════════════════════
   BANNERS SKELETON — 3-col grid layout
   ═══════════════════════════════════════════ */
.skeleton-banners {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 1rem;
  width: 100%;
}

@media (max-width: 991.98px) {
  .skeleton-banners {
    grid-template-columns: 1fr 1.2fr;
  }
}

@media (max-width: 575.98px) {
  .skeleton-banners {
    grid-template-columns: 1fr;
  }
}

.skeleton-banners__col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skeleton-banners__card {
  min-height: 200px;
  border-radius: var(--bs-border-radius, 0.5rem);
}

.skeleton-banners__card--big {
  min-height: 100%;
  flex: 1;
}

/* ═══════════════════════════════════════════
   CATEGORY SLIDER SKELETON — horizontal row
   ═══════════════════════════════════════════ */
.skeleton-cat-slider {
  display: flex;
  gap: 1.25rem;
  overflow: hidden;
  width: 100%;
}

.skeleton-cat-slider__item {
  flex: 0 0 calc(20% - 1rem); /* 5 per row */
  min-width: 100px;
  aspect-ratio: 1 / 1;
  border-radius: var(--bs-border-radius, 0.5rem);
}

@media (max-width: 991.98px) {
  .skeleton-cat-slider__item {
    flex: 0 0 calc(25% - 1rem); /* 4 per row */
  }
}

@media (max-width: 575.98px) {
  .skeleton-cat-slider__item {
    flex: 0 0 calc(33.333% - 0.85rem); /* 3 per row */
  }
}

/* ═══════════════════════════════════════════
   PRODUCT LIST SKELETON — grid of cards
   ═══════════════════════════════════════════ */
.skeleton-products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  width: 100%;
}

@media (max-width: 991.98px) {
  .skeleton-products {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767.98px) {
  .skeleton-products {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575.98px) {
  .skeleton-products {
    grid-template-columns: 1fr;
  }
}

.skeleton-product-card {
  display: flex;
  flex-direction: column;
  background: var(--bs-body-bg, #fff);
  border-radius: var(--bs-border-radius, 0.5rem);
  overflow: hidden;
}

.skeleton-product-card__image {
  aspect-ratio: 1 / 1;
  border-radius: var(--bs-border-radius, 0.5rem) var(--bs-border-radius, 0.5rem) 0 0;
}

.skeleton-product-card__body {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skeleton-product-card__title {
  height: 1rem;
  width: 85%;
  border-radius: 4px;
}

.skeleton-product-card__price {
  height: 1.1rem;
  width: 40%;
  border-radius: 4px;
}

.skeleton-product-card__btn {
  height: 2.25rem;
  width: 100%;
  margin-top: 0.25rem;
  border-radius: var(--bs-border-radius, 0.5rem);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .skeleton-shimmer {
    animation: none;
    background: var(--bs-tertiary-bg, #e9ecef);
  }

  .skeleton-section--loaded .skeleton-placeholder,
  .skeleton-section--loaded .skeleton-content {
    transition: none;
  }
}

/* ═══════════════════════════════════════════
   CAT-SLIDER FIX — horizontal scroll instead of grid wrap
   Overrides theme.css grid behavior with flex no-wrap + scroll
   ═══════════════════════════════════════════ */
.cat-slider__track {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 20px;
  overflow-x: auto !important;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  /* Hide scrollbar — clean look */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cat-slider__track::-webkit-scrollbar {
  display: none;
}

.cat-slider__item {
  flex: 0 0 calc(20% - 16px); /* 5 per row */
  min-width: 100px;
  scroll-snap-align: start;
}

@media (max-width: 1199.98px) {
  .cat-slider__item {
    flex: 0 0 calc(25% - 15px); /* 4 per row */
  }
}

@media (max-width: 991.98px) {
  .cat-slider__item {
    flex: 0 0 calc(33.333% - 14px); /* 3 per row */
  }
}

@media (max-width: 767.98px) {
  .cat-slider__track {
    gap: 10px;
  }

  .cat-slider__item {
    flex: 0 0 calc(33.333% - 7px); /* 3 per row visible */
    min-width: 90px;
  }
}

@media (max-width: 575.98px) {
  .cat-slider__item {
    flex: 0 0 calc(50% - 5px); /* 2 per row visible */
  }
}

/* ═══════════════════════════════════════════
   PRODUCT SLIDER — „Naujausi Pasiūlymai"
   Horizontal scroll row with arrow nav
   ═══════════════════════════════════════════ */
.product-slider {
  margin: 2.5rem auto;
}

.product-slider__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.product-slider__all-link {
  font-size: 0.8rem;
  flex-basis: 100%;
  width: 100%;
  margin-top: -0.25rem;
}

.product-slider__title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #000;
  margin: 0;
  flex-shrink: 0;
}

.product-slider__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  flex-shrink: 0;
}
.product-slider__all-link {
  font-size: 0.8rem;
  flex-basis: 100%;
  width: 100%;
}

.product-slider__arrows {
  display: flex;
  gap: 0.5rem;
}

.product-slider__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--bs-border-color);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  color: var(--bs-body-color);
  transition: all 0.15s ease;
}

.product-slider__arrow:hover {
  background: #7A9E7E;
  color: #fff;
  border-color: #7A9E7E;
}

.product-slider__arrow:disabled {
  opacity: 0.3;
  cursor: default;
  background: #fff;
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
}

.product-slider__all-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #7A9E7E;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.product-slider__all-link:hover {
  color: #5e8062;
  text-decoration: underline;
}

.product-slider__all-link .material-icons {
  font-size: 1rem;
}

/* ── Track: horizontal flex scroll ── */
.product-slider__track {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 1rem;
  overflow-x: auto !important;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0;
  scroll-padding: 0;
}

.product-slider__track::-webkit-scrollbar { display: none; }

/* ── Each product card in the slider ── */
.product-slider__track .product-miniature {
  flex: 0 0 calc(25% - 0.75rem);
  min-width: 220px;
  scroll-snap-align: start;
}

@media (max-width: 991.98px) {
  .product-slider__track .product-miniature {
    flex: 0 0 calc(33.333% - 0.7rem);
    min-width: 180px;
  }
}

@media (max-width: 767.98px) {
  .product-slider__track .product-miniature {
    flex: 0 0 calc(50% - 0.5rem);
    min-width: 150px;
    scroll-snap-align: center;
  }
}

@media (max-width: 575.98px) {
  .product-slider__track {
    gap: 0.75rem;
    scroll-snap-type: x mandatory;
  }
  .product-slider__track .product-miniature {
    flex: 0 0 85vw;
    min-width: auto;
    max-width: 320px;
    scroll-snap-align: center;
  }
}

/* ═══════════════════════════════════════════
   CATEGORY SHOWCASE
   ═══════════════════════════════════════════ */
.showcase-row { margin: 2.5rem auto; }
.showcase-row__header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.showcase-row__all-link { font-size: 0.8rem; flex-basis: 100%; width: 100%; margin-top: -0.25rem; }
.showcase-row__title { font-size: 1.4rem; font-weight: 700; color: #000; margin: 0; }
.showcase-row__all-link { font-size: 0.85rem; font-weight: 600; color: #7A9E7E; display: inline-flex; align-items: center; gap: 0.25rem; }
.showcase-row__all-link:hover { color: #5e8062; }
.showcase-row__body { display: flex; gap: 1.5rem; align-items: stretch; overflow: hidden; }
.showcase-row__body--banner-left { flex-direction: row; }
.showcase-row__body--banner-right { flex-direction: row-reverse; }
.showcase-row__banner { flex: 0 0 25%; min-width: 240px; position: relative; border-radius: var(--bs-border-radius); overflow: hidden; min-height: 300px; align-self: stretch; }
.showcase-row__banner-bg { position: absolute; inset: 0; background-size: cover; background-position: center; background-color: var(--bs-tertiary-bg); background-repeat: no-repeat; }
.showcase-row__banner-content { position: relative; z-index: 1; padding: 1.5rem; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.showcase-row__banner-subtitle { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: #7A9E7E; margin-bottom: 0.25rem; }
.showcase-row__banner-title { font-size: 1.5rem; font-weight: 700; color: #fff; margin: 0 0 0.5rem; line-height: 1.2; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.showcase-row__banner-desc { font-size: 0.85rem; color: rgba(255,255,255,0.85); margin: 0 0 1rem; }
.showcase-row__banner-btn { display: inline-block; padding: 0.4rem 1.25rem; font-size: 0.8rem; font-weight: 600; color: #fff; background: #7A9E7E; border-radius: 5px; text-decoration: none; align-self: flex-start; }
.showcase-row__banner-btn:hover { background: #212529; color: #fff; }
/* ── Prevent body horizontal scroll from sliders ── */
body { overflow-x: hidden; }
.showcase-row__slider { flex: 1; min-width: 0; position: relative; overflow: hidden; }
.showcase-row__slider-track { display: flex; gap: 1rem; overflow-x: auto; scroll-behavior: smooth; scroll-snap-type: x mandatory; scrollbar-width: none; }
.showcase-row__slider-track::-webkit-scrollbar { display: none; }
.showcase-row__slider-track .product-miniature { flex: 0 0 calc(25% - 0.75rem); min-width: 180px; scroll-snap-align: start; }
.showcase-row__arrows { display: flex; gap: 0.5rem; }
.showcase-row__arrow { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--bs-border-color); border-radius: 50%; background: #fff; cursor: pointer; }
.showcase-row__arrow:hover { background: #7A9E7E; color: #fff; border-color: #7A9E7E; }
.showcase-row__arrow:disabled { opacity: 0.3; cursor: default; }
@media (max-width: 991.98px) {
  .showcase-row__body { flex-direction: column !important; }
  .showcase-row__banner { flex: 0 0 auto; min-height: 200px; }
  .showcase-row__slider-track .product-miniature { flex: 0 0 calc(33.333% - 0.7rem); }
}
@media (max-width: 767.98px) {
  .showcase-row__slider-track .product-miniature { flex: 0 0 calc(50% - 0.5rem); scroll-snap-align: center; }
}
@media (max-width: 575.98px) {
  .showcase-row__slider-track .product-miniature { flex: 0 0 85vw; max-width: 320px; scroll-snap-align: center; }
}

/* ═══════════════════════════════════════════
   MOBILE BANNERS → horizontal slider
   ═══════════════════════════════════════════ */
@media (max-width: 767.98px) {
  .home-banners__grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .home-banners__grid::-webkit-scrollbar { display: none; }
  .home-banners__col {
    flex: 0 0 85vw;
    max-width: 400px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  .home-banners__card {
    min-height: 200px;
  }
  .home-banners__card--big {
    min-height: 200px !important;
    flex: 1;
  }
}

/* ═══════════════════════════════════════════
   VIEWED PRODUCTS — horizontal slider
   ═══════════════════════════════════════════ */
.viewed-slider { margin:2rem auto; }
.viewed-slider__header {
  display:flex; align-items:center; justify-content:space-between; margin-bottom:1rem;
}
.viewed-slider__arrows { display:flex; gap:8px; }
.viewed-slider__arrow {
  display:flex; align-items:center; justify-content:center;
  width:36px; height:36px; border:1px solid var(--bs-border-color);
  border-radius:50%; background:#fff; cursor:pointer;
  transition:all .15s ease; color:var(--bs-body-color);
}
.viewed-slider__arrow:hover { background:#7A9E7E; color:#fff; border-color:#7A9E7E; }
.viewed-slider__arrow .material-icons { font-size:20px; }
.viewed-slider__track {
  display:flex; gap:16px; overflow-x:auto;
  scroll-behavior:smooth; scroll-snap-type:x mandatory;
  scrollbar-width:none; padding-bottom:4px;
}
.viewed-slider__track::-webkit-scrollbar { display:none; }
.viewed-slider__item {
  flex:0 0 220px; scroll-snap-align:start; scroll-snap-stop:always;
}

@media (max-width: 575.98px) {
  .viewed-slider__item { flex:0 0 75vw; }
}

/* ═══════════════════════════════════════════
   CATEGORY PRODUCTS — horizontal slider with arrows
   ═══════════════════════════════════════════ */
.catprod-slider { margin:2rem auto; }
.catprod-slider__header {
  display:flex; align-items:center; justify-content:space-between; margin-bottom:1rem;
}
.catprod-slider__arrows { display:flex; gap:8px; }
.catprod-slider__arrow {
  display:flex; align-items:center; justify-content:center;
  width:36px; height:36px; border:1px solid var(--bs-border-color);
  border-radius:50%; background:#fff; cursor:pointer;
  transition:all .15s ease; color:var(--bs-body-color);
}
.catprod-slider__arrow:hover { background:#7A9E7E; color:#fff; border-color:#7A9E7E; }
.catprod-slider__arrow .material-icons { font-size:20px; }
.catprod-slider__track {
  display:flex; gap:16px; overflow-x:auto;
  scroll-behavior:smooth; scroll-snap-type:x mandatory;
  scrollbar-width:none; padding-bottom:4px;
}
.catprod-slider__track::-webkit-scrollbar { display:none; }
.catprod-slider__item {
  flex:0 0 220px; scroll-snap-align:start; scroll-snap-stop:always;
}

@media (max-width: 575.98px) {
  .catprod-slider__item { flex:0 0 75vw; }
}

@media (max-width: 767.98px) {
  .cat-slider__track {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 0;
  }
  .cat-slider__track::-webkit-scrollbar { display: none; }
  .cat-slider__item {
    flex: 0 0 42vw;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
}
