/* ============================================
   CSS VARIABLES (BEM-style naming)
   ============================================ */
:root {
  /* Colors */
  --color-brand-green: #367f47;
  --color-brand-blue: #1a75bb;
  --color-text-primary: #333;
  --color-text-inverse: #fff;
  --color-text-muted: #707070;
  --color-bg-white: #fff;
  --color-bg-overlay: rgba(0, 0, 0, 0.4);
  --color-border-light: #d8d7d7;

  /* Spacing */
  --spacing-section: 40px;
  --spacing-card: 20px;
  --spacing-base: 1rem;
  --spacing-small: 0.5rem;

  /* Border Radius */
  --border-radius-base: 12px;
  --border-radius-small: 8px;
  --border-radius-large: 35px;

  /* Heights */
  --section-height-standard: 640px;
  --section-height-hero: 300px;

  /* Shadows */
  --shadow-card: 0 4px 10px rgba(0, 0, 0, 0.1);
  --shadow-elevated: 0 4px 15px rgba(0, 0, 0, 0.4);
  --shadow-carousel: 0 4px 15px rgba(0, 0, 0, 0.2);

  /* Transitions */
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease-in-out;
}
/* ============================================
   UTILITY CLASSES
   ============================================ */
.text--brand-green {
  color: var(--color-brand-green);
}

.text--brand-blue {
  color: var(--color-brand-blue);
}

/* Skip to main content link (accessibility) */
.sr-only:not(:focus):not(:active) {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.sr-only:focus {
  clip: auto;
  clip-path: none;
  height: auto;
  overflow: visible;
  position: absolute;
  width: auto;
  z-index: 9999;
  padding: 10px;
  background: var(--color-brand-green);
  color: var(--color-text-inverse);
  text-decoration: none;
  border-radius: var(--border-radius-small);
  top: 10px;
  left: 10px;
}

/* ============================================
   LAYOUT
   ============================================ */
.section-body {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--spacing-card);
  display: grid;
  gap: var(--spacing-section);
}

/* ============================================
   SHARED COMPONENTS
   ============================================ */

/* Hero Banner */
.hero-banner {
  position: relative;
  min-height: var(--section-height-hero);
  border-radius: var(--border-radius-base);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-text-inverse);
}

.hero-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.hero-banner::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.hero-banner__content {
  position: relative;
  z-index: 3;
  max-width: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--spacing-card) 30px;
}

.hero-banner__title {
  font-size: 58px;
  font-weight: 500;
  line-height: 1;
  margin: 0;
  letter-spacing: 1px;
}

section {
	margin-bottom: 40px;
}

/* Statistics Cards */
.stats-container {
  display: flex;
  justify-content: space-between;
  gap: var(--spacing-card);
  margin-top: 8px;
}

.stats-card {
  flex: 1;
  padding: 15px;
  text-align: center;
}

.stats-card__header {
  margin-bottom: 5px;
}

.stats-card__header_mobile {
  display: none;
}

.stats-card__label {
  font-size: 24px;
  font-weight: 400;
  margin: 0;
  line-height: 1.4;
  text-align: center;
}

.stats-card__value {
  font-size: 60px;
  font-weight: 500;
  line-height: 1.2;
  margin-top: 5px;
}

/* Video Section */
.video-section {
  border-radius: var(--border-radius-base);
  text-align: center;
}

.video-section__wrapper {
  position: relative;
  width: 100%;
  height: 99%;
  overflow: hidden;
  border-radius: var(--border-radius-small);
  box-shadow: var(--shadow-elevated);
}

.video-section__wrapper video {
  width: 101%;
  height: 101%;
  object-fit: cover;
}
/* ============================================
   SHARED COMPONENTS
   ============================================ */

/* Hero Banner */
.hero-banner {
  position: relative;
  min-height: var(--section-height-hero);
  border-radius: var(--border-radius-base);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-text-inverse);
}

.hero-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.hero-banner::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.hero-banner__content {
  position: relative;
  z-index: 3;
  max-width: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--spacing-card) 30px;
}

.hero-banner__title {
  font-size: 58px;
  font-weight: 500;
  line-height: 1;
  margin: 0;
  letter-spacing: 1px;
}

