/* ============================================================
   GHEE & KAARAM — Shop & Category Page Styles
   ============================================================ */

/* ── SHOP WRAPPER ──────────────────────────────────────────── */

/*
 * NOTE: CSS custom properties (--gk-*) are defined in style.css :root.
 * Raw hex values have been migrated to those variables below.
 */

.gk-shop-wrap {
  width: 100%;
  background: var(--gk-bg);
  min-height: 60vh;
}

/* ── SHOP HEADER ───────────────────────────────────────────── */

.gk-shop-header {
  background: var(--gk-white);
  border-bottom: 1px solid var(--gk-border);
  padding: 20px 0 16px;
}

.gk-shop-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
}

/* Breadcrumb */
.gk-breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  font-size: 0.82em;
  color: #888;
}

.gk-breadcrumb a {
  color: var(--gk-gold) !important;
  text-decoration: none !important;
}

.gk-breadcrumb a:hover {
  text-decoration: underline !important;
}

.gk-breadcrumb [aria-current="page"] {
  color: var(--gk-text);
  font-weight: 500;
}

/* Header row */
.gk-shop-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.gk-shop-title {
  font-size: 1.8em;
  font-weight: 800;
  color: var(--gk-text);
  margin: 0;
  line-height: 1.2;
}

.gk-shop-desc {
  font-size: 0.9em;
  color: var(--gk-text-mid);
  margin: 6px 0 0;
  line-height: 1.5;
}

.gk-shop-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.gk-result-count {
  font-size: 0.85em;
  color: #888;
  background: #f5ede0;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 500;
}

/* ── SHOP BODY: sidebar + grid ─────────────────────────────── */

.gk-shop-body {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 28px 60px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}

/* ── SIDEBAR ───────────────────────────────────────────────── */

.gk-shop-sidebar {
  position: sticky;
  top: 90px; /* below Astra's sticky header */
}

.gk-filter-toggle {
  display: none; /* shown only on mobile */
}

.gk-sidebar-block {
  background: var(--gk-white);
  border: 1px solid var(--gk-border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.gk-sidebar-heading {
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #888;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

/* Category filter */
.gk-cat-filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gk-cat-filter-item {
  border-radius: 6px;
  overflow: hidden;
}

.gk-cat-filter-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  color: #444 !important;
  text-decoration: none !important;
  border-radius: 6px;
  font-size: 0.92em;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.gk-cat-filter-item a:hover {
  background: #fdf5e8;
  color: var(--gk-gold) !important;
}

.gk-cat-filter-item.gk-cat-active a {
  background: var(--gk-gold);
  color: var(--gk-white) !important;
  font-weight: 600;
}

.gk-cat-filter-count {
  background: rgba(0,0,0,0.08);
  color: inherit;
  font-size: 0.78em;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}

.gk-cat-filter-item.gk-cat-active .gk-cat-filter-count {
  background: rgba(255,255,255,0.25);
}

/* Sort list */
.gk-sort-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gk-sort-item a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  color: #444 !important;
  text-decoration: none !important;
  font-size: 0.9em;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.gk-sort-item a:hover {
  background: #fdf5e8;
  color: var(--gk-gold) !important;
}

.gk-sort-item.gk-sort-active a {
  color: var(--gk-gold) !important;
  font-weight: 600;
}

.gk-sort-check {
  color: var(--gk-gold);
  font-weight: 700;
}

/* Trust block */
.gk-sidebar-trust {
  background: #fdf5e8 !important;
  border-color: #E8D8C0 !important;
}

.gk-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.83em;
  color: #8B5E02;
  padding: 4px 0;
  font-weight: 500;
}

/* ── MAIN CONTENT AREA ────────────────────────────────────── */

.gk-shop-main {
  min-width: 0; /* prevent grid overflow */
}

/* Active filter pill */
.gk-active-filter {
  margin-bottom: 20px;
}

.gk-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gk-gold);
  color: var(--gk-white);
  font-size: 0.85em;
  font-weight: 600;
  padding: 5px 12px 5px 14px;
  border-radius: 20px;
}

.gk-filter-pill-remove {
  color: rgba(255,255,255,0.8) !important;
  text-decoration: none !important;
  font-size: 1.1em;
  font-weight: 400;
  line-height: 1;
  transition: color 0.15s ease;
}

