/* ============================================================
   5G Store - Shop CSS
   WooCommerce product archive, category pages, shop grid
   ============================================================ */


/* ---- SHOP HEADER / CATEGORY BANNER ------------------------ */
.fgs-shop-header {
  background: var(--fgs-navy);
  color: var(--fgs-white);
  padding-block: var(--fgs-space-12) var(--fgs-space-10);
  position: relative;
  overflow: hidden;
}

.fgs-shop-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 180, 216, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 180, 216, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

.fgs-shop-header__inner {
  position: relative;
  z-index: 1;
}

.fgs-shop-header h1 {
  color: var(--fgs-white);
  font-size: clamp(var(--fgs-text-2xl), 4vw, var(--fgs-text-4xl));
  margin-bottom: var(--fgs-space-3);
}

.fgs-shop-header h1 em {
  font-style: normal;
  color: var(--fgs-signal);
}

.fgs-shop-header__desc {
  font-size: var(--fgs-text-md);
  color: rgba(248, 250, 255, 0.68);
  max-width: 580px;
  line-height: 1.65;
}

/* Category image as background */
.fgs-shop-header--has-image {
  background-size: cover;
  background-position: center;
}
.fgs-shop-header--has-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10, 22, 40, 0.92) 0%, rgba(10, 22, 40, 0.75) 100%);
}


/* ---- SHOP TOOLBAR ----------------------------------------- */
.fgs-shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--fgs-space-4);
  padding-block: var(--fgs-space-5);
  border-bottom: 1px solid var(--fgs-border);
  margin-bottom: var(--fgs-space-8);
  flex-wrap: wrap;
}

.woocommerce-result-count {
  font-size: var(--fgs-text-sm);
  color: var(--fgs-muted);
  margin: 0;
}

.woocommerce-ordering select {
  padding: var(--fgs-space-2) var(--fgs-space-3);
  border: 1.5px solid var(--fgs-border-dark);
  border-radius: var(--fgs-radius);
  font-family: var(--fgs-font-head);
  font-size: var(--fgs-text-sm);
  font-weight: 500;
  color: var(--fgs-body);
  background: #fff;
  cursor: pointer;
  transition: border-color var(--fgs-transition);
}

.woocommerce-ordering select:hover,
.woocommerce-ordering select:focus {
  border-color: var(--fgs-blue);
  outline: none;
}


/* ---- PRODUCT GRID ----------------------------------------- */
.fgs-shop-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--fgs-space-10);
  align-items: start;
}

/* When no sidebar */
.fgs-shop-layout--full {
  grid-template-columns: 1fr;
}

ul.products {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--fgs-space-6);
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

ul.products.columns-2 { grid-template-columns: repeat(2, 1fr); }
ul.products.columns-4 { grid-template-columns: repeat(4, 1fr); }


/* ---- PRODUCT CARD ----------------------------------------- */
ul.products li.product {
  background: #fff;
  border: 1px solid var(--fgs-border);
  border-radius: var(--fgs-radius-md);
  overflow: hidden;
  display: flex !important;
  flex-direction: column;
  transition:
    border-color var(--fgs-transition),
    box-shadow var(--fgs-transition),
    transform var(--fgs-transition-slow);
  box-shadow: var(--fgs-shadow-card);
}

ul.products li.product:hover {
  border-color: var(--fgs-signal);
  box-shadow: var(--fgs-shadow-md);
  transform: translateY(-3px);
}

/* Thumbnail area */
.fgs-product-thumb-wrap {
  position: relative;
  background: var(--fgs-off-white);
}

ul.products li.product a img,
ul.products li.product img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  padding: var(--fgs-space-6);
  transition: transform var(--fgs-transition-slow);
  background: var(--fgs-off-white);
}

ul.products li.product:hover a img {
  transform: scale(1.04);
}

/* Card body */
ul.products li.product .woocommerce-loop-product__link {
  padding: var(--fgs-space-4);
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
}

ul.products li.product .woocommerce-loop-product__title,
ul.products li.product h2.woocommerce-loop-product__title {
  font-family: var(--fgs-font-head) !important;
  font-size: var(--fgs-text-sm) !important;
  font-weight: 700 !important;
  color: var(--fgs-navy) !important;
  margin: 0 0 var(--fgs-space-2) !important;
  line-height: 1.35 !important;
  -webkit-line-clamp: 3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Price */
ul.products li.product .price {
  font-family: var(--fgs-font-head) !important;
  font-size: var(--fgs-text-md) !important;
  font-weight: 800 !important;
  color: var(--fgs-navy) !important;
  margin: auto 0 var(--fgs-space-3) !important;
  padding: 0 var(--fgs-space-4);
}

ul.products li.product .price del {
  color: var(--fgs-muted) !important;
  font-weight: 400 !important;
}

ul.products li.product .price ins {
  text-decoration: none !important;
  color: var(--fgs-danger) !important;
}

/* Out of stock */
ul.products li.product .out-of-stock {
  font-size: var(--fgs-text-xs);
  color: var(--fgs-muted);
  padding: 0 var(--fgs-space-4) var(--fgs-space-3);
}

/* Add to cart / view */
ul.products li.product .button,
ul.products li.product a.button {
  display: block;
  margin: 0 var(--fgs-space-4) var(--fgs-space-4);
  padding: 0.625rem var(--fgs-space-4);
  background: var(--fgs-navy);
  color: #fff !important;
  border: none;
  border-radius: var(--fgs-radius);
  font-family: var(--fgs-font-head) !important;
  font-size: var(--fgs-text-sm) !important;
  font-weight: 700 !important;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--fgs-transition);
}

