/* assets/css/index.css */

/* HERO SECTION */
.home-hero {
  margin-bottom: 2rem;
  border-radius: 1.5rem;
  overflow: hidden;
  position: relative;
}

/* track / slide */
.home-hero-track {
  display: flex;
  transition: transform 0.4s ease;
}

.home-hero-slide {
  flex: 0 0 100%;
  position: relative;
  overflow: hidden;          /* ensures rounded corners clip image */
}

/* ONE source of truth for height (mobile + desktop) */
.home-hero-slide {
  height: 40vh;
  max-height: 330px;
}

/* Desktop can be taller if you want */
@media (min-width: 620px) {
  .home-hero-slide {
    height: 420px;           /* or keep 40vh if you prefer */
    max-height: none;
  }
}

/* Make picture/img fill the slide completely */
.home-hero-slide a,
.home-hero-slide picture,
.home-hero-slide img {
  display: block;
  width: 100%;
  height: 100%;
}

.home-hero-slide img {
  object-fit: cover;
}

/* hero controls */

.home-hero-dots {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4rem;
}

.home-hero-dots .hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(243, 244, 246, 0.8);
}

.home-hero-dots .hero-dot.is-active {
  background: var(--color-ink);
}

.home-hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: rgba(17, 24, 39, 0.5);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.home-hero-arrow--prev {
  left: 0.75rem;
}

.home-hero-arrow--next {
  right: 0.75rem;
}

@media (max-width: 575.98px) {
  .home-hero-arrow {
    display: none; /* keep auto + dots on small screens */
  }
}

/* CATEGORY CARDS */
#popular-categories-grid .category-card {
  height: 100%;
}

#popular-categories-grid .card-body {
  padding: 0.85rem 1rem 1rem;
}

/* PRODUCT GRIDS */
#featured-products-grid .product-card,
#new-arrivals-grid .product-card {
  display: flex;
  flex-direction: column;
}

/* Price styling */
.product-card .card-body p.fw-semibold {
  font-size: 0.95rem;
}

/* RESPONSIVE TWEAKS */
@media (max-width: 767.98px) {
  /*.hero-section {*/
  /*  padding: 1.75rem 1.5rem;*/
  /*}*/

  .hero-section h1.display-6 {
    font-size: 1.75rem;
  }
}



/*// CMS*/

/* assets/css/index.css */

/* ========== GENERIC HOME SECTIONS ========== */

.home-section {
  border-radius: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem 1.25rem 15px;
  overflow: hidden;
}

/* background variants — driven by the shop's colors.css palette so each
   tenant's brand carries through. Fallbacks match the original hardcoded
   values for shops that haven't generated colors.css yet. */
.home-section--bg-light {
  background-color: var(--color-bg-body, #ffffff);
  border: 1px solid var(--color-border, rgba(15, 23, 42, 0.06));
}

.home-section--bg-muted {
  background-color: var(--color-bg-soft, #f3f4f6);
}

.home-section--bg-dark {
  background: var(--color-ink, #111827);
  color: #f9fafb;
}

.home-section--bg-dark .home-section-title,
.home-section--bg-dark .home-section-subtitle {
  color: #f9fafb;
}

.home-section--bg-image {
  background-size: cover;
  background-position: center;
}

/* inner layout */

.home-section-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.home-section-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.home-section-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.home-section-subtitle {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.home-section-link {
  margin-top: 0.25rem;
  font-size: 0.85rem;
}

.home-section-link a {
  text-decoration: none;
  color: var(--color-primary);
}

.home-section-link a:hover {
  text-decoration: underline;
}

/* ========== PRODUCTS: DESKTOP GRID ========== */

.home-products-grid {
  display: none;
}

@media (min-width: 768px) {
  .home-products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }
}

/* Make product cards look nice in grid and slider */
.home-product-card.card {
  border-radius: 1rem;
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.home-product-card img {
  object-fit: cover;
  height: 180px;
}
.home-product-card h6 {
  font-size: 0.85rem;
  line-height: 1.2;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.2em * 2); /* 2 lines */
}
.home-product-card .price-block {
  min-height: calc(1.2em * 2);  /* matches font line-height */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.home-product-card .price-main {
  font-weight: 600;
  /* Fluid sizing scaled to viewport width: every card on the same page
     shares the same calculated size (vw is global), but the price never
     gets too big for narrow viewports / small cards. Floor 16px, ceiling
     22px, scales linearly in between. */
  font-size: clamp(16px, 1.4vw + 8px, 22px);
  color: var(--color-ink);
}

.home-product-card .price-main.is-discounted {
  color: var(--color-primary); /* blue if discounted */
}

.home-product-card .price-old {
  font-size: clamp(12px, 0.8vw + 6px, 15px);
  color: var(--color-muted); opacity: 0.8;
  text-decoration: line-through;
}

/* ========== PRODUCTS: SLIDER (MOBILE + DESKTOP) ========== */

/* we will use slider on both mobile and desktop */
.home-products-slider{
  position: relative;
  overflow: hidden;
  padding-bottom: 28px; /* space for dots INSIDE slider */
}

/* optional: remove the separate grid completely */
.home-products-grid {
  display: none !important;
}

.home-products-track {
  display: flex;
  transition: transform 0.25s ease;
  will-change: transform;
}

.home-products-slide {
  flex: 0 0 100%;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* mobile: 2 */
}

@media (min-width: 768px) {
  .home-products-slide {
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr)); /* desktop: 4 */
  }
}

/* dots (keep yours if identical) */
.home-products-dots{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 4px;
  margin-top: 0;          /* IMPORTANT */
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}

.home-products-dots .slider-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: none;
  background: var(--primary-a35);
  padding: 0;
}

.home-products-dots .slider-dot.is-active {
  width: 18px;
  background: var(--color-primary);
}
.home-products-shell{
  position: relative;
  overflow: visible; /* allow arrows outside */
}

/* slider stays clipped to its own content */
.home-products-slider{
  overflow: hidden;
  position: relative;
}

/* arrows */
.home-products-arrow{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: none;
  color:var(--color-text-main);
  background: var(--color-bg-soft);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
  cursor: pointer;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.08);
}
.home-products-arrow:hover{
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.16),
    0 4px 10px rgba(0, 0, 0, 0.10);
}