/* Statistics Cards */
.stats-container {
  display: flex;
  justify-content: space-between;
  gap: var(--spacing-card);
  margin-top: 8px;
}

.stats-card {
  flex: 1;
  padding: 15px;
  text-align: center;
}

.stats-card__header {
  margin-bottom: 5px;
}

.stats-card__header_mobile {
  display: none;
}

.stats-card__label {
  font-size: 24px;
  font-weight: 400;
  margin: 0;
  line-height: 1.4;
  text-align: center;
}

.stats-card__value {
  font-size: 60px;
  font-weight: 500;
  line-height: 1.2;
  margin-top: 5px;
}

/* Video Section */
.video-section {
  border-radius: var(--border-radius-base);
  text-align: center;
}

.video-section__wrapper {
  position: relative;
  width: 100%;
  height: 99%;
  overflow: hidden;
  border-radius: var(--border-radius-small);
  box-shadow: var(--shadow-elevated);
}

.video-section__wrapper video {
  width: 101%;
  height: 101%;
  object-fit: cover;
}

/* Service Cards (Half Grid) */
.service-cards {
  display: grid;
  gap: var(--spacing-small);
}

.service-card {
  position: relative;
  background-color: var(--color-bg-white);
  border-radius: var(--border-radius-base);
  box-shadow: var(--shadow-card);
  padding: 3rem 3rem 1rem 3rem;
  display: flex;
  min-height: var(--section-height-standard);
  gap: var(--spacing-card);
  background-size: cover;
  background-position: center;
  box-sizing: border-box;
  text-decoration: none;
  transition: transform var(--transition-base),
	box-shadow var(--transition-base);
}

.service-card:hover {
  box-shadow: var(--shadow-elevated);
}

.service-card__image {
  flex: 4;
  border-radius: var(--border-radius-small);
}

.service-card__content {
  flex: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  padding: 15px 0;
  position: relative;
}

.service-card__content.space-between {
  justify-content: space-between;
  gap: 3rem;
}

.service-card__content p {
  margin: 0;
  color: var(--color-text-inverse);
}

.service-card__title {
  line-height: 80px;
  font-size: 62px;
  font-weight: 500;
}

.service-card__subtitle {
  line-height: 60px;
  font-size: 42px;
  color: var(--color-text-primary);
}

.service-card__footer {
  line-height: 28px;
  font-size: 18px;
}

.service-card__description {
  font-size: 30px;
  font-weight: 300;
  margin-top: 3rem !important;
  line-height: 48px !important;
  text-wrap: pretty;
}

/* Buttons */
.btn {
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
  outline: none;
}

.btn-outline {
  background: var(--color-bg-white);
  border: 2px solid var(--color-text-muted);
  border-radius: var(--border-radius-large);
  width: 290px;
  height: 70px;
  font-size: 30px;
}

.btn-outline:hover {
  background: var(--color-brand-green);
  color: var(--color-text-inverse);
  border-color: var(--color-brand-green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}

.btn-outline:hover a {
  color: var(--color-text-inverse);
}

.btn-outline:focus {
  outline: 3px solid var(--color-brand-green);
  outline-offset: 2px;
}

.btn-outline a {
  text-decoration: none;
  color: var(--color-text-primary);
}

/* Mobile-Only Sections */
.mobile-only {
  display: none;
}

/* Carousel */
.carousel {
  flex: 1;
  height: 100%;
  position: relative;
}

.carousel__container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.carousel__track {
  display: flex;
  height: 100%;
  will-change: transform;
}

/* Modifier for 3-item carousel */
.carousel__track--3-items {
  width: 300%;
  animation: auto-slide-3 7.5s infinite ease-in-out;
}
.carousel__track--3-items .carousel__item {
  width: 33.3333%;
}

/* Modifier for 4-item carousel */
.carousel__track--4-items {
  width: 400%;
  animation: auto-slide-4 10s infinite ease-in-out;
}
.carousel__track--4-items .carousel__item {
  width: 25%;
}

.carousel__container:hover .carousel__track {
  animation-play-state: paused;
}

.carousel__item {
  flex-shrink: 0;
  flex-grow: 0;
  min-height: 100%;
}

.carousel__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel__dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
  align-items: center;
}

