/* ==========================================================================
   Templates Studio — catalogul de vanzare
   Tema proprie, independenta de template-uri.
   ========================================================================== */

:root {
  --brand-h: 258;
  --brand-s: 68%;
  --brand-l: 56%;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-md: 9px;
  --r-lg: 16px;
  --r-xl: 24px;
}

/* ---------- Hero ---------- */
.g-hero { padding-block: clamp(3rem, 1.5rem + 6vw, 6rem) clamp(2rem, 1rem + 4vw, 4rem); }
.g-hero h1 { font-size: var(--fs-5xl); max-width: 16ch; }
.g-hero h1 em { font-style: italic; font-weight: 400; color: var(--brand); }
.g-hero .lead { margin-top: var(--s-5); font-size: var(--fs-lg); }

.g-trust { display: flex; flex-wrap: wrap; gap: var(--s-6); margin-top: var(--s-7); padding-top: var(--s-6); border-top: 1px solid var(--border); }
.g-trust div { display: flex; gap: var(--s-3); align-items: center; font-size: var(--fs-sm); color: var(--text-muted); }
.g-trust svg { color: var(--brand); flex: none; }

/* ---------- Bara de filtre ---------- */
.g-filters {
  position: sticky; top: 74px; z-index: 50;
  padding-block: var(--s-4);
  background: var(--bg);
  border-block: 1px solid var(--border);
}
@supports (backdrop-filter: blur(1px)) {
  .g-filters { background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); }
}
.g-filters-inner { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; justify-content: space-between; }
.g-cats { display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.g-cats::-webkit-scrollbar { display: none; }
.g-search { position: relative; min-width: 200px; }
.g-search .input { padding-left: 2.4rem; }
.g-search svg { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--text-subtle); pointer-events: none; }

/* ---------- Grila de template-uri ---------- */
.g-grid { display: grid; gap: var(--s-6); }
@media (min-width: 720px)  { .g-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .g-grid { grid-template-columns: repeat(3, 1fr); } }

.g-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
}
.g-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.g-card.is-hidden { display: none; }

.g-card-media { position: relative; aspect-ratio: 16/11; background: var(--bg-muted); overflow: hidden; }
.g-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow); }

/* Miniatura live: iframe de 1440 px micsorat prin transform (scala pusa din JS). */
.g-shot { position: absolute; inset: 0; overflow: hidden; background: #fff; }
.g-shot iframe {
  position: absolute; top: 0; left: 0;
  width: 1440px; height: 990px;
  border: 0; transform-origin: 0 0;
  pointer-events: none;   /* click-ul apartine cardului, nu paginii dinauntru */
}

.g-card-overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center; gap: var(--s-3);
  background: hsl(258 30% 12% / .55);
  opacity: 0; transition: opacity var(--t-base);
}
.g-card:hover .g-card-overlay, .g-card-overlay:focus-within { opacity: 1; }
@media (hover: none) { .g-card-overlay { opacity: 1; background: hsl(258 30% 12% / .3); } }

.g-card-flags { position: absolute; top: var(--s-3); left: var(--s-3); display: flex; gap: var(--s-2); z-index: 2; }

.g-card-body { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-5); flex: 1; }
.g-card-top { display: flex; justify-content: space-between; gap: var(--s-3); align-items: baseline; }
.g-card-body h3 { font-size: var(--fs-xl); }
.g-card-price { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 600; white-space: nowrap; }
.g-card-price small { font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 400; color: var(--text-subtle); display: block; text-align: right; }
.g-card-desc { font-size: var(--fs-sm); color: var(--text-muted); }
.g-card-tags { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: auto; padding-top: var(--s-4); }
.g-card-foot { display: flex; gap: var(--s-2); padding: 0 var(--s-5) var(--s-5); }
.g-card-foot .btn { flex: 1; }

/* ---------- Preturi ---------- */
.g-plans { display: grid; gap: var(--s-5); }
@media (min-width: 860px) { .g-plans { grid-template-columns: repeat(3, 1fr); } }
.g-plan { display: flex; flex-direction: column; gap: var(--s-4); position: relative; }
.g-plan.is-featured { border-color: var(--brand); box-shadow: var(--shadow-lg); }
.g-plan-badge {
  position: absolute; top: calc(var(--s-4) * -1); left: 50%; transform: translateX(-50%);
  background: var(--brand); color: var(--brand-ink);
  padding: .3rem .8rem; border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: 700; white-space: nowrap;
}
.g-plan-price { font-family: var(--font-display); font-size: var(--fs-4xl); font-weight: 600; line-height: 1; }
.g-plan-price small { font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 400; color: var(--text-muted); }
.g-plan ul { display: flex; flex-direction: column; gap: var(--s-3); font-size: var(--fs-sm); }
.g-plan li { display: flex; gap: var(--s-3); align-items: flex-start; }
.g-plan li svg { color: var(--brand); flex: none; margin-top: 2px; }
.g-plan .btn { margin-top: auto; }

/* ---------- Comparatie ---------- */
.g-compare td:first-child { font-weight: 500; }
.g-compare .yes { color: var(--success); font-weight: 600; }
.g-compare .no { color: var(--text-subtle); }

/* ---------- Preview cu iframe ---------- */
.g-preview { position: fixed; inset: 0; z-index: 300; display: none; flex-direction: column; background: var(--bg); }
.g-preview.is-open { display: flex; }
.g-preview-bar {
  display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between;
  padding: var(--s-3) var(--gutter); border-bottom: 1px solid var(--border); flex: none;
}
.g-preview-title { font-weight: 600; font-size: var(--fs-sm); }
.g-preview-frame { flex: 1; border: 0; width: 100%; background: var(--bg-muted); }
.g-device { display: flex; gap: var(--s-1); }
.g-device button { padding: .4rem .7rem; border-radius: var(--r-md); font-size: var(--fs-xs); font-weight: 600; color: var(--text-subtle); }
.g-device button[aria-pressed="true"] { background: var(--solid); color: var(--solid-ink); }
.g-preview-stage { flex: 1; display: grid; place-items: center; overflow: auto; background: var(--bg-muted); padding: var(--s-4); }
.g-preview-stage .g-preview-frame { border-radius: var(--r-md); box-shadow: var(--shadow-lg); background: #fff; }
.g-preview-stage[data-device="mobile"]  .g-preview-frame { width: 390px; height: 100%; max-height: 844px; }
.g-preview-stage[data-device="tablet"]  .g-preview-frame { width: 820px; height: 100%; max-height: 1100px; }
.g-preview-stage[data-device="desktop"] .g-preview-frame { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
.g-preview-stage[data-device="desktop"] { padding: 0; }

/* ---------- Gol ---------- */
.g-empty { text-align: center; padding-block: var(--s-10); }
.g-empty .icon-box { margin-inline: auto; }
.g-empty > * + * { margin-top: var(--s-4); }
