/* assets/css/index.css */

/* HERO SECTION – full-width, flush to header */
.home-hero {
  margin-bottom: 0;
  border-radius: 0;
  overflow: hidden;
  position: relative;
  width: 100%;
}

/* 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 */

/* Progress bar (replaces dots) */
.home-hero-progress {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  z-index: 5;
}

.home-hero-progress .hero-bar {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
  position: relative;
}

.home-hero-progress .hero-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--color-primary);
  border-radius: 2px;
  transition: none;
}

@keyframes heroBarFill {
  from { width: 0%; }
  to   { width: 100%; }
}

/* Arrows – no background, just icon */
.home-hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  color: #fff;
  font-size: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.home-hero-arrow:hover {
  color: rgba(255, 255, 255, 0.7);
}

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

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

@media (max-width: 575.98px) {
  .home-hero-arrow {
    display: none;
  }
}

/* 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: 0;
  margin-bottom: 2rem;
  padding: 1.5rem 0 15px;
  overflow: visible;
  background: none;
  border: none;
}

/* background variants — all transparent */
.home-section--bg-light,
.home-section--bg-muted {
  background: none;
  border: none;
}

.home-section--bg-dark {
  background: none;
  color: inherit;
}

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

.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;
}

h1.home-section-title,
h2.home-section-title,
h3.home-section-title,
.home-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

h2.home-section-subtitle,
h3.home-section-subtitle,
h4.home-section-subtitle,
.home-section-subtitle {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-muted);
  margin: 0;
}

.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: 0;
  border: none;
  background-color: #fff;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 1px rgba(0, 0, 0, 0.04);
}

.home-product-card img {
  object-fit: cover;
  width: 100%;
  aspect-ratio: 4/3;
}
.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;
  font-size: 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: 0.95rem;
  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: 18px;
}

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

.home-products-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

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

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

/* progress bar (replaces dots) */
.home-products-dots{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 4px;
  width: 100px;
  height: 3px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.home-products-dots .slider-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.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: 30%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  color: var(--color-text-main);
  font-size: 1.2rem;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
  cursor: pointer;
}
.home-products-arrow:hover{
  color: var(--color-primary);
}
.home-products-arrow:disabled{
  opacity: 0;
  pointer-events: none;
}

.home-products-arrow--prev{ left: -0.5rem; }
.home-products-arrow--next{ right: -0.5rem; }

/* 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 {
    display: flex;
    gap: 2rem;
    justify-content: space-between;
  }

  .home-category-item {
    flex: 1 1 0;
    min-width: 0;
  }
}

.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: scale(1.05);
}

.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: #fff;
  color: var(--color-primary);
  transition: background-color 0.2s, color 0.2s;
  cursor: pointer;
}

/* MOBILE: stack name (full-width) above button. Lock the name to a
   three-line box (line-clamp + matching min-height) so adjacent cards
   in a row always align — short titles get padded up to the same
   box, long titles cap at three lines with ellipsis. */
@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. The single-row
     variant skips these so there's no dead space between title and
     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;
}

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

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

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

.home-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.35s ease;
}

.home-image-item:hover img {
  transform: scale(1.05);
}

@media (min-width: 576px) {
  .home-image-item { height: 260px; }
}

@media (min-width: 768px) {
  .home-image-item { height: auto; aspect-ratio: 1.92 / 1; }
}

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


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

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

  .home-section-subtitle {
    font-size: 1.15rem;
  }

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