.carousel__dot {
  height: 6px;
  width: 6px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: default;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all var(--transition-base);
}

/* Keyframe Animations */
@keyframes auto-slide-3 {
  0%,
  28% {
	transform: translateX(0%);
  }

  33%,
  61% {
	transform: translateX(-33.3333%);
  }

  66%,
  94% {
	transform: translateX(-66.6666%);
  }

  100% {
	transform: translateX(-66.6666%);
  }
}

@keyframes auto-slide-4 {
  0%,
  22% {
	transform: translateX(0%);
  }
  25%,
  47% {
	transform: translateX(-25%);
  }
  50%,
  72% {
	transform: translateX(-50%);
  }
  75%,
  97% {
	transform: translateX(-75%);
  }
  100% {
	transform: translateX(-75%);
  }
}

/* ============================================
   RESPONSIVE: TABLET (<= 1024px)
   ============================================ */
@media (max-width: 1024px) {
  .hero-banner {
	height: 350px;
  }

  .hero-banner__title {
	font-size: 32px;
  }

  .stats-container {
	gap: 10px;
  }

  .stats-card__label {
	font-size: 1.1rem;
  }

  .stats-card__value {
	font-size: 3rem;
  }

  .service-card {
	padding: 1rem 2rem;
  }

  .service-card__title {
	font-size: 6vw;
	line-height: unset !important;
  }

  .service-card__subtitle {
	font-size: 4vw;
	line-height: unset !important;
  }

  .service-card__description {
	font-size: 3vw;
	line-height: unset !important;
	margin-top: 0 !important;
  }

  h2 {
	font-size: 1.8rem;
  }

  .stats-card__header .stats-card__label {
	display: none;
  }
  .stats-card__header_mobile {
	display: block !important;
  }
}

/* ============================================
   RESPONSIVE: MOBILE (<= 768px)
   ============================================ */
@media (max-width: 768px) {
  .container {
	padding: 0;
	gap: 10px;
  }

  .hero-banner {
	height: auto;
	padding: 30px 0;
	border-radius: 0;
  }

  .hero-banner__title {
	font-size: 32px;
	margin-bottom: var(--spacing-card);
  }

  .stats-container {
	flex-direction: column;
	gap: 15px;
	padding: 0 10px;
  }

  .stats-card {
	padding: 0;
	text-align: left;
  }

  .stats-card__header {
	justify-content: center;
	display: flex;
	flex-wrap: nowrap;
	margin-bottom: 5px;
  }

  .stats-card__label {
	font-size: 18px;
  }

  .stats-card__value {
	font-size: 42px;
	line-height: 1.1;
  }

  .video-section__wrapper {
	border-radius: 0;
  }

  .service-card {
	/* flex-direction: column; */
	min-height: auto;
	height: 390px;
	border-radius: 0;
	padding: 10px 20px;
  }

  .service-card__image {
	display: none;
  }

  .service-card__content {
	flex: unset;
	align-items: center;
	text-align: center;
	padding: 0;
	height: 100%;
	width: 100%;
  }

  .service-card__title {
	font-size: 28px;
  }

  .service-card__subtitle {
	font-size: 18px;
  }

  .service-card__footer {
	line-height: 20px;
	font-size: 10px;
  }

  .service-card__description {
	font-size: 14px;
	margin-top: 0 !important;
  }

  .mobile-only {
	display: block;
  }

  .btn-outline {
	width: 180px;
	height: 40px;
	font-size: 16px;
	margin: auto;
  }

  .carousel__container {
	height: 35rem;
	/* Properties for manual scrolling have been removed. */
	/* The auto-slide animation from the desktop styles will now apply. */
  }

  .carousel__container::-webkit-scrollbar {
	display: none;
  }

  /*
	The conflicting rules for .carousel__track and .carousel__item
	have been removed. The desktop's animation-based styles will now
	cascade down and apply correctly on mobile.
  */

  h2 {
	font-size: 1.5rem;
  }

  /* Correct the pause behavior on touch (which triggers hover on mobile) */
  .carousel:hover .carousel__track,
  .carousel__container:hover .carousel__track,
  .carousel:hover .carousel__dot,
  .carousel__container:hover .carousel__dot {
	animation-play-state: paused;
  }

  /* Ensure the image within the item fills the container */
  .carousel__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
  }
}

