/* ═══════════════════════════════════════════════════
   WP Category Showcase  v2.1
   Fullscreen overlay popup – Mobex style
   ═══════════════════════════════════════════════════ */

:root {
  --wcs-navy: #003580;
  --wcs-navy-dark: #002060;
  --wcs-yellow: #f5a623;
  --wcs-yellow-dark: #d4891a;
  --wcs-yellow-text: #1a1000;
  --wcs-bg: #ffffff;
  --wcs-bg-light: #f5f6f8;
  --wcs-border: #e4e6ea;
  --wcs-text: #1c1c1c;
  --wcs-muted: #6b7280;
  --wcs-sidebar-w: 272px;
  --wcs-radius: 4px;
  --wcs-trans: 0.2s ease;
  --wcs-shadow: 0 2px 8px rgba(0, 0, 0, .07);
  --wcs-shadow-lg: 0 6px 20px rgba(0, 0, 0, .12);
}

/* ─── WRAPPER ────────────────────────────────────── */
.wcs-wrapper {
  position: relative;
  font-family: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--wcs-text);
  display: inline-block;
  z-index: 9999;
  /* sit above normal page content when dropdown is open */
}

/* ─── TOP BAR ────────────────────────────────────── */
/* No background – button sits naturally on the page theme */
.wcs-topbar {
  display: inline-flex;
  align-items: center;
  background: transparent;
  padding: 0;
}

/* ═══ ALL CATEGORIES BUTTON ══════════════════════════ */
.wcs-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--wcs-yellow);
  color: var(--wcs-yellow-text);
  border: none;
  border-radius: var(--wcs-radius);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--wcs-trans), box-shadow var(--wcs-trans);
  white-space: nowrap;
  outline: none;
  letter-spacing: .01em;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}

.wcs-all-btn:hover {
  background: var(--wcs-yellow-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
}

.wcs-all-btn.open {
  background: var(--wcs-yellow-dark);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
}

.wcs-all-icon svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.wcs-chevron svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform var(--wcs-trans);
}

.wcs-all-btn.open .wcs-chevron svg {
  transform: rotate(180deg);
}

/* ═══════════════════════════════════════════════════
   DROPDOWN MEGA-MENU (Mobex style)
   ═══════════════════════════════════════════════════ */

/* Semi-transparent backdrop behind the dropdown */
.wcs-overlay-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9998;
  animation: wcs-fade-in 0.18s ease both;
}

.wcs-overlay-backdrop.open {
  display: block;
}

@keyframes wcs-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* The panel – dropdown below the button */
.wcs-panel {
  display: none;
  position: absolute;
  top: 100%;
  /* drops below the button */
  left: 0;
  width: 820px;
  /* fixed width like Mobex */
  max-height: 480px;
  z-index: 9999;
  flex-direction: row;
  background: var(--wcs-bg);
  border: 1px solid var(--wcs-border);
  border-radius: 0 var(--wcs-radius) var(--wcs-radius) var(--wcs-radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
  overflow: hidden;
  animation: wcs-drop 0.18s ease both;
}

.wcs-panel.open {
  display: flex;
}

@keyframes wcs-drop {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── CLOSE BUTTON ───────────────────────────────── */
/* Hidden in dropdown mode – close via click-outside or Escape */
.wcs-close-btn {
  display: none;
}

/* ─── SIDEBAR ────────────────────────────────────── */
.wcs-sidebar {
  width: var(--wcs-sidebar-w);
  min-width: var(--wcs-sidebar-w);
  background: var(--wcs-bg);
  border-right: 1px solid var(--wcs-border);
  padding: 6px 0;
  overflow-y: auto;
  max-height: 480px;
  box-sizing: border-box;
}

.wcs-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wcs-sidebar-item {
  margin: 0;
}

.wcs-sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 18px;
  text-decoration: none !important;
  color: var(--wcs-text);
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background var(--wcs-trans), color var(--wcs-trans), border-color var(--wcs-trans);
  cursor: pointer;
}

.wcs-sidebar-link:hover {
  background: var(--wcs-bg-light);
  color: var(--wcs-navy);
  border-left-color: var(--wcs-border);
  text-decoration: none !important;
}

/* Active sidebar item */
.wcs-sidebar-item.active .wcs-sidebar-link {
  background: #fffbf0;
  color: var(--wcs-yellow-dark);
  border-left-color: var(--wcs-yellow);
  font-weight: 700;
}

/* Sidebar icon */
.wcs-sidebar-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--wcs-muted);
  transition: color var(--wcs-trans);
}

.wcs-sidebar-item.active .wcs-sidebar-icon {
  color: var(--wcs-yellow-dark);
}

.wcs-sidebar-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.wcs-sidebar-icon svg {
  width: 18px;
  height: 18px;
}

.wcs-sidebar-name {
  flex: 1;
  line-height: 1.3;
}

.wcs-sidebar-arrow {
  font-size: 17px;
  line-height: 1;
  color: var(--wcs-muted);
  transition: color var(--wcs-trans), transform var(--wcs-trans);
}

.wcs-sidebar-item.active .wcs-sidebar-arrow {
  color: var(--wcs-yellow-dark);
  transform: translateX(2px);
}

