:root{
  --bg:#ffffff;
  --text:#111;
  --muted:#666;
  --card-border: #e9e9e9;
  --accent:#111;
  font-family: "Cal Sans","Noto Sans",system-ui,Arial;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

*{box-sizing:border-box}

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  min-height:100vh;
  display:flex;
  flex-direction:column;
  gap:24px;
}

/* Header / Banner */
.site-header{width:100%}
.banner{
  display:block;
  padding:0;
  border-bottom:0;
  width:100%;
  overflow:visible; /* allow full banner to show */
  height:auto;
}
.banner img{
  width:100%;
  height:420px;          /* make banner taller to remove white gaps on desktop */
  max-height:60vh;
  object-fit:cover;      /* cover to avoid white gaps */
  object-position:center center;
  border-radius:0;
  display:block;
  flex:0 0 auto;
}
/* new description block under banner */
.store-desc{
  padding:20px 24px;
  border-bottom:1px solid var(--card-border);
  background:var(--bg);
}
.store-desc .desc-inner{
  max-width:1100px;
  margin:0 auto;
}
.store-desc h2{
  margin:0 0 8px;
  font-size:18px;
  font-weight:700;
}
.store-desc p{
  margin:8px 0;
  color:var(--muted);
  line-height:1.45;
  font-size:14px;
}

/* Categories */
.categories{
  display:flex;
  gap:8px;
  padding:12px 24px 20px;
  border-bottom:1px solid var(--card-border);
}
.cat-btn{
  background:transparent;
  border:1px solid transparent;
  padding:8px 12px;
  border-radius:8px;
  cursor:pointer;
  color:var(--muted);
  font-weight:600;
}
.cat-btn.active{
  color:var(--accent);
  border-color:var(--card-border);
  background:rgba(0,0,0,0.03);
}

/* pills row for category + tags */
.pills-row{ display:flex; gap:8px; align-items:center; margin-bottom:8px; flex-wrap:wrap; }
.tag-pill{
  display:inline-block;
  background:rgba(0,0,0,0.04);
  color:var(--muted);
  padding:6px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
}

/* Gallery grid */
.gallery{
  width:100%;
  display:grid;
  gap:20px;
  padding:24px;
  align-items:start;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Product card */
.card{
  position:relative;
  border:1px solid var(--card-border);
  border-radius:10px;
  overflow:hidden;
  background:#fff;
  transition:box-shadow .18s ease, transform .12s ease;
}
.card:hover{ box-shadow:0 8px 24px rgba(16,24,40,0.06); transform:translateY(-4px); }

/* make product image less dominating and ensure visible */
.card-media{
  position:relative;
  background:#fafafa;
  width:100%;
  /* replace fixed aspect padding with explicit height to allow precise top crop */
  padding-top:0;
  height:180px;
  overflow:hidden;
  display:flex;
  align-items:center; /* center image vertically so bottom isn't cropped */
  justify-content:center;
}
.card-media img{
  position:relative;
  width:100%;
  height:100%;
  object-fit:contain;
  object-position:center bottom;
  border-radius:0; /* keep image flush with container edges */
}

/* watermark across center diagonally */
.card-media .watermark{
  position:absolute;
  inset:0;
  pointer-events:none;
  display:flex;
  align-items:center;
  justify-content:center;
}
.card-media .watermark span{
  transform: rotate(-20deg);
  background: rgba(255,255,255,0.0);
  color: rgba(0,0,0,0.30); /* made watermark darker */
  font-weight:900;
  letter-spacing:3px;
  font-size:20px;
  padding:12px 40px;
  border-radius:6px;
  border:1px solid rgba(0,0,0,0.04);
  box-shadow: none;
  text-transform:uppercase;
}

/* Overlay button appears on hover */
.card-overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  pointer-events:none;
  background:linear-gradient(to top, rgba(0,0,0,0.18), rgba(0,0,0,0));
  opacity:0;
  transition:opacity .16s ease;
}
.card:hover .card-overlay{ opacity:1; pointer-events:auto; }

.view-btn{
  margin:12px;
  background:#111;
  color:#fff;
  text-decoration:none;
  padding:8px 12px;
  border-radius:8px;
  font-size:13px;
  display:inline-flex;
  gap:8px;
  align-items:center;
}

