/*
 ═══════════════════════════════════════════════════════
  Gadget Store — Homepage Stylesheet
  Covers: hero slider, categories, product cards,
          promo banner
  Pages:  home.html only
 ═══════════════════════════════════════════════════════
*/

/* ════════════════════════════════════════════════════
   A. HERO SLIDER
   ════════════════════════════════════════════════════ */

.gs-slider {
  position: relative;
  border-bottom: 1px solid var(--border);
  min-height: 320px;
  max-width: 100%;
  overflow: hidden;
}

/* ── Progress bar ── */
.gs-slider-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  z-index: 10;
  overflow: hidden;
}
.gs-slider-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: none;
}

/* ── Slide stacking ── */
.gs-hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(48px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
  will-change: opacity, transform;
}
.gs-hero-slide.gs-slide-active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
.gs-hero-slide.gs-slide-exit {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(-48px);
  pointer-events: none;
}

/* ── Content side ── */
.gs-slide-content {
  padding: 52px 40px 44px max(40px, calc((100vw - 1280px) / 2 + 48px));
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.gs-slide-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 18px;
  width: fit-content;
}
.gs-slide-h1 {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: clamp(26px, 3.2vw, 46px);
  line-height: 1.04;
  letter-spacing: -1.8px;
  color: var(--text);
  margin-bottom: 14px;
  transition: color var(--tg-transition);
}
.gs-slide-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 300;
  max-width: 400px;
  margin-bottom: 28px;
}
.gs-slide-ctas {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Visual side ── */
.gs-slide-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px max(40px, calc((100vw - 1280px) / 2 + 48px)) 28px 24px;
}

/* ── Product card in visual ── */
.gs-hero-slide .gs-product-card {
  max-width: 275px;
}

.gs-slide-product-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 22px;
  padding: 20px 18px 18px;
  width: 230px;
  text-align: center;
  box-shadow: 0 20px 60px var(--shadow);
}
.gs-slide-product-card .gs-product-name {
  font-family: "Syne", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.3;
}
.gs-slide-product-card .gs-product-price {
  font-family: "Syne", sans-serif;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}
.gs-slide-product-card .gs-product-price ins {
  color: var(--text);
  display: block;
  font-size: 20px;
  text-decoration: none;
  margin-bottom: 14px;
}
.gs-slide-product-card .gs-add-to-cart-wrap .woocommerce.product {
  padding: 0 !important;
  border: 0 !important;
}
.gs-slide-product-card .gs-add-to-cart-wrap .button.add_to_cart_button {
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #0a0a0f;
  cursor: pointer;
  display: block;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 9px;
  transition: opacity 0.2s;
  width: 100%;
}
.gs-slide-product-card .gs-add-to-cart-wrap .button.add_to_cart_button:hover {
  opacity: 0.85;
}
html[data-theme="light"]
  .gs-slide-product-card
  .gs-add-to-cart-wrap
  .button.add_to_cart_button {
  color: white;
}
/* View cart button after product has been added */
html[data-theme="dark"]
  .gs-slide-product-card
  .gs-add-to-cart-wrap
  .added_to_cart.wc-forward {
  color: white;
}

/* ── Promo visual box ── */
.gs-slide-promo-box {
  /* width: 260px; */
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.1),
    rgba(239, 68, 68, 0.08)
  );
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 24px;
  box-shadow: 0 20px 60px var(--shadow);
}
.gs-promo-big {
  color: var(--accent3);
  font-family: "Syne", sans-serif;
  font-size: 68px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -3px;
  white-space: nowrap;
}
.gs-promo-label {
  color: var(--text2);
  font-family: "Syne", sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

/**
* Flash sale
* */
.gs-flash-sale-countdown {
  color: var(--accent3);
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}
.gs-flash-sale-countdown .gs-countdown-prefix {
  color: var(--muted);
}

/* ── Slider controls bar ── */
.gs-slider-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px max(40px, calc((100vw - 1280px) / 2 + 48px)) 18px;
  position: relative;
  z-index: 20;
}