/* ============================================
   CIRCULAR ECONOMY PAGE (index.html)
   ============================================ */

/* Hero Banner - Circular Economy */
.hero-banner--circular::before {
  background-image: url("../images/Desktop/1-baner.jpg");
}

/* Introduction Section */
.intro-section {
  position: relative;
  min-height: 400px;
  height: auto;
  border-radius: var(--border-radius-base);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-text-inverse);
}

.intro-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("../images/Desktop/2-Introduction.jpg");
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.intro-section__content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  padding: 70px;
  gap: var(--spacing-card);
}

.intro-section__title {
  font-size: 50px;
  font-weight: 400;
  line-height: 68px;
  margin: 0;
  letter-spacing: 1px;
}

.intro-section__description {
  font-size: 34px;
  font-weight: 300;
  line-height: 1.4;
  margin: 0 0 10px 0;
  letter-spacing: 1px;
}

/* Circularity Grid */
.circularity-grid {
  display: grid;
  grid-template-columns: 0.5fr 1fr 0.5fr;
}

.circularity-grid__side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.circularity-grid__center {
  justify-content: center;
  display: grid;
  align-items: center;
}

.circularity-grid__center img {
  width: 555px;
  height: 565.33px;
}

.circularity-item {
  text-align: center;
}

.circularity-item img {
  width: 100px;
}

.circularity-item__title {
  color: var(--color-brand-green);
  margin: 0;
  font-size: 24px;
}

.circularity-item__description {
  font-size: 18px;
  margin: 0;
  color: #525255;
}

/* Service Card Variants - Circular Economy */
.service-card--repair {
  background-image: url("../images/Desktop/5-Repair-Service.jpg");
}

.service-card--tradein {
  background-image: url("../images/Desktop/6-Trade-in.jpg");
}

.service-card--waste {
  background-image: url("../images/Desktop/7-Waste-management.jpg");
}

.service-card--circular-products {
  background-image: url("../images/Desktop/8-Circular-products.jpg");
}

/* ============================================
   RESPONSIVE: TABLET (<= 1024px)
   ============================================ */
@media (max-width: 1024px) {
  .intro-section__title {
    font-size: 2.5rem;
    line-height: 1.3;
  }

  .intro-section__description {
    font-size: 1.5rem;
  }

  .circularity-grid__center img {
    width: 390px;
    height: auto;
  }
}

/* ============================================
   RESPONSIVE: MOBILE (<= 768px)
   ============================================ */
@media (max-width: 768px) {
  .hero-banner--circular::before {
    background-image: url("../images/Mobile/01-Hp-Net--zero.jpg");
  }

  .intro-section {
    min-height: auto;
    height: auto;
    padding: 30px 0;
    border-radius: 0;
  }

  .intro-section::before {
    background-image: url("../images/Mobile/02-โฮมโปร-เป็นผู้ค้าปลีก.jpg");
  }

  .intro-section__content {
    padding: 0 20px;
  }

  .intro-section__title {
    font-size: 23px;
  }

  .intro-section__description {
    font-size: 16px;
    line-height: 30px;
  }

  .circularity-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-base);
    padding: 2rem;
  }

  .circularity-grid__side--1 {
    order: 1;
    gap: var(--spacing-base);
  }

  .circularity-grid__side--2 {
    order: 0;
    gap: var(--spacing-base);
  }

  .circularity-grid__center {
    order: -1;
  }

  .circularity-item {
    display: flex;
    text-align: left;
    gap: 1.5rem;
    align-items: start;
  }

  .circularity-item img {
    width: 55px;
  }

  .circularity-item__title {
    font-size: 18px;
  }

  .circularity-item__description {
    font-size: 14px;
  }

  .circularity-grid__center img {
    width: 100%;
    height: auto;
  }

  .service-card--repair {
    background-image: url("../images/Mobile/05-repair-service.jpg");
  }

  .service-card--tradein {
    background-image: url("../images/Mobile/06-trade-in.jpg");
  }

  .service-card--waste {
    background-image: url("../images/Mobile/07-waste-management.jpg");
  }

  .service-card--circular-products {
    background-image: url("../images/Mobile/08-circular-products.jpg");
  }
}