/* Card body */
.card-body{
  padding:12px 12px 16px;
}
.card-title{
  margin:0;
  font-size:14px;
  font-weight:700;
  color:var(--text);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.card-desc{
  margin:8px 0 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.3;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Empty state */
.empty-state{
  padding:40px;
  text-align:center;
  color:var(--muted);
}
.hidden{display:none}

/* Footer */
.site-footer{
  margin-top:auto;
  padding:18px 24px;
  border-top:1px solid var(--card-border);
  color:var(--muted);
  font-size:13px;
}

/* category pill on cards */
.cat-pill{
  display:inline-block;
  background:rgba(255,0,0,0.06);
  color:#c21; /* red tone for category */
  padding:6px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  margin-bottom:8px;
}

/* modal purchase */
.purchase-modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.45);
  z-index:1200;
}
.purchase-modal.active{ display:flex; }
.purchase-sheet{
  background:#fff;
  border-radius:10px;
  padding:18px;
  width:320px;
  max-width:92%;
  box-shadow:0 12px 36px rgba(16,24,40,0.12);
  color:var(--text);
}
.purchase-sheet h4{ margin:0 0 8px; font-size:15px; }
.purchase-sheet p{ margin:8px 0; color:var(--muted); font-size:14px; }
.purchase-actions{ display:flex; gap:8px; justify-content:flex-end; margin-top:12px; }
.btn-ghost{ background:transparent; border:1px solid var(--card-border); padding:8px 10px; border-radius:8px; cursor:pointer; }
.btn-primary{ background:#111; color:#fff; padding:8px 10px; border-radius:8px; border:0; cursor:pointer; }

/* add success style for enabled download button */
.btn-success{ background:#1a9a3a; color:#fff; border:0; padding:8px 10px; border-radius:8px; cursor:pointer; }

/* download / preview modal and confirmations for digital files */
.download-modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.65);
  z-index:1300;
}
.download-modal.active{ display:flex; }
.download-sheet{
  background:#fff;
  border-radius:10px;
  width:760px;
  max-width:96%;
  max-height:90vh;
  overflow:auto;
  padding:14px;
  box-shadow:0 18px 48px rgba(0,0,0,0.18);
}
.download-header{
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:8px;
}
.back-arrow{
  background:transparent;
  border:0;
  font-weight:800;
  font-size:20px;
  cursor:pointer;
  padding:6px 8px;
  color:var(--text);
}
.download-preview{
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.preview-img{
  width:320px;
  height:320px;
  background:#f6f6f6;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border-radius:6px;
  border:1px solid var(--card-border);
}
.preview-img img{ width:100%; height:100%; object-fit:contain; }
.download-info{ flex:1; }
.signature-row{ display:flex; gap:8px; align-items:center; margin-top:10px; }
.signature-row input{
  flex:1;
  padding:8px;
  border:1px solid var(--card-border);
  border-radius:8px;
  font-size:14px;
}
.confirm-box{ margin-top:12px; display:flex; gap:8px; justify-content:flex-end; }
.notice{ margin-top:12px; padding:10px; border-radius:8px; background:rgba(255,230,230,0.9); color:#8b0000; font-weight:700; }
/* small helper for inline stacked notices (to repeat message twice) */
.notice.duplicate{ margin-top:8px; }

/* linkish button */
.linkish{
  background:transparent;
  border:0;
  color:var(--muted);
  font-weight:700;
  cursor:pointer;
  padding:0;
}

/* auth notice */
.auth-notice{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.45);
  z-index:1600;
}
.auth-notice.active{ display:flex; }
.auth-card{
  width:320px;
  max-width:92%;
  background:#fff;
  color:var(--text);
  border-radius:10px;
  padding:14px 14px 12px;
  box-shadow:0 18px 48px rgba(0,0,0,0.18);
  position:relative;
}
.auth-close{
  position:absolute;
  top:8px;
  right:10px;
  background:transparent;
  border:0;
  font-size:18px;
  cursor:pointer;
  color:var(--muted);
}
/* small form inside */
.auth-card h4{ margin:0 0 8px; font-size:15px; }
.auth-card label{ display:block; font-size:13px; color:var(--muted); margin-top:8px; }
.auth-card input{ width:100%; padding:8px; border:1px solid var(--card-border); border-radius:8px; margin-top:6px; box-sizing:border-box; }

/* Contact / FAQ styles */
.contact-section{
  padding:24px;
  border-top:1px solid var(--card-border);
  background:var(--bg);
}
.contact-inner{ max-width:1100px; margin:0 auto; }
.contact-section h2{ margin:0 0 12px; font-size:18px; font-weight:700; color:var(--text); }
.faq-grid{ display:grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap:12px; margin-bottom:16px; }
.faq{ background:rgba(0,0,0,0.03); padding:12px; border-radius:8px; color:var(--muted); }
.faq h4{ margin:0 0 6px; font-size:14px; color:var(--text); font-weight:700; }
.contact-form label{ display:block; margin-top:8px; font-size:13px; color:var(--muted); }
.contact-form input, .contact-form textarea{
  width:100%; padding:10px; margin-top:6px; border:1px solid var(--card-border); border-radius:8px; font-size:14px; box-sizing:border-box;
}
#contactNotice .notice{ margin-top:0; }

/* ensure footer button spacing */
.site-footer .linkish + .linkish { margin-left:12px; }

/* Responsive adjustments */
@media (min-width:1100px){
  .gallery{grid-template-columns: repeat(4, 1fr); padding:40px;}
  .card-media{ height:220px; }
}
@media (min-width:760px) and (max-width:1099px){
  .gallery{grid-template-columns: repeat(3,1fr); padding:32px;}
  .card-media{ height:200px; }
}
@media (max-width:759px){
  .banner img{ width:100%; height:220px; object-fit:cover; }
  .banner-title h1{font-size:18px}
  .gallery{grid-template-columns: repeat(2,1fr); padding:16px; gap:12px;}
  .card-media{ height:140px; }

  /* make categories wrap into two rows with explicit widths:
     first three buttons become thirds, last two become halves on second row */
  .categories{
    flex-wrap:wrap;
    gap:8px;
  }
  .categories .cat-btn{ flex:0 0 auto; min-width:0; }
  .categories .cat-btn:nth-child(-n+3){ width: calc((100% - 16px) / 3); } /* first 3: 3 columns */
  .categories .cat-btn:nth-child(n+4){ width: calc((100% - 8px) / 2); } /* remaining: 2 columns */

  /* Stack digital file buttons vertically on mobile and make them full width to avoid clipping */
  .card-media .card-overlay > div {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
  .card-media .card-overlay .view-btn {
    width: 100%;
    justify-content: center;
    padding:10px 12px;
  }

  /* ensure download modal preview stacks and image is visible on small screens */
  .download-sheet{ width:92%; padding:12px; }
  .download-preview{ flex-direction:column; gap:12px; align-items:center; }
  .preview-img{ width:100%; height:260px; max-height:40vh; }
  .preview-img img{ width:100%; height:100%; object-fit:contain; }

}

/* ensure .notice dialogs appear centered in the viewport (override if created dynamically) */
.notice{
  /* inline notification, appears in normal document flow (e.g. below Comprar / inside modal) */
  position:relative;
  left:auto;
  top:auto;
  transform:none;
  z-index:auto;
  max-width:100%;
  box-shadow:none;
  margin-top:12px;
}
/* small helper for inline stacked notices (to repeat message twice) */
.notice.duplicate{ margin-top:8px; }

.filters-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 24px;
  border-bottom:1px solid var(--card-border);
  max-width:1100px;
  margin:0 auto;
}
/* hide public filters/metrics by default (only shown to moderator via JS) */
#filtersRow { display: none; }

/* responsive */
@media (max-width:759px){
  .filters-row{ padding:10px 16px; flex-direction:column; align-items:stretch; gap:10px; }
  .filter-right{ justify-content:space-between; align-items:flex-start; }
  .yt-metrics{ width:100%; overflow:auto; }
}
.yt-metrics{ display:flex; gap:12px; align-items:center; background:transparent; }
.yt-metric{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  padding:8px 12px;
  border-radius:8px;
  background:rgba(0,0,0,0.03);
  min-width:110px;
}
.yt-metric .val{ font-weight:800; font-size:16px; color:var(--text); }
.yt-metric .label{ font-size:12px; color:var(--muted); margin-top:4px; }
.filter-left{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.filter-label{ font-weight:700; font-size:13px; color:var(--muted); margin-right:6px; }
.select-filter{ padding:8px 10px; border:1px solid var(--card-border); border-radius:8px; background:#fff; font-size:13px; }
.filter-right{ display:flex; gap:12px; align-items:center; }
.timeframes{ display:flex; gap:8px; flex-wrap:wrap; }
.tf-btn{ padding:8px 10px; border-radius:8px; border:1px solid var(--card-border); background:transparent; cursor:pointer; font-size:13px; color:var(--muted); }
.tf-btn.active{ background:rgba(0,0,0,0.06); color:var(--text); border-color:rgba(0,0,0,0.08); }