/* General catalog styles */
.fc-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

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

/* Card wrapper */
.fc-card {
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}
.fc-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Inner body */
.fc-card-body {
  padding: 12px;
}

/* Titles and descriptions */
.fc-card-title {
  font-size: 1.1em;
  margin: 0 0 8px;
}
.fc-card-title a {
  text-decoration: none;
  color: inherit;
}
.fc-card-desc {
  font-size: 0.9em;
  color: #555;
  margin: 0;
}

/* Status overlay badges (hidden/soon) */
.fc-card.fc-status-hidden,
.fc-card.fc-status-soon {
  position: relative;
  opacity: 0.6;
}
.fc-card.fc-status-hidden::after,
.fc-card.fc-status-soon::after {
  content: attr(data-status-label);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #333;
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.9em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Layout variations (class applied on .fc-catalog: fc-layout1/2/3) */
.fc-catalog.fc-layout1 .fc-card { text-align: center; }
.fc-catalog.fc-layout1 .fc-card-body { padding: 12px; }

.fc-catalog.fc-layout2 .fc-card-body { padding: 12px; }
.fc-catalog.fc-layout2 .fc-card-thumb { margin: -12px -12px 8px -12px; }
.fc-catalog.fc-layout2 .fc-card-thumb img.fc-thumb {
  width: 100%;
  height: auto;
  display: block;
}

/* Ensure list-like layout is applied to the catalog grid container */
.fc-catalog.fc-layout3 { grid-template-columns: 1fr; }
.fc-catalog.fc-layout3 .fc-card {
  border: none;
  border-bottom: 1px solid #eee;
  border-radius: 0;
}
.fc-catalog.fc-layout3 .fc-card-body { padding: 8px 0; }
.fc-catalog.fc-layout3 .fc-card-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fc-catalog.fc-layout3 img.fc-thumb-small {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Thumbnail helpers (used by PHP branching) */
.fc-card-thumb { margin-bottom: 8px; }
.fc-card-thumb img { width: 100%; height: auto; display: block; }
.fc-thumb { display: block; width: 100%; height: auto; }
.fc-thumb-small { display: block; width: 50px; height: 50px; object-fit: cover; }

/* Single item page */
.fc-single {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
}
.fc-title {
  font-size: 1.6em;
  margin-bottom: 16px;
}
.fc-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.fc-gallery-item {
  flex: 1 1 200px;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}
.fc-gallery-item img {
  width: 100%;
  height: auto;
  cursor: zoom-in;
}
.fc-description { margin-bottom: 20px; }

/* Actions (e.g., wishlist buttons) */
.fc-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}
.fc-actions .button,
.fc-actions button {
  padding: 8px 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: #333;
  color: #fff;
  transition: background 0.2s ease;
}
.fc-actions .button:hover,
.fc-actions button:hover {
  background: #555;
}
.fc-view-wishlist { margin-left: 8px; }

/* Wishlist page */
.fc-wishlist-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}
.fc-wishlist-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
}
.fc-wishlist-actions .button,
.fc-wishlist-actions button {
  padding: 8px 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: #333;
  color: #fff;
}
.fc-wishlist-actions .button:hover,
.fc-wishlist-actions button:hover {
  background: #555;
}

/* Wishlist list rendering */
.fc-wishlist-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.fc-wi {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.fc-wi .fc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 16px;
  background: #fff;
  font-size: 0.9em;
}

/* Model selector (single item page) */
.fc-model-selector {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fafafa;
}
.fc-model-heading {
  margin: 0 0 12px;
  font-size: 1.1rem;
}
.fc-model-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.fc-model-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #ddd;
  border-radius: 18px;
  padding: 6px 10px;
  background: #fff;
  cursor: pointer;
}
.fc-model-chip input {
  accent-color: #333;
}
.fc-chip-label {
  font-size: 0.95em;
}
.fc-model-whole {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #333;
}