/* When slider has fixed height, position controls absolutely at bottom */
[data-theme="light"] .gs-slider[data-fixed="1"] .gs-slider-controls {
  background: linear-gradient(
    to top,
    rgba(242, 242, 247, 0.95) 0%,
    rgba(242, 242, 247, 0.6) 60%,
    transparent 100%
  );
}

.gs-slider[data-fixed="1"] .gs-slider-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px max(40px, calc((100vw - 1280px) / 2 + 48px)) 18px;
  background: linear-gradient(
    to top,
    rgba(10, 10, 15, 0.92) 0%,
    rgba(10, 10, 15, 0.5) 60%,
    transparent 100%
  );
  z-index: 20;
}
.gs-slider-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--border2);
  border: none;
  padding: 0;
  cursor: pointer;
  transition:
    width 0.3s,
    background 0.3s;
}
.gs-slider-dot.gs-slider-dot-active {
  width: 24px;
  background: var(--accent);
}
.gs-slider-arrow {
  width: 32px;
  height: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition:
    border-color 0.2s,
    color 0.2s;
}
.gs-slider-arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.gs-slider-btn {
  width: 32px;
  height: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.gs-slider-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.gs-slider-arrow-group {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.gs-slider .action-pause:before {
  content: "⏸";
}
.gs-slider.paused .action-pause:before {
  content: "▶";
}

@media (max-width: 768px) {
  .gs-hero-slide {
    grid-template-columns: 1fr;
  }
  .gs-slide-card {
    display: none;
  }
  .gs-slide-content {
    padding: 36px 20px 28px;
    text-align: center;
    align-items: center;
  }
  .gs-slide-sub {
    max-width: 100%;
  }
  .gs-slide-ctas {
    justify-content: center;
  }
  .gs-slider-controls {
    padding: 12px 20px 16px;
  }
}

/* Mini cards on mobile */
@media (max-width: 768px) {
  .gs-slide-card {
    display: block;
    padding: 0 15px;
    width: 100%;
  }

  /*
   * Product card
   */
  .gs-slide-card .gs-product-card {
    border-radius: 10px;
    min-width: 100%;
    display: block;
  }
  .gs-slide-card .gs-image-slider {
    width: 81px;
    height: 81px;
    position: absolute;
    left: 0;
    top: 0;
  }
  .gs-slide-card .gs-product-info {
    max-width: calc(100% - 84px);
    padding: 7px;
    margin-left: 81px;
  }
  /* .gs-slide-card .gs-spinner-overlay, */
  .gs-slide-card .gs-product-badge,
  .gs-slide-card .gs-image-slider-nav,
  .gs-slide-card .gs-product-brand,
  .gs-slide-card .gs-product-rating,
  .gs-slide-card .gs-product-desc {
    display: none;
  }

  /*
   * Flash sale card
   */
  .gs-slide-card .gs-slide-promo-box {
    padding: 5px 15px;
  }
  .gs-slide-card .gs-promo-big {
    font-size: 30px;
    position: absolute;
    left: 35px;
  }
  .gs-slide-card .gs-promo-label {
    scale: 1.1;
    margin-left: 75px;
    padding-top: 5px;
  }
  .gs-slide-card .gs-flash-sale-countdown {
    margin-left: 60px;
    margin-top: 0;
    scale: 1.1;
    text-align: center;
    width: 100%;
  }

  /*
   * Benefits card
   */
  .gs-slide-card.scroll-text-wrap {
    display: flex;
  }
  .gs-slide-card.scroll-text-wrap .gs-benefits {
    flex-direction: row !important;
    display: flex;
    min-width: 200%;
  }
  .gs-slide-card.scroll-text-wrap .gs-benefit-item {
    min-width: 75%;
  }
}

/* ════════════════════════════════════════════════════
   B. CATEGORIES
   ════════════════════════════════════════════════════ */

.gs-categories-grid {
  display: grid;
  grid-template-columns: repeat(var(--gs-cat-cols, 3), 1fr);
  gap: 10px;
}
.gs-cat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  transition:
    border-color 0.2s,
    transform 0.2s,
    background 0.2s;
}
.gs-cat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  background: var(--card2);
}
.gs-cat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
[data-theme="dark"] .gs-cat-icon {
  color: white;
}
.gs-cat-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.gs-cat-arrow {
  color: var(--border2);
  flex-shrink: 0;
  transition:
    color 0.2s,
    transform 0.2s;
}
.gs-cat-card:hover .gs-cat-arrow {
  color: var(--accent);
  transform: translateX(3px);
}
.gs-cat-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  transition: color var(--tg-transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-cat-count {
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .gs-categories-grid {
    grid-template-columns: repeat(min(var(--gs-cat-cols, 3), 2), 1fr);
  }
}
@media (max-width: 768px) {
  .gs-categories-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ════════════════════════════════════════════════════
   C. PRODUCT CARDS
   ════════════════════════════════════════════════════ */

.gs-products-grid {
  display: grid;
  grid-template-columns: repeat(var(--tg-prod-cols, 4), 1fr);
  gap: 16px;
}
.gs-product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.2s,
    transform 0.2s;
  /* cursor: pointer; */
}
/* prevent double border on shop pages */
.woocommerce ul.products li.product > .gs-product-card {
  border: none;
}
.gs-product-card:hover {
  border-color: var(--border2);
  transform: translateY(-4px);
}
.gs-image-slide {
  transition: transform 0.3s;
}
.gs-product-card:hover .gs-image-slide {
  transform: scale(1.05);
}
/* hide view card button after clicking add to cart*/
.gs-product-card .added_to_cart.wc-forward {
  display: none !important;
}
.gs-product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 6px;
  text-transform: uppercase;
  z-index: 2;
}
.gs-product-badge.new {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(0, 229, 255, 0.25);
}
.gs-product-badge.sale {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent3);
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.gs-product-badge.hot {
  background: rgba(124, 58, 237, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(124, 58, 237, 0.25);
}
.gs-product-badge.new.fill {
  background: var(--accent);
  color: white;
}
.gs-product-badge.sale.fill {
  background: var(--accent3);
  color: white;
}
.gs-product-badge.hot.fill {
  background: #a78bfa;
  color: white;
}

.gs-image-slider {
  align-items: center;
  background-color: var(--card2);
  cursor: pointer;
  display: flex;
  height: 190px;
  justify-content: center;
  overflow: hidden;
  position: relative;
  user-select: none;
}
/* Product card gallery navigation */
.gs-image-slider-nav {
  display: block;
  height: 100%;
  position: absolute;
  width: 50%;
  z-index: 3;
}
.gs-image-slider-nav.left {
  left: 0;
}
.gs-image-slider-nav.right {
  right: 0;
}
.gs-image-slider-nav:before,
.gs-image-slider-nav:after {
  color: #606060ba;
  font-size: 30px;
  position: absolute;
  top: calc(50% - 20px);
  width: 50%;
  z-index: 1;
}
.gs-image-slider-nav.left:before {
  content: "❮";
  left: 0;
  padding-left: 5px;
}
.gs-image-slider-nav.right:after {
  content: "❯";
  padding-right: 5px;
  right: 0;
  text-align: right;
}
.gs-image-slider .gs-spinner-overlay {
  font-size: 60px;
  position: static;
}
.gs-image-slider .gs-spinner-overlay.error::after {
  content: "⚠︎";
  animation: none;
  border: none;
}
.gs-image-slide {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  min-height: 100%;
  width: 100%;
  z-index: 1;
}
.gs-image-slide:not(.visible) {
  display: none;
}
.gs-image-slide.visible {
  display: block;
}
.gs-image-slide.animate-in {
  display: block;
  width: 0;
  animation: animate-in 0.35s;
}
.gs-image-slide.animate-out {
  animation: animate-out 0.35s;
  display: block;
  width: 100%;
}
@keyframes animate-in {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}
@keyframes animate-out {
  from {
    width: 100%;
  }

  to {
    width: 0;
  }
}

/* @media screen and (min-width: 900px) {
  .gs-image-slider:not(:hover) .gs-image-slider-nav {
    display: none;
  }
} */

/* Touch device styles */
@media (hover: none) and (pointer: coarse) {
  .gs-image-slider:not(.touched) .gs-image-slider-nav {
    display: none;
  }
}
/* Desktop/mouse styles */
@media (hover: hover) and (pointer: fine) {
  .gs-image-slider:not(:hover) .gs-image-slider-nav {
    display: none;
  }
}

/*
 * ------
 *
 *
 */
.tg-wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition:
    border-color 0.2s,
    color 0.2s;
}
.tg-wishlist-btn:hover {
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.gs-product-info {
  padding: 14px;
}
.gs-product-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 9px;
  transition: color var(--tg-transition);
  white-space: nowrap;
  overflow-x: clip;
}
.gs-product-brand {
  color: var(--muted);
  max-width: 100%;
  overflow-x: hidden;
  white-space: nowrap;
}
.gs-product-desc {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.8px;
  /* text-transform: uppercase; */
  margin-bottom: 5px;
  height: 52px;
  overflow-y: clip;
}
.gs-product-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 11px;
}
.tg-stars {
  display: flex;
  gap: 2px;
  color: var(--accent3);
  font-size: 11px;
}
.tg-rating-count {
  font-size: 11px;
  color: var(--muted);
}