.gk-filter-pill-remove:hover {
  color: #fff !important;
}

/* ── WooCommerce ul.products override ──────────────────────── */

.gk-shop-main ul.products {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 22px !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ── PRODUCT CARD ──────────────────────────────────────────── */

.gk-product-card-wrap {
  background: var(--gk-white) !important;
  border: 1px solid var(--gk-border) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  transition: box-shadow 0.2s ease, transform 0.2s ease !important;
  padding: 0 !important; /* reset WooCommerce padding */
}

.gk-product-card-wrap:hover {
  box-shadow: 0 8px 28px rgba(200, 134, 10, 0.14) !important;
  transform: translateY(-4px) !important;
}

.gk-pc {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Image */
.gk-pc-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #FDFBF5;
}

.gk-pc-img-link {
  display: block;
  height: 100%;
}

.gk-pc-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.gk-product-card-wrap:hover .gk-pc-img {
  transform: scale(1.06);
}

.gk-pc-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5em;
  background: #fdf5e8; /* intentional slightly-green tint for food context */
}

/* Badges on image */
.gk-pc-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.7em;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  z-index: 2;
  line-height: 1.4;
}

.gk-pc-badge--bestseller {
  background: var(--gk-gold-dark);
  color: var(--gk-white);
}

.gk-pc-badge--sale {
  background: var(--gk-spice);
  color: var(--gk-white);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gk-pc-badge--new {
  background: var(--gk-gold);
  color: var(--gk-white);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gk-pc-weight-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(139, 94, 2, 0.88);
  color: #fff;
  font-size: 0.72em;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  z-index: 2;
}

/* Card body */
.gk-pc-body {
  padding: 16px 16px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gk-pc-cat-label {
  font-size: 0.7em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gk-gold);
}

.gk-pc-title {
  font-size: 0.97em;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
  color: var(--gk-text) !important;
  font-family: inherit !important;
}

.gk-pc-title a {
  color: var(--gk-text) !important;
  text-decoration: none !important;
}

.gk-pc-title a:hover {
  color: var(--gk-gold) !important;
}

.gk-pc-desc {
  font-size: 0.82em;
  color: #666;
  line-height: 1.55;
  margin: 2px 0 0;
  flex: 1;
}

/* Meta row */
.gk-pc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.gk-pc-weight {
  font-size: 0.78em;
  color: #555;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.gk-pc-weight-icon {
  font-size: 0.9em;
}

/* Star rating */
.gk-pc-rating {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.88em;
}

.gk-star {
  line-height: 1;
}

.gk-star-full {
  color: #E8A020;
}

.gk-star-half {
  color: #E8A020;
  opacity: 0.7;
}

.gk-star-empty {
  color: #ddd;
}

.gk-pc-review-count {
  font-size: 0.8em;
  color: #999;
  margin-left: 3px;
}

/* Card footer */
.gk-pc-footer {
  padding: 12px 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #f0f4f1; /* subtle separator, slightly green-tinted */
}

.gk-pc-price {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--gk-gold) !important;
  line-height: 1;
}

.gk-pc-price .woocommerce-Price-amount {
  color: var(--gk-gold) !important;
}

.gk-pc-price del .woocommerce-Price-amount {
  color: #aaa !important;
  font-weight: 400;
}

.gk-pc-price ins {
  text-decoration: none;
}

/* Add to cart button */
.gk-pc-atc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gk-gold) !important;
  color: var(--gk-white) !important;
  padding: 9px 16px !important;
  border-radius: 6px;
  font-size: 0.83em;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  border: none !important;
  transition: background 0.2s ease, transform 0.15s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.gk-pc-atc:hover {
  background: var(--gk-gold-dark) !important;
  color: var(--gk-white) !important;
  transform: translateY(-1px);
}

.gk-pc-atc:focus-visible {
  outline: 2px solid var(--gk-spice) !important;
  outline-offset: 2px;
  background: var(--gk-gold-dark) !important;
}

.gk-pc-atc.loading::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gk-spin 0.6s linear infinite;
}

.gk-pc-atc.added {
  background: var(--gk-gold-dark) !important;
}

