/* ====================================================================
   GS Optixx Catalog v1.3.3 — Styles
   All classes prefixed gsoc- (no conflicts with WoodMart / WooCommerce)
   ==================================================================== */

/* ── WoodMart layout overrides (scoped to catalog page only) ──────
   Triggered by body.gsoc-catalog-page, added via body_class filter
   only when [gs_optixx_catalog] shortcode is present on the page.
   Selectors confirmed on WoodMart 7.x / gsoptixx.com staging.
   ────────────────────────────────────────────────────────────────── */

/* Hide the WoodMart page-title section (h1 + breadcrumb) */
body.gsoc-catalog-page .wd-page-title {
  display: none !important;
}

/* Hide the right sidebar (WPML language switcher + Categories widget) */
body.gsoc-catalog-page aside.wd-sidebar {
  display: none !important;
}

/* Stretch the content area to fill the full grid */
body.gsoc-catalog-page .wd-content-area.site-content {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* ── Reset scoped to plugin ────────────────────── */

.gsoc-wrap {
  direction: rtl;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  background: #F7F9FC;
  box-sizing: border-box;
}

.gsoc-wrap *,
.gsoc-wrap *::before,
.gsoc-wrap *::after {
  box-sizing: border-box;
}

/* ── Header (navy banner) ──────────────────────── */

.gsoc-header {
  background: #1A2B4A;
  border-radius: 16px;
  padding: 64px 32px;
  text-align: center;
  margin-bottom: 36px;
}

.gsoc-heading {
  font-size: 36px;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0 0 16px 0;
  line-height: 1.25;
}

.gsoc-subheading {
  font-size: 16px;
  line-height: 1.8;
  color: #DCE5F2;
  max-width: 680px;
  margin: 0 auto;
}

/* ── Filters ───────────────────────────────────── */

.gsoc-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  background: #FFFFFF;
  border: 1px solid #E5E9F0;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 28px;
}

.gsoc-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 200px;
  min-width: 160px;
}

.gsoc-filter-reset-wrap {
  flex: 0 0 auto;
  min-width: 0;
}

.gsoc-filter-label {
  font-size: 13px;
  font-weight: 600;
  color: #1A2B4A;
}

.gsoc-filter-input,
.gsoc-filter-select {
  width: 100%;
  font-size: 14px;
  font-family: inherit;
  color: #1A2B4A;
  background: #FFFFFF;
  border: 1px solid #D6DCE5;
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gsoc-filter-input:focus,
.gsoc-filter-select:focus {
  border-color: #007A85;
  box-shadow: 0 0 0 3px rgba(0, 122, 133, 0.30);
}

.gsoc-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  color: #1A2B4A;
  background: #F1F4F8;
  border: 1px solid #D6DCE5;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.gsoc-reset-btn:hover {
  background: #E5E9F0;
}

/* ── Results bar ───────────────────────────────── */

.gsoc-results-bar {
  font-size: 14px;
  color: #6B7280;
  margin-bottom: 16px;
}

/* ── Results container ─────────────────────────── */

.gsoc-results {
  position: relative;
  min-height: 120px;
  transition: opacity 0.2s ease;
}

.gsoc-results.gsoc-loading {
  opacity: 0.45;
  pointer-events: none;
}

/* ── Grid ──────────────────────────────────────── */

.gsoc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 992px) {
  .gsoc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .gsoc-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Card ──────────────────────────────────────── */

.gsoc-card {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid #E5E9F0;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(26, 43, 74, 0.06);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.gsoc-card:hover {
  box-shadow: 0 10px 28px rgba(26, 43, 74, 0.1);
  transform: translateY(-2px);
}

.gsoc-card-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #F7F9FC;
  padding: 18px;
  display: block;
}

.gsoc-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.gsoc-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 18px 20px 22px;
  text-align: right;
}

.gsoc-card-name {
  font-size: 17px;
  font-weight: 700;
  color: #1A2B4A;
  margin: 0 0 4px 0;
  line-height: 1.4;
}

.gsoc-card-name a {
  color: inherit;
  text-decoration: none;
}

.gsoc-card-name a:hover {
  color: #007A85;
}

