/* =============================================
   HOME PAGE STYLES
   ============================================= */

/* ---- Hero Banner Slider ---- */
.hero-slider {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  background: var(--primary-xlight);
}
.hero-slider__track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.hero-slide {
  min-width: 100%;
  position: relative;
  aspect-ratio: 16/5;
  overflow: hidden;
}
@media (max-width: 767px) { .hero-slide { aspect-ratio: 16/7; } }

.hero-slide__bg {
  width: 100%; height: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #5BA4F5 100%);
}
.hero-slide__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-xl) var(--space-2xl);
  color: var(--white);
}
.hero-slide__tag {
  font-size: 12px;
  font-weight: 600;
  background: var(--accent);
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-sm);
  width: fit-content;
}
.hero-slide__title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--white);
  margin-bottom: var(--space-sm);
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.hero-slide__subtitle {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: var(--space-lg);
}
.hero-slide__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  color: var(--primary);
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 14px;
  width: fit-content;
  transition: all var(--trans-fast);
  box-shadow: var(--shadow-md);
}
.hero-slide__cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

@media (max-width: 767px) {
  .hero-slide__content { padding: var(--space-md); }
  .hero-slide__title { font-size: 20px; }
  .hero-slide__subtitle { font-size: 13px; display: none; }
  .hero-slide__cta { font-size: 13px; padding: 8px 18px; }
}

/* Slider controls */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--primary);
  z-index: 10;
  transition: all var(--trans-fast);
  box-shadow: var(--shadow-md);
  border: none;
}
.slider-btn:hover { background: var(--white); }
.slider-btn--prev { left: var(--space-md); }
.slider-btn--next { right: var(--space-md); }
@media (max-width: 767px) {
  .slider-btn { width: 32px; height: 32px; font-size: 14px; }
}

.slider-dots {
  position: absolute;
  bottom: var(--space-sm);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.slider-dot {
  width: 8px; height: 8px;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--trans-fast);
}
.slider-dot.active { background: var(--white); width: 20px; border-radius: 4px; }

/* ---- Flash Sale Banner ---- */
.flash-sale-bar {
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: var(--space-sm) 0;
}
.flash-sale-bar .container {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.flash-sale-bar__label {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}
.flash-sale-bar__label .fire { font-size: 20px; animation: flicker 1s ease-in-out infinite alternate; }
@keyframes flicker { from { transform: scale(1); } to { transform: scale(1.15) rotate(5deg); } }

.countdown {
  display: flex;
  align-items: center;
  gap: 4px;
}
.countdown__unit {
  background: var(--white);
  color: var(--primary);
  font-size: 16px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  min-width: 32px;
  text-align: center;
}
.countdown__sep { font-size: 16px; font-weight: 700; }

/* ---- Home Content Sections ---- */
.home-section {
  margin-bottom: var(--space-md);
}

/* ---- Flash Sale Products Row ---- */
.flash-products {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.flash-products::-webkit-scrollbar { display: none; }
.flash-product-card {
  flex-shrink: 0;
  width: 160px;
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--trans-base);
  box-shadow: var(--shadow-sm);
}
.flash-product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
@media (max-width: 767px) { .flash-product-card { width: 130px; } }

.flash-product-card__img {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--gray-100);
  position: relative;
}
.flash-product-card__img img { width: 100%; height: 100%; object-fit: cover; }
.flash-product-card__discount {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to right, var(--accent), var(--primary));
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 3px;
}
.flash-product-card__body { padding: 8px; }
.flash-product-card__price {
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
}
.flash-product-card__orig {
  color: var(--gray-400);
  font-size: 11px;
  text-decoration: line-through;
}
.flash-product-card__progress {
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.flash-product-card__progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--accent), var(--primary));
  border-radius: 2px;
  transition: width 1s ease;
}

/* ---- Category Grid ---- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: var(--space-sm);
}
@media (max-width: 991px)  { .category-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 767px)  { .category-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 479px)  { .category-grid { grid-template-columns: repeat(4, 1fr); } }

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm);
  background: var(--white);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--trans-base);
  text-align: center;
  border: 2px solid transparent;
  text-decoration: none;
}
.category-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.category-card__icon {
  font-size: 32px;
  line-height: 1;
  transition: transform var(--trans-base);
}
.category-card:hover .category-card__icon { transform: scale(1.15); }
.category-card__name {
  font-size: 11px;
  color: var(--gray-800);
  font-weight: 500;
  line-height: 1.3;
}
@media (max-width: 767px) {
  .category-card__icon { font-size: 26px; }
  .category-card__name { font-size: 10px; }
}

/* ---- New Category Image Grid (image-card style) ---- */
.cat-image-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-md);
}
@media (max-width: 991px) { .cat-image-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 599px) { .cat-image-grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-sm); } }

.cat-image-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--gray-100);
  cursor: pointer;
  transition: all var(--trans-base);
  text-decoration: none;
}
.cat-image-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.cat-image-card__img {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.cat-image-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--trans-slow);
}
.cat-image-card:hover .cat-image-card__img img { transform: scale(1.06); }
.cat-image-card__emoji {
  font-size: 52px;
  line-height: 1;
  transition: transform var(--trans-base);
}
.cat-image-card:hover .cat-image-card__emoji { transform: scale(1.15); }
.cat-image-card__name {
  padding: 10px var(--space-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-800);
  text-align: center;
  line-height: 1.4;
  border-top: 1px solid var(--gray-100);
  transition: color var(--trans-fast);
}
.cat-image-card:hover .cat-image-card__name { color: var(--primary); }
@media (max-width: 599px) {
  .cat-image-card__emoji { font-size: 36px; }
  .cat-image-card__name { font-size: 10px; padding: 7px var(--space-xs); }
}
.banner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}
@media (max-width: 479px) { .banner-grid { grid-template-columns: 1fr; } }
.banner-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 2/1;
  position: relative;
  cursor: pointer;
}
.banner-item img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--trans-slow); }
.banner-item:hover img { transform: scale(1.04); }
.banner-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(26,80,160,0.7) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-md);
}
.banner-item__title { color: var(--white); font-size: 16px; font-weight: 700; }
.banner-item__subtitle { color: rgba(255,255,255,0.85); font-size: 12px; }

/* ---- Recommended Section ---- */
.recommended-section {
  background: var(--gray-100);
  padding: var(--space-md) 0;
}
.recommended-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: var(--space-md);
  overflow-x: auto;
  scrollbar-width: none;
}
.recommended-tabs::-webkit-scrollbar { display: none; }
.rec-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--trans-fast);
}
.rec-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.rec-tab:hover { color: var(--primary); }

/* ---- Promo Widgets Row ---- */
.promo-widgets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
@media (max-width: 767px) { .promo-widgets { grid-template-columns: repeat(2, 1fr); } }
.promo-widget {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  transition: all var(--trans-base);
  box-shadow: var(--shadow-sm);
}
.promo-widget:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.promo-widget:nth-child(2) { background: linear-gradient(135deg, #0A7B5E 0%, #14B890 100%); }
.promo-widget:nth-child(3) { background: linear-gradient(135deg, #7B1FA2 0%, #AB47BC 100%); }
.promo-widget:nth-child(4) { background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%); }
.promo-widget__icon { font-size: 28px; }
.promo-widget__text { flex: 1; }
.promo-widget__title { font-size: 13px; font-weight: 700; }
.promo-widget__desc { font-size: 11px; opacity: 0.85; }