/* Zoom overlay */
.fc-overlay {
  position: fixed;
  top:0; left:0; right:0; bottom:0;
  background: rgba(0,0,0,0.8);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
}
.fc-overlay img.fc-zoomed {
  max-width:90%;
  max-height:90%;
}
.fc-overlay:focus { outline: 2px solid #fff; }

/* Bold, red excerpts (items and categories) */
.fc-desc-strong strong {
  color: #c00;
  font-weight: 700;
}

/* Safety net: ensure non-clickable cards really cannot be clicked */
.fc-card.fc-status-hidden a,
.fc-card.fc-status-soon a {
  pointer-events: none;
  cursor: default;
}

/* Featured image adjustments on single item page */
.fc-single .fc-featured {
  display: block;
  max-width: 800px;
  height: auto;
  margin: 60px auto 20px auto;
  cursor: zoom-in;
}

/* If WP admin bar is visible, add extra spacing */
body.admin-bar .fc-single .fc-featured {
  margin-top: 80px;
}

/* Actions row split: buttons left, language selector right */
.fc-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fc-actions-left {
  display: flex;
  gap: 12px;
  align-items: center;
}

.fc-lang-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fc-lang-label {
  font-size: 0.9em;
  color: #333;
}

.fc-lang-flag {
  text-decoration: none;
  font-size: 1.3em;
  line-height: 1;
  transition: color 0.2s ease;
}

.fc-lang-flag:hover {
  color: #666;
}

.fc-lang-flag.active {
  text-decoration: underline;
  font-weight: bold;
  color: #c00;
}

/* Excerpt/comment under the gallery */
.fc-thumb-comment {
  text-align: center;
  margin-top: 10px;
  font-size: 0.95em;
  color: #555;
  font-style: italic;
}

/* Centered status message when item is not visible */
.fc-status-message {
  text-align: center;
  margin: 24px 0;
  font-size: 1rem;
  font-weight: 600;
  color: #444;
}

/* Layout4 titles and items */
.fc-subcategory-row { margin-bottom: 40px; }
.fc-subcategory-title {
  text-align: center;
  font-weight: bold;
  font-size: 1.2em;
  margin-bottom: 20px;
}
.fc-subcategory-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

/* Title above each row */
.fc-layout4 .fc-subcat-title {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  text-transform: uppercase;
  margin: 2rem 0 1rem;
  text-align: center;
}
.fc-layout4 .fc-subcat-title::before,
.fc-layout4 .fc-subcat-title::after {
  content: "";
  flex: 1;
  border-bottom: 2px solid #333;
  margin: 0 1rem;
}
.fc-layout4 .fc-card-title {
  text-transform: uppercase;
  text-align: center;
  font-weight: 600;
}

/* Items container: responsive row */
.fc-layout4 .fc-subcat-items {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Each card adapts to screen width */
.fc-layout4 .fc-subcat-items .fc-card {
  flex: 1 1 calc(25% - 1rem);
  max-width: 240px;
  box-sizing: border-box;
}

.fc-layout4 .fc-thumb-row {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

@media (max-width: 1024px) {
  .fc-layout4 .fc-subcat-items .fc-card { flex: 1 1 calc(33.333% - 1rem); }
}
@media (max-width: 768px) {
  .fc-layout4 .fc-subcat-items .fc-card { flex: 1 1 calc(50% - 1rem); }
}
@media (max-width: 480px) {
  .fc-layout4 .fc-subcat-items .fc-card { flex: 1 1 100%; }
}

/* Spacer between groups */
.fc-layout4 .fc-subcat-spacer { height: 2rem; }

/* Override global grid for layout4 */
.fc-catalog.fc-layout4 {
  display: block;
  grid-template-columns: none;
  gap: 0;
}

/* Navigation under gallery items */
.fc-gallery .fc-gallery-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fc-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fafafa;
}

.fc-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  color: #1a1a1a;
  background: #ffffff;
  border: 1px solid #ddd;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

/* Hover/active only for real links */
a.fc-nav-btn:hover {
  background-color: #f2f2f2;
  border-color: #cfcfcf;
}
a.fc-nav-btn:active {
  transform: translateY(1px);
}

/* Disabled placeholder state (spans only) */
span.fc-nav-btn.fc-nav-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f7f7f7;
  border-color: #e6e6e6;
  pointer-events: none; /* block clicks only on disabled spans */
}

/* Ensure active nav links are clickable */
a.fc-nav-btn {
  pointer-events: auto;
  cursor: pointer;
}

.fc-nav-icon {
  font-size: 1rem;
  line-height: 1;
}
.fc-nav-text {
  font-size: 0.95rem;
}

/* Responsive stack for small screens */
@media (max-width: 640px) {
  .fc-nav {
    flex-direction: row;
    gap: 8px;
    padding: 8px 10px;
  }
  .fc-nav-btn {
    flex: 1 1 auto;
    justify-content: center;
    padding: 10px 12px;
  }
  .fc-nav-text {
    font-size: 1rem;
  }
}