.gk-pc-out-of-stock {
  font-size: 0.8em;
  color: #c0392b;
  font-weight: 600;
  padding: 6px 12px;
  background: #fef0f0;
  border-radius: 6px;
}

@keyframes gk-spin {
  to { transform: rotate(360deg); }
}

/* ── WooCommerce pagination — hidden when all products fit on one page ─── */
/* If product count grows beyond per_page, remove this rule */
.gk-shop-main .woocommerce-pagination:has(li:only-child) {
  display: none; /* single-page navigation is pointless */
}

.woocommerce-pagination {
  margin-top: 36px;
  text-align: center;
}

.woocommerce-pagination ul {
  display: inline-flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid #E8D8C0;
  background: #fff;
  color: #444;
  font-size: 0.9em;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.woocommerce-pagination ul li a:hover {
  background: var(--gk-gold);
  border-color: var(--gk-gold);
  color: var(--gk-white);
}

.woocommerce-pagination ul li span.current {
  background: var(--gk-gold);
  border-color: var(--gk-gold);
  color: var(--gk-white);
  font-weight: 700;
}

/* ── EMPTY STATE ───────────────────────────────────────────── */

.gk-empty-state {
  text-align: center;
  padding: 80px 20px;
  background: var(--gk-white);
  border-radius: 12px;
  border: 1px solid var(--gk-border);
}

.gk-empty-icon {
  font-size: 4em;
  margin-bottom: 16px;
}

.gk-empty-state h2 {
  font-size: 1.5em;
  color: var(--gk-text);
  margin: 0 0 10px;
}

.gk-empty-state p {
  color: var(--gk-text-mid);
  line-height: 1.65;
  margin: 0 0 24px;
}

.gk-empty-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gk-btn-empty-alt {
  display: inline-block;
  padding: 11px 22px;
  border: 2px solid var(--gk-gold);
  color: var(--gk-gold) !important;
  border-radius: 6px;
  font-size: 0.9em;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.2s ease, color 0.2s ease;
}

.gk-btn-empty-alt:hover {
  background: var(--gk-gold);
  color: var(--gk-white) !important;
}

/* ── WooCommerce notices ───────────────────────────────────── */

.woocommerce-notices-wrapper {
  margin-bottom: 20px;
}

/* ── MOBILE FILTER TOGGLE ──────────────────────────────────── */

@media (max-width: 900px) {
  .gk-shop-body {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 16px 16px 48px;
  }

  .gk-shop-sidebar {
    position: static;
    margin-bottom: 20px;
  }

  .gk-filter-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: var(--gk-white);
    border: 1px solid var(--gk-border);
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 0.95em;
    font-weight: 600;
    color: var(--gk-text);
    cursor: pointer;
    text-align: left;
    margin-bottom: 0;
    transition: background 0.15s ease;
    font-family: 'Plus Jakarta Sans', sans-serif;
  }

  .gk-filter-toggle:hover {
    background: #fdf5e8;
  }

  .gk-filter-toggle[aria-expanded="true"] {
    background: #fdf5e8;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .gk-filter-icon {
    font-size: 1.1em;
  }

  .gk-sidebar-inner {
    display: none;
    border: 1px solid #E8D8C0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    background: #fff;
    padding: 16px;
  }

  .gk-sidebar-inner.gk-sidebar-open {
    display: block;
  }

  .gk-sidebar-inner .gk-sidebar-block {
    border: none;
    border-bottom: 1px solid #eee;
    border-radius: 0;
    padding: 14px 4px;
    margin-bottom: 0;
  }

  .gk-sidebar-inner .gk-sidebar-block:last-child {
    border-bottom: none;
  }

  .gk-shop-header-inner {
    padding: 0 16px;
  }

  .gk-shop-main ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }
}

@media (max-width: 520px) {
  .gk-shop-main ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .gk-pc-body {
    padding: 12px 12px 8px;
  }

  .gk-pc-footer {
    padding: 10px 12px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .gk-pc-atc {
    justify-content: center;
    padding: 10px !important;
  }

  .gk-pc-title {
    font-size: 0.88em;
  }

  .gk-pc-desc {
    display: none; /* hide description on very small screens */
  }

  .gk-shop-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
