/* =========================================================
   Product Front End — Clean light theme
   Scoped under .pfe-* so it won't collide with Divi.
   ========================================================= */

:root {
  --pfe-bg:        #ffffff;
  --pfe-surface:   #f7f7f5;
  --pfe-border:    #e4e4e0;
  --pfe-text:      #1a1a1a;
  --pfe-muted:     #6b6b6b;
  --pfe-accent:    #1a1a1a;
  --pfe-accent-ink:#ffffff;
  --pfe-radius:    10px;
  --pfe-shadow:    0 1px 3px rgba(0,0,0,.06), 0 6px 24px rgba(0,0,0,.05);
  --pfe-maxw:      1180px;
}

.pfe-wrap {
  max-width: var(--pfe-maxw);
  margin: 0 auto;
  padding: 48px 24px 80px;
  color: var(--pfe-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Toolbar (search + category filter) ---------- */
.pfe-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}
.pfe-search {
  display: flex;
  gap: 8px;
  flex: 1 1 320px;
}
.pfe-search input[type="search"] {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--pfe-border);
  border-radius: var(--pfe-radius);
  font-size: 15px;
  background: var(--pfe-bg);
  color: var(--pfe-text);
}
.pfe-search input[type="search"]:focus {
  outline: none;
  border-color: var(--pfe-accent);
}
.pfe-search button {
  padding: 12px 22px;
  border: none;
  border-radius: var(--pfe-radius);
  background: var(--pfe-accent);
  color: var(--pfe-accent-ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Category chips ---------- */
.pfe-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pfe-cats a {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--pfe-border);
  border-radius: 999px;
  font-size: 13.5px;
  text-decoration: none;
  color: var(--pfe-muted);
  background: var(--pfe-bg);
  transition: all .15s ease;
}
.pfe-cats a:hover { border-color: var(--pfe-accent); color: var(--pfe-text); }
.pfe-cats a.is-active {
  background: var(--pfe-accent);
  color: var(--pfe-accent-ink);
  border-color: var(--pfe-accent);
}
.pfe-cats a .pfe-count { opacity: .55; margin-left: 4px; font-size: 12px; }

/* ---------- Archive grid ---------- */
.pfe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 28px;
}
.pfe-card {
  background: var(--pfe-bg);
  border: 1px solid var(--pfe-border);
  border-radius: var(--pfe-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.pfe-card:hover { transform: translateY(-3px); box-shadow: var(--pfe-shadow); }
.pfe-card a { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }
.pfe-thumb {
  aspect-ratio: 4 / 3;
  background: var(--pfe-surface);
  overflow: hidden;
}
.pfe-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pfe-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--pfe-muted); font-size: 13px;
}
.pfe-card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pfe-card-title { font-size: 16px; font-weight: 600; line-height: 1.3; }
.pfe-card-price { font-size: 15px; color: var(--pfe-muted); margin-top: auto; padding-top: 8px; }

/* ---------- Single product ---------- */
.pfe-single {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 820px) {
  .pfe-single { grid-template-columns: 1fr; gap: 32px; }
}

/* Slideshow */
.pfe-slideshow { position: relative; border-radius: var(--pfe-radius); overflow: hidden; background: var(--pfe-surface); border: 1px solid var(--pfe-border); }
.pfe-slides { position: relative; aspect-ratio: 1 / 1; }
.pfe-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity .4s ease;
  display: flex; align-items: center; justify-content: center;
}
.pfe-slide.is-active { opacity: 1; }
.pfe-slide img { width: 100%; height: 100%; object-fit: cover; }
.pfe-slide-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.9);
  color: var(--pfe-text); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.pfe-slide-nav:hover { background: #fff; }
.pfe-slide-nav.prev { left: 12px; }
.pfe-slide-nav.next { right: 12px; }
.pfe-dots { display: flex; gap: 8px; justify-content: center; padding: 14px 0 4px; }
.pfe-dot { width: 9px; height: 9px; border-radius: 50%; border: none; background: var(--pfe-border); cursor: pointer; padding: 0; }
.pfe-dot.is-active { background: var(--pfe-accent); }
.pfe-thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.pfe-thumbs button { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; cursor: pointer; padding: 0; background: var(--pfe-surface); }
.pfe-thumbs button.is-active { border-color: var(--pfe-accent); }
.pfe-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.pfe-single-info h1 { font-size: 30px; line-height: 1.15; margin: 0 0 12px; }
.pfe-single-price { font-size: 24px; font-weight: 600; margin: 0 0 20px; }
.pfe-single-desc { font-size: 16px; line-height: 1.7; color: #2c2c2c; white-space: pre-wrap; }
.pfe-single-cats { margin: 22px 0 0; font-size: 14px; color: var(--pfe-muted); }
.pfe-single-cats a { color: var(--pfe-text); text-decoration: underline; text-underline-offset: 2px; }

/* Inquiry */
.pfe-inquiry { margin-top: 40px; padding-top: 36px; border-top: 1px solid var(--pfe-border); }
.pfe-inquiry h2 { font-size: 20px; margin: 0 0 18px; }
.pfe-inquiry-toggle {
  display: inline-block; padding: 13px 26px; border: none;
  border-radius: var(--pfe-radius); background: var(--pfe-accent);
  color: var(--pfe-accent-ink); font-size: 15px; font-weight: 600; cursor: pointer;
}
.pfe-modal { display: none; position: fixed; inset: 0; z-index: 9999; align-items: flex-start; justify-content: center; padding: 6vh 16px; background: rgba(0,0,0,.45); overflow-y: auto; }
.pfe-modal.is-open { display: flex; }
.pfe-modal-box { background: #fff; border-radius: var(--pfe-radius); max-width: 560px; width: 100%; padding: 32px 32px 36px; position: relative; box-shadow: var(--pfe-shadow); }
.pfe-modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--pfe-muted); line-height: 1; }

/* Misc */
.pfe-empty { text-align: center; padding: 80px 20px; color: var(--pfe-muted); }
.pfe-pagination { margin-top: 48px; display: flex; gap: 8px; justify-content: center; }
.pfe-pagination a, .pfe-pagination span { padding: 9px 15px; border: 1px solid var(--pfe-border); border-radius: 8px; text-decoration: none; color: var(--pfe-text); font-size: 14px; }
.pfe-pagination .current { background: var(--pfe-accent); color: var(--pfe-accent-ink); border-color: var(--pfe-accent); }
.pfe-back { display: inline-block; margin-bottom: 24px; font-size: 14px; color: var(--pfe-muted); text-decoration: none; }
.pfe-back:hover { color: var(--pfe-text); }