ul.products li.product .button:hover,
ul.products li.product a.button:hover {
  background: var(--fgs-navy-light) !important;
}

ul.products li.product .added_to_cart {
  display: none;
}

/* On sale ribbon */
ul.products li.product .onsale {
  position: absolute;
  top: var(--fgs-space-3);
  left: var(--fgs-space-3);
  background: var(--fgs-danger);
  color: #fff;
  font-family: var(--fgs-font-head);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.25em 0.6em;
  border-radius: var(--fgs-radius-full);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  z-index: 2;
}


/* ---- SHOP SIDEBAR ----------------------------------------- */
.fgs-shop-sidebar {
  position: sticky;
  top: 80px;
}

.fgs-sidebar-widget {
  background: #fff;
  border: 1px solid var(--fgs-border);
  border-radius: var(--fgs-radius-md);
  padding: var(--fgs-space-5);
  margin-bottom: var(--fgs-space-4);
}

.fgs-sidebar-widget h4 {
  font-family: var(--fgs-font-head);
  font-size: var(--fgs-text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fgs-mid);
  margin-bottom: var(--fgs-space-4);
  padding-bottom: var(--fgs-space-3);
  border-bottom: 1px solid var(--fgs-border);
}

/* Category list in sidebar */
.fgs-sidebar-widget .product-categories {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fgs-sidebar-widget .product-categories li {
  border-bottom: 1px solid var(--fgs-border);
}

.fgs-sidebar-widget .product-categories li:last-child {
  border-bottom: none;
}

.fgs-sidebar-widget .product-categories li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--fgs-space-2) 0;
  font-size: var(--fgs-text-sm);
  font-weight: 500;
  color: var(--fgs-body);
  text-decoration: none;
  transition: color var(--fgs-transition);
}

.fgs-sidebar-widget .product-categories li a:hover,
.fgs-sidebar-widget .product-categories li.current-cat > a {
  color: var(--fgs-blue);
}

.fgs-sidebar-widget .product-categories li.current-cat > a {
  font-weight: 700;
}

.fgs-sidebar-widget .count {
  font-size: var(--fgs-text-xs);
  color: var(--fgs-muted);
  background: var(--fgs-off-white);
  padding: 0.1em 0.5em;
  border-radius: var(--fgs-radius-full);
}


/* Brand filter sidebar */
.fgs-brand-filter {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fgs-brand-filter li {
  display: flex;
  align-items: center;
  gap: var(--fgs-space-2);
  padding: var(--fgs-space-2) 0;
  font-size: var(--fgs-text-sm);
}

.fgs-brand-filter li input[type="checkbox"] {
  accent-color: var(--fgs-blue);
  width: 16px;
  height: 16px;
  cursor: pointer;
}


/* ---- CATEGORY GRID (shop homepage) ------------------------ */
.fgs-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--fgs-space-4);
  margin-block: var(--fgs-space-8);
}

.fgs-cat-card {
  display: block;
  background: #fff;
  border: 1.5px solid var(--fgs-border);
  border-radius: var(--fgs-radius-md);
  overflow: hidden;
  text-decoration: none;
  transition:
    border-color var(--fgs-transition),
    box-shadow var(--fgs-transition),
    transform var(--fgs-transition-slow);
}

.fgs-cat-card:hover {
  border-color: var(--fgs-signal);
  box-shadow: var(--fgs-shadow-md);
  transform: translateY(-2px);
}

.fgs-cat-card__img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--fgs-off-white);
}

.fgs-cat-card__body {
  padding: var(--fgs-space-4);
}

.fgs-cat-card__name {
  font-family: var(--fgs-font-head);
  font-weight: 700;
  font-size: var(--fgs-text-sm);
  color: var(--fgs-navy);
}

.fgs-cat-card__count {
  font-size: var(--fgs-text-xs);
  color: var(--fgs-muted);
  margin-top: var(--fgs-space-1);
}


/* ---- PAGINATION ------------------------------------------- */
.woocommerce-pagination,
nav.woocommerce-pagination {
  display: flex;
  justify-content: center;
  padding-block: var(--fgs-space-10);
}

.woocommerce-pagination ul {
  display: flex;
  gap: var(--fgs-space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.woocommerce-pagination li span,
.woocommerce-pagination li a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding-inline: var(--fgs-space-3);
  border: 1.5px solid var(--fgs-border-dark);
  border-radius: var(--fgs-radius);
  font-family: var(--fgs-font-head);
  font-size: var(--fgs-text-sm);
  font-weight: 600;
  color: var(--fgs-body);
  text-decoration: none;
  transition: all var(--fgs-transition);
}

.woocommerce-pagination li a:hover {
  border-color: var(--fgs-blue);
  color: var(--fgs-blue);
  background: var(--fgs-off-white);
}

.woocommerce-pagination li span.current {
  background: var(--fgs-navy);
  border-color: var(--fgs-navy);
  color: #fff;
}


/* ---- RESPONSIVE SHOP ------------------------------------- */
@media (max-width: 1024px) {
  .fgs-shop-layout {
    grid-template-columns: 1fr;
  }

  .fgs-shop-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--fgs-space-4);
  }

  ul.products {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 768px) {
  ul.products,
  ul.products.columns-3,
  ul.products.columns-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .fgs-shop-sidebar {
    grid-template-columns: 1fr;
  }

  .fgs-shop-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  ul.products,
  ul.products.columns-2,
  ul.products.columns-3,
  ul.products.columns-4 {
    grid-template-columns: 1fr !important;
  }

  ul.products li.product a img {
    height: 200px;
  }
}