.gsoc-card-brand {
  font-style: italic;
  font-weight: 400;
  font-size: 13px;
  color: #6B7280;
  margin: 0 0 10px 0;
}

.gsoc-card-desc {
  font-size: 14px;
  line-height: 1.65;
  color: #4B5563;
  margin: 0 0 18px 0;
  flex: 1 1 auto;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gsoc-card-desc p {
  margin: 0;
}

/* ── Card buttons ──────────────────────────────── */

.gsoc-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.gsoc-btn {
  flex: 1 1 auto;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
  padding: 11px 14px;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.gsoc-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  text-decoration: none;
}

.gsoc-btn-details {
  background: #007A85;
  color: #FFFFFF;
}

.gsoc-btn-quote {
  background: #1A2B4A;
  color: #FFFFFF;
}

/* ── No results ────────────────────────────────── */

.gsoc-no-results {
  text-align: center;
  background: #FFFFFF;
  border: 1px solid #E5E9F0;
  border-radius: 16px;
  padding: 56px 24px;
}

.gsoc-no-results-text {
  font-size: 16px;
  color: #4B5563;
  margin: 0 0 18px 0;
}

.gsoc-link-btn {
  font-size: 14px;
  font-weight: 700;
  color: #0099A8;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

/* ── AJAX error message ────────────────────────── */

.gsoc-error-msg {
  text-align: center;
  background: #FFF5F5;
  border: 1px solid #FECACA;
  border-radius: 12px;
  padding: 32px 24px;
  margin-top: 24px;
}

.gsoc-error-msg p {
  font-size: 15px;
  color: #B91C1C;
  margin: 0 0 14px 0;
}

.gsoc-retry-btn {
  font-size: 14px;
  font-weight: 700;
  color: #1A2B4A;
  background: #FFFFFF;
  border: 2px solid #1A2B4A;
  border-radius: 8px;
  padding: 10px 24px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.gsoc-retry-btn:hover {
  background: #1A2B4A;
  color: #FFFFFF;
}

/* ── Focus indicators (keyboard navigation) ─────── */

.gsoc-reset-btn:focus-visible,
.gsoc-load-more-btn:focus-visible,
.gsoc-retry-btn:focus-visible,
.gsoc-link-btn:focus-visible,
.gsoc-btn:focus-visible {
  outline: 3px solid #007A85;
  outline-offset: 3px;
  border-radius: 8px;
}

/* ── Load more ─────────────────────────────────── */

.gsoc-load-more-wrap {
  text-align: center;
  margin-top: 32px;
}

.gsoc-load-more-btn {
  font-size: 15px;
  font-weight: 700;
  color: #1A2B4A;
  background: #FFFFFF;
  border: 2px solid #1A2B4A;
  border-radius: 8px;
  padding: 13px 32px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.gsoc-load-more-btn:hover {
  background: #1A2B4A;
  color: #FFFFFF;
}

.gsoc-load-more-btn:disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

/* ── Spinner ───────────────────────────────────── */

.gsoc-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: gsoc-spin 0.65s linear infinite;
  vertical-align: middle;
  margin-inline-start: 7px;
}

.gsoc-load-more-btn .gsoc-spinner {
  border-color: rgba(26, 43, 74, 0.25);
  border-top-color: #1A2B4A;
}

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

/* ── Responsive — tablet ───────────────────────── */

@media (max-width: 768px) {
  .gsoc-header {
    padding: 48px 24px;
    border-radius: 12px;
  }
  .gsoc-heading {
    font-size: 28px;
  }
  .gsoc-subheading {
    font-size: 15px;
  }
}

/* ── Responsive — mobile ───────────────────────── */

@media (max-width: 600px) {
  .gsoc-wrap {
    padding: 20px 16px 56px;
  }
  .gsoc-header {
    padding: 40px 20px;
    border-radius: 10px;
  }
  .gsoc-heading {
    font-size: 24px;
    margin-bottom: 12px;
  }
  .gsoc-subheading {
    font-size: 14px;
  }
  .gsoc-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .gsoc-filter-reset-wrap {
    width: 100%;
  }
  .gsoc-reset-btn {
    width: 100%;
  }
  .gsoc-card-actions {
    flex-direction: column;
  }
}
