/* Key Food Hollywood — Shop Grid styles */
:root {
  --kfsg-blue: #1a56db;
  --kfsg-red: #d9381e;
  --kfsg-bg: #f9fafb;
  --kfsg-surface: #ffffff;
  --kfsg-text: #111827;
  --kfsg-muted: #6b7280;
  --kfsg-border: rgba(17, 24, 39, 0.08);
  --kfsg-radius: 1.25rem;
  --kfsg-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --kfsg-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.keyfood-shop-grid .woocommerce-breadcrumb,
.keyfood-shop-grid .woocommerce-products-header,
.keyfood-shop-grid .page-title,
.keyfood-shop-grid .woocommerce-result-count,
.keyfood-shop-grid .woocommerce-ordering {
  display: none !important;
}

.keyfood-shop-grid #main,
.keyfood-shop-grid .site-main,
.keyfood-shop-grid main {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.kfsg-main {
  background: var(--kfsg-bg);
  color: var(--kfsg-text);
  font-family: inherit;
}

.kfsg-section {
  max-width: 80rem;
  margin: 0 auto;
  padding: 3rem 1rem 5rem;
}

.kfsg-layout {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.kfsg-sidebar {
  position: sticky;
  top: 1.5rem;
  align-self: start;
}

.kfsg-filter-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--kfsg-border);
  border-radius: var(--kfsg-radius);
  background: var(--kfsg-surface);
  box-shadow: var(--kfsg-shadow);
  color: var(--kfsg-text);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.4;
}

.kfsg-filter-toggle__inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: var(--kfsg-blue);
}

.kfsg-filter-toggle__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kfsg-filter-toggle__chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.kfsg-filter-toggle[aria-expanded="true"] .kfsg-filter-toggle__chevron {
  transform: rotate(180deg);
}

.kfsg-category-nav {
  display: none;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--kfsg-surface);
  border: 1px solid var(--kfsg-border);
  border-radius: var(--kfsg-radius);
  box-shadow: var(--kfsg-shadow);
}

.kfsg-category-nav.is-open {
  display: block;
}

.kfsg-category-nav__heading {
  display: none;
  margin: 0 0 0.5rem;
  padding: 0 0.75rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--kfsg-muted);
}

.kfsg-category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kfsg-category-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--kfsg-muted);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

/* Shortcode pages: keep the grid contained inside the theme's content area */
.kfsg-main--shortcode {
  width: 100%;
}

.kfsg-category-link:hover {
  background: #f3f4f6;
  color: var(--kfsg-text);
}

.kfsg-category-link.is-active {
  background: var(--kfsg-blue);
  color: #fff;
}

.kfsg-category-link__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kfsg-category-link__count {
  flex-shrink: 0;
  font-size: 0.75rem;
  opacity: 0.8;
}

.kfsg-grid-area {
  min-width: 0;
}

.kfsg-count {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--kfsg-muted);
}

.kfsg-products {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.kfsg-card {
  display: flex;
  flex-direction: column;
  background: var(--kfsg-surface);
  border: 1px solid var(--kfsg-border);
  border-radius: var(--kfsg-radius);
  overflow: hidden;
  box-shadow: var(--kfsg-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kfsg-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--kfsg-shadow-hover);
}

.kfsg-card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.kfsg-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.kfsg-card:hover .kfsg-card__media img {
  transform: scale(1.07);
}

.kfsg-card__badge {
  position: absolute;
  left: 1rem;
  top: 1rem;
  display: inline-flex;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--kfsg-blue);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.kfsg-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 1rem;
  padding: 1.25rem;
}

.kfsg-card__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--kfsg-text);
}

.kfsg-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.kfsg-card__title a:hover {
  color: var(--kfsg-blue);
}

.kfsg-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
}

.kfsg-card__price {
  line-height: 1.1;
}

.kfsg-card__price .woocommerce-Price-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--kfsg-red);
  text-decoration: none;
}

.kfsg-card__price .woocommerce-Price-currencySymbol {
  font-size: 1rem;
  font-weight: 700;
}

.kfsg-card__price del .woocommerce-Price-amount {
  font-size: 1rem;
  font-weight: 500;
  color: var(--kfsg-muted);
}

.kfsg-card__price ins {
  text-decoration: none;
}

.kfsg-card__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.55rem 1.1rem;
  border-radius: 9999px;
  background: var(--kfsg-blue);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.kfsg-card__button:hover {
  background: #1645b5;
  color: #fff;
  transform: scale(1.03);
}

.kfsg-card__button.added {
  background: #16a34a;
}

.kfsg-card__button.loading {
  opacity: 0.75;
  pointer-events: none;
}

/* Pagination reset */
.woocommerce-pagination {
  margin-top: 2.5rem;
}

/* Tablet */
@media (min-width: 640px) {
  .kfsg-products {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .kfsg-section {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Desktop sidebar */
@media (min-width: 1024px) {
  .keyfood-shop-grid .woocommerce-breadcrumb {
    display: none !important;
  }

  .kfsg-layout {
    grid-template-columns: 16rem minmax(0, 1fr);
  }

  .kfsg-filter-toggle {
    display: none;
  }

  .kfsg-category-nav {
    display: block !important;
    margin-top: 0;
  }

  .kfsg-category-nav__heading {
    display: block;
  }

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

/* Large desktop */
@media (min-width: 1280px) {
  .kfsg-section {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Mobile full-width tweak for Divi-like boxed themes */
@media (max-width: 768px) {
  .keyfood-shop-grid .et_pb_row,
  .keyfood-shop-grid #main-content .container,
  .keyfood-shop-grid .container,
  .keyfood-shop-grid main {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .kfsg-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Theme override: Divi and other themes re-add bullets/padding to content lists.
   Keep the category filter clean with a high-specificity reset. */
.kfsg-sidebar ul.kfsg-category-list,
.kfsg-sidebar ul.kfsg-category-list li,
.entry-content ul.kfsg-category-list,
.entry-content ul.kfsg-category-list li {
  list-style: none !important;
  list-style-type: none !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-bottom: 0 !important;
}

.kfsg-sidebar ul.kfsg-category-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kfsg-sidebar ul.kfsg-category-list li::before,
.kfsg-sidebar ul.kfsg-category-list li::after {
  content: none !important;
}

/* Add to cart states */
.kfsg-card__button.is-loading { opacity: .7; pointer-events: none; }
.kfsg-card__button.is-added { background: #1f8f4e !important; border-color: #1f8f4e !important; color: #fff !important; }
