/* Home page specific styles (index.php + featured.php include) */

/* ────────────────────────────────────────────
   10. HERO CAROUSEL
──────────────────────────────────────────── */
/* Edge-to-edge hero (full viewport width; caption stays in .container) */
.hero-carousel {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.hero-carousel .carousel {
  width: 100%;
}

.hero-carousel .carousel-inner {
  overflow: hidden;
  width: 100%;
  /* Visible if a slide's aspect ratio differs slightly */
  background-color: #1a2512;
}

.hero-carousel .carousel-item {
  background-color: #1a2512;
}

/*
 * Full width + full image visible (no cover crop). Height follows 1920x800-style aspect via width.
 * Do not set display on .carousel-item - Bootstrap relies on display:none for inactive slides.
 */
.hero-carousel .carousel-item img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center center;
  margin: 0;
  filter: brightness(0.52);
}

/* Vertical slide transition */
#heroCarousel .carousel-item {
  transition: transform 2.2s cubic-bezier(0.77, 0, 0.18, 1) !important;
}

#heroCarousel .carousel-item-next:not(.carousel-item-start) {
  transform: translateX(0) translateY(100%) !important;
}

#heroCarousel .active.carousel-item-start {
  transform: translateX(0) translateY(-100%) !important;
}

#heroCarousel .carousel-item-next.carousel-item-start,
#heroCarousel .carousel-item-prev.carousel-item-end {
  transform: translateX(0) translateY(0) !important;
}

#heroCarousel .carousel-item-prev:not(.carousel-item-end) {
  transform: translateX(0) translateY(-100%) !important;
}

#heroCarousel .active.carousel-item-end {
  transform: translateX(0) translateY(100%) !important;
}

/* Overlay text */
.hero-caption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}

.hero-caption .container {
  pointer-events: auto;
}

.hero-caption__inner {
  padding-bottom: 0.35rem;
}