.gs-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tg-price-main {
  font-family: "Syne", sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  display: block;
  transition: color var(--tg-transition);
}
/* remove underline from offer price */
.tg-price-main ins {
  text-decoration: none;
}
.tg-price-main.on-sale :not(ins) .woocommerce-Price-amount {
  font-size: 85%;
  display: block;
  margin: -10px 0 -8px;
  text-align: center;
  color: var(--muted);
}
.tg-price-old {
  font-size: 11px;
  text-decoration: line-through;
}

.gs-add-to-cart {
  position: relative;
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0f;
  border: none;
  cursor: pointer;
  transition:
    opacity 0.2s,
    transform 0.15s;
  flex-shrink: 0;
}
.gs-add-to-cart:hover {
  opacity: 0.85;
  transform: scale(1.06);
}
/* check icon once product has been added */
/* .gs-add-to-cart.added {
  width: 55px;
}
.gs-add-to-cart.added:after {
  font-family: WooCommerce;
  content: "\e017";
  margin-left: 0.53em;
  vertical-align: bottom;
} */

@media (max-width: 900px) {
  .gs-products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  /* number of columns on mobile
  .gs-products-grid {
    grid-template-columns: 1fr !important;
  } */
  .gs-products-grid {
    gap: 15px 5px;
  }
}

/* ════════════════════════════════════════════════════
   D. PROMO BANNER
   ════════════════════════════════════════════════════ */

.gs-promo-banner {
  background: var(--promo-bg);
  border: 1px solid var(--promo-border);
  border-radius: 20px;
  padding: 36px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  position: relative;
  overflow: hidden;
  transition:
    background var(--tg-transition),
    border-color var(--tg-transition);
}
.gs-promo-banner::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.06);
  filter: blur(60px);
  pointer-events: none;
}
.gs-promo-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
}
.gs-promo-title {
  font-family: "Syne", sans-serif;
  font-size: clamp(20px, 2.5vw, 32px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 8px;
  transition: color var(--tg-transition);
}
.gs-promo-sub {
  font-size: 14px;
  color: var(--muted);
  font-weight: 300;
  max-width: 360px;
}
.gs-promo-cta {
  margin-top: 20px;
}

@media (max-width: 768px) {
  .gs-promo-banner {
    flex-direction: column;
    padding: 28px 20px;
    text-align: center;
    align-items: center;
  }
  .gs-promo-sub {
    max-width: 100%;
  }
}