.home-products-arrow--prev{ left: -56px; }
.home-products-arrow--next{ right: -56px; }

/* desktop only */
@media (min-width: 768px){
  .home-products-arrow{ display: inline-flex; }
}

/* if your section clips, unclip it */
.home-section{ overflow: visible; }

/* ========== CATEGORIES SECTION ========== */

.home-categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .home-categories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

.home-category-item {
  text-align: center;
}

.home-category-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  gap: 0.6rem;
}

.home-category-img-wrap {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--color-bg-soft);
}

.home-category-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.home-category-link:hover .home-category-img-wrap img {
  transform: none;
}

.home-category-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.home-category-name {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  color: var(--color-ink);
}

.home-category-btn {
  display: inline-block;
  padding: 0.4rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--color-primary);
  border-radius: 0;
  background: transparent;
  color: var(--color-primary);
  transition: background-color 0.2s, color 0.2s;
  cursor: pointer;
}

/* MOBILE: stack name (full-width) above button, and lock the name
   height so adjacent cards in a row are always the same total height
   regardless of how many lines the title wraps to. line-clamp(3)
   caps at three lines, and min-height pads short titles up to the
   same three-line box — pairs in the row visually align. */
@media (max-width: 767.98px) {
  .home-category-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .home-category-name {
    width: 100%;
    text-align: center;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* 3-line min-height + bottom-pinned button are ONLY for the default
     2-col grid where they equalise neighbouring cards in the same row.
     The single-row variant skips these so there's no dead space
     between the title and the button. */
  .home-categories-grid:not(.home-categories-grid--single-row) .home-category-name {
    min-height: calc(1.3em * 3);
  }
  .home-category-btn {
    width: 100%;
    text-align: center;
  }
  .home-categories-grid:not(.home-categories-grid--single-row) .home-category-btn {
    margin-top: auto;
  }

  /* "categories_single" section type — one card per row on mobile. */
  .home-categories-grid--single-row {
    grid-template-columns: 1fr;
  }
}

.home-category-link:hover .home-category-btn {
  background-color: var(--color-primary);
  color: #fff;
}

/* dark / image backgrounds → white button */
.home-section--bg-dark .home-category-btn,
.home-section--bg-image .home-category-btn {
  border-color: #fff;
  color: #fff;
}
.home-section--bg-dark .home-category-link:hover .home-category-btn,
.home-section--bg-image .home-category-link:hover .home-category-btn {
  background-color: #fff;
  color: #111827;
}
.home-section--bg-dark .home-category-name,
.home-section--bg-image .home-category-name {
  color: #f9fafb;
}

/* ========== IMAGES SECTION (SIMPLE GRID) ========== */

.home-images-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.home-image-item {
  border-radius: 1rem;
  overflow: hidden;
  background: var(--color-bg-soft);
  height: 200px;
  width: auto;
}

.home-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* small adjustments */
@media (min-width: 768px) {
  .home-section {
    padding: 1.75rem 1.75rem 15px;
  }

  .home-image-item {
    height: auto;
    aspect-ratio: 1.92 / 1;
    width: auto;
  }

  .home-section-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
  }

  .home-section-title {
    font-size: 1.2rem;
  }

  .home-images-grid{
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}