/* ─── MAIN / GRID AREA ───────────────────────────── */
.wcs-main {
  flex: 1;
  padding: 24px 28px 28px;
  min-width: 0;
  overflow-y: auto;
  max-height: 480px;
  box-sizing: border-box;
}

.wcs-grid-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--wcs-text);
  margin: 0 0 24px;
  padding: 0;
  letter-spacing: -.2px;
}

/* ─── GRID ───────────────────────────────────────── */
.wcs-grid {
  display: grid;
  gap: 24px 18px;
}

.wcs-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

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

.wcs-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.wcs-cols-5 {
  grid-template-columns: repeat(5, 1fr);
}

.wcs-cols-6 {
  grid-template-columns: repeat(6, 1fr);
}

/* ─── CARD ───────────────────────────────────────── */
.wcs-card {
  opacity: 0;
  animation: wcs-fadein .28s ease forwards;
}

.wcs-card:nth-child(1) {
  animation-delay: .03s
}

.wcs-card:nth-child(2) {
  animation-delay: .06s
}

.wcs-card:nth-child(3) {
  animation-delay: .09s
}

.wcs-card:nth-child(4) {
  animation-delay: .12s
}

.wcs-card:nth-child(5) {
  animation-delay: .15s
}

.wcs-card:nth-child(6) {
  animation-delay: .18s
}

.wcs-card:nth-child(7) {
  animation-delay: .21s
}

.wcs-card:nth-child(8) {
  animation-delay: .24s
}

.wcs-card:nth-child(9) {
  animation-delay: .27s
}

.wcs-card:nth-child(10) {
  animation-delay: .30s
}

.wcs-card:nth-child(11) {
  animation-delay: .33s
}

.wcs-card:nth-child(12) {
  animation-delay: .36s
}

@keyframes wcs-fadein {
  from {
    opacity: 0;
    transform: translateY(7px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.wcs-card-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  text-decoration: none !important;
  color: var(--wcs-text);
}

/* Circle */
.wcs-card-circle {
  width: 100%;
  padding-top: 100%;
  position: relative;
  border-radius: 50%;
  background: var(--wcs-bg-light);
  overflow: hidden;
  box-shadow: var(--wcs-shadow);
  transition: box-shadow var(--wcs-trans), transform var(--wcs-trans);
}

.wcs-card-link:hover .wcs-card-circle {
  box-shadow: var(--wcs-shadow-lg);
  transform: translateY(-3px);
}

.wcs-card-circle img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14%;
  transition: transform .22s ease;
}

.wcs-card-link:hover .wcs-card-circle img {
  transform: scale(1.07);
}

.wcs-card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8edf7 100%);
}

.wcs-card-placeholder svg {
  width: 44%;
  height: 44%;
  opacity: .55;
  color: #7a90c0;
}

.wcs-card-name {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--wcs-text);
  transition: color var(--wcs-trans);
}

.wcs-card-link:hover .wcs-card-name {
  color: var(--wcs-navy);
}

.wcs-card-count {
  font-size: 11px;
  color: var(--wcs-muted);
  margin-top: -4px;
}

/* ─── LOADING ────────────────────────────────────── */
.wcs-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px;
}

.wcs-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--wcs-border);
  border-top-color: var(--wcs-yellow);
  border-radius: 50%;
  animation: wcs-spin .65s linear infinite;
}

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

/* ─── EMPTY ──────────────────────────────────────── */
.wcs-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px;
  color: var(--wcs-muted);
  font-size: 14px;
}

.wcs-empty a {
  color: var(--wcs-yellow-dark);
  font-weight: 600;
  text-decoration: none;
}

.wcs-empty a:hover {
  text-decoration: underline;
}

.wcs-error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 10px 14px;
  border-radius: var(--wcs-radius);
  font-size: 13px;
}

/* ─── SCROLL LOCK when overlay is open ────────────── */
html.wcs-no-scroll,
body.wcs-no-scroll {
  overflow: hidden !important;
  height: 100% !important;
}

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 1100px) {
  .wcs-cols-6 {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 900px) {
  .wcs-panel {
    width: 600px;
  }

  .wcs-cols-6,
  .wcs-cols-5 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 720px) {
  .wcs-panel {
    width: calc(100vw - 20px);
    left: 0;
    max-height: 420px;
  }

  .wcs-panel.open {
    flex-direction: column;
  }

  .wcs-sidebar {
    width: 100%;
    min-width: unset;
    max-height: 140px;
    border-right: none;
    border-bottom: 1px solid var(--wcs-border);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 0;
  }

  .wcs-sidebar-list {
    display: flex;
    flex-direction: row;
  }

  .wcs-sidebar-item {
    display: inline-flex;
  }

  .wcs-sidebar-link {
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 10px 14px;
    white-space: nowrap;
  }

  .wcs-sidebar-item.active .wcs-sidebar-link {
    border-left-color: transparent;
    border-bottom-color: var(--wcs-yellow);
  }

  .wcs-sidebar-arrow {
    display: none;
  }

  .wcs-main {
    padding: 16px;
    max-height: 280px;
  }

  .wcs-cols-6,
  .wcs-cols-5,
  .wcs-cols-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {

  .wcs-cols-6,
  .wcs-cols-5,
  .wcs-cols-4,
  .wcs-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}