.hero-caption__eyebrow {
  font-family: var(--font-topbar);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.65rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.hero-caption__title {
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.42);
  font-size: clamp(1.2rem, 3.6vw, 2.45rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.hero-caption__lead {
  color: rgba(255, 255, 255, 0.93);
  font-size: clamp(0.9rem, 1.85vw, 1.12rem);
  line-height: 1.62;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.38);
  max-width: 36rem;
}

.hero-caption__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.hero-caption__btn-outline {
  border-width: 2px !important;
  border-color: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* Controls */
.carousel-control-prev-icon,
.carousel-control-next-icon {
  background-color: rgba(72, 117, 49, 0.75);
  border-radius: 50%;
  padding: 18px;
  background-size: 55%;
}

.carousel-indicators [data-bs-target] {
  background-color: var(--clr-primary);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  opacity: 1;
}

@media (max-width: 767.98px) {
  .hero-carousel .carousel-item img {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  .hero-caption__title {
    font-size: clamp(0.98rem, 4.2vw, 1.35rem);
    margin-bottom: 0.65rem;
  }

  .hero-caption__eyebrow {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    margin-bottom: 0.45rem;
  }

  .hero-caption__lead {
    font-size: 0.82rem;
    line-height: 1.52;
    display: block;
  }

  .hero-caption__actions {
    margin-top: 0.95rem;
    gap: 0.5rem;
  }

  .hero-caption__actions .btn {
    font-size: 0.8rem;
    padding: 8px 16px;
  }
}

@media (max-width: 480px) {
  .hero-caption__title {
    font-size: clamp(0.9rem, 4vw, 1.18rem);
  }
}

/* Home main - semantic wrapper */
.home-main {
  overflow-x: hidden;
}

.home-section-header {
  max-width: 44rem;
  margin-left: auto;
  margin-right: auto;
}

.home-section-eyebrow {
  font-family: var(--font-topbar);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clr-primary);
  margin-bottom: 0.45rem;
}

.home-section-title {
  margin-bottom: 0.65rem !important;
}

.home-section-lead {
  max-width: 38rem;
  font-size: 0.98rem;
  line-height: 1.68;
}

.home-product-categories {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* ────────────────────────────────────────────
   11. ABOUT SECTION (Home)
──────────────────────────────────────────── */
.about-section {
  padding: 34px 0;
  background: #f8f9fa;
}

.about-section--home {
  padding: 2.75rem 0 3rem;
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.about-home-panel {
  background: linear-gradient(180deg, #f1f4ec 0%, #e6ebe0 55%, #e2e8d9 100%);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem 2.25rem;
  box-shadow:
    0 4px 24px rgba(45, 79, 29, 0.08),
    0 0 0 1px rgba(72, 117, 49, 0.12);
  border-left: 4px solid var(--clr-primary);
}

@media (min-width: 992px) {
  .about-home-panel {
    padding: 2.35rem 2.5rem 2.65rem;
  }

  .about-home-panel--full {
    padding: 2.5rem 2.75rem 2.85rem;
  }
}

.about-home-panel--full .about-home-title {
  max-width: none;
}

.about-home-eyebrow {
  font-family: var(--font-topbar);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clr-primary);
  margin: 0 0 0.65rem;
  opacity: 0.92;
}

.about-home-title {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 700;
  color: var(--clr-dark);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(72, 117, 49, 0.18);
}

.about-home-prose {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.35vw, 1.05rem);
  line-height: 1.82;
  color: #3a4249;
}

.about-home-prose p {
  margin: 0;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  overflow-wrap: break-word;
}

.about-home-cta {
  margin-top: 1.5rem;
  padding: 0.55rem 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

@media (max-width: 991.98px) {
  .about-section--home {
    padding: 2rem 0 2.4rem;
  }
}

/* ────────────────────────────────────────────
   12. CATEGORY GRID
──────────────────────────────────────────── */
.category-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  display: block;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition);
}

.category-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
}

.category-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.category-card:hover img {
  transform: scale(1.08);
}

.category-overlay {
  position: absolute;
  inset: 0;
  background: rgba(72, 117, 49, 0.88);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.category-card:hover .category-overlay {
  opacity: 1;
}

.category-overlay h5 {
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  padding: 0 12px;
}

.explore-btn {
  display: inline-block;
  padding: 8px 22px;
  border: 2px solid #ffffff;
  border-radius: 50px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  background: transparent;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}

.explore-btn:hover {
  background: #ffffff;
  color: var(--clr-primary);
}

.cat-label {
  background: var(--clr-primary);
  text-align: center;
  padding: 10px 12px;
  margin-top: 8px;
  border-radius: var(--radius-sm);
}

.cat-label h6 {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.4px;
  margin-bottom: 0;
}

/* Show overlay on mobile always (can't hover) */
@media (max-width: 767.98px) {
  .category-overlay {
    opacity: 0.85;
    background: rgba(0, 0, 0, 0.45);
  }

  /*
   * Category cards: col-6 col-md-6 col-lg-3
   * 2-per-row on mobile -> card ~= 45vw wide.
   * Category source images are 400x240 (5:3), so ~27vw height preserves ratio.
   * Use 38vw for a slightly taller display that fills the card nicely.
   */
  .category-card img {
    height: 38vw;
    min-height: 130px;
    object-position: center center;
  }
}

/* ────────────────────────────────────────────
   13. TRUST BADGES SECTION
──────────────────────────────────────────── */
.trust-section {
  background: var(--clr-primary);
  color: #ffffff;
  padding: 28px 0;
}

.trust-section .trust-heading {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.trust-section p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.88rem;
  margin-bottom: 0;
}

.trust-box {
  padding: 22px 18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  transition: background var(--transition), transform var(--transition);
}

.trust-box:hover {
  transform: translateY(-6px);
  background: var(--clr-dark);
}

/* ────────────────────────────────────────────
   14. FEATURED PRODUCTS
──────────────────────────────────────────── */
.featured-section {
  background: #f9fafb;
  padding: 34px 0;
}

.featured-section .section-title {
  color: var(--clr-primary);
}

.product-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid #eeeeee;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform var(--transition), box-shadow var(--transition);
  height: 100%;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.product-img {
  position: relative;
  overflow: hidden;
}

.product-img img {
  width: 100%;
  display: block;
  transition: transform 0.45s ease;
  height: 260px;
  object-fit: cover;
  object-position: center center;
}

/*
 * Featured products: col-6 col-md-4 col-lg-3
 * On mobile (< 768px) cards are col-6 (2-per-row).
 * Each card is roughly 45% of viewport width including gutters.
 * Setting height ~= 45vw keeps images near-square (matches 400x400 thumbnails).
 * No max-height cap - let it scale freely so images are never cropped.
 */
@media (max-width: 767.98px) {
  .product-img img {
    height: 45vw;
    min-height: 130px;
  }
}

.product-card:hover .product-img img {
  transform: scale(1.08);
}

.product-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.product-card:hover .product-overlay {
  opacity: 1;
}

.product-body {
  padding: 14px;
  text-align: center;
}

.product-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #222222;
  min-height: 38px;
  line-height: 1.4;
  margin-bottom: 4px;
}

/* ────────────────────────────────────────────
   15. NEWSLETTER
──────────────────────────────────────────── */
.newsletter-section {
  background: var(--clr-primary);
  color: #ffffff;
  padding: 34px 0;
}

.newsletter-section h2 {
  color: #ffffff;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
}

.newsletter-section p {
  color: rgba(255, 255, 255, 0.85);
}

.newsletter-section .form-control {
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.9rem;
}

.newsletter-section .btn-subscribe {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--clr-primary);
  font-weight: 700;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.newsletter-section .btn-subscribe:hover {
  background: var(--clr-dark);
  border-color: var(--clr-dark);
  color: #ffffff;
}
