/* css/pages/shop.css
   Page-specific styles for pages/shop.html (Gonotes)
   Works with global styles.css variables and components
*/

/* ---------- Page hero / header area inside shop ---------- */
.shop-hero {
  padding: 28px 0;
  background: #fff;
  margin-bottom: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(16,24,40,0.03);
}

/* shop header container */
.shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

/* title block */
.shop-header h2 {
  margin: 0 0 6px;
  font-family: Georgia, serif;
  font-size: 26px;
  color: #1f1b18;
}
.shop-header p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Controls (filters + search) ---------- */
.shop-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* label styling */
.filter-label {
  display: inline-block;
  font-weight: 700;
  font-size: 13px;
  color: #444;
  margin-right: 6px;
}

/* selects and search */
.select, .search {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ebe6df;
  background: #fff;
  font-size: 14px;
  min-height: 40px;
}

.select { min-width: 160px; }

/* search field in shop */
#shopSearch.search {
  min-width: 240px;
  width: 280px;
}

/* reset button */
#resetFilters.btn {
  background: #fff;
  color: var(--accent);
  border: 1px solid #e5e7eb;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}
#resetFilters.btn:hover { background: #faf9f7; }

/* small helper row beneath controls (optional) */
.shop-controls-meta {
  width:100%;
  margin-top:8px;
  color:var(--muted);
  font-size:13px;
}

/* ---------- Grid / cards (generic .card) ---------- */
.grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 22px;
}

/* Original .card layout (fallback) */
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 260px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(0,0,0,0.06); }

.card .thumb {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: linear-gradient(180deg,#f6f4f2,#efebe6);
}

.card h3 { margin: 0; font-size: 16px; font-weight: 700; font-family: Georgia, serif; color: #1f1b18; }
.card .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.card .desc { color: #58524a; font-size: 13px; margin-top: 8px; line-height:1.4; }

.card .price { font-weight: 800; color: #115e59; font-size: 16px; }
.card .card-actions { display:flex; gap:8px; align-items:center; justify-content:space-between; margin-top:auto; }

.small {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e9e2d9;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.small:hover { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }

.add-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
}

/* empty state */
.empty {
  color: var(--muted);
  padding: 36px 0;
  text-align: center;
  font-size: 16px;
}

/* ---------- Template-driven note-card (new) ---------- */
/* note-card - a cleaner, image-first card (matches provided HTML template) */
.note-card {
  background: var(--card, #fff);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow, 0 6px 18px rgba(0,0,0,0.04));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  font-family: "Georgia", "Times New Roman", serif;
  transition: transform .18s ease, box-shadow .18s ease;
  min-height: 320px;
}
.note-card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(0,0,0,0.06); }

.card-media {
  position: relative;
  padding: 8px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f6f5f3, #fff);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 240px;
  margin-bottom: 14px;
}
.card-image {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
}

/* discount badge (top-left) */
.discount-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 20px;
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
}

/* preview button overlay (bottom-right) */
.preview-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(255,255,255,0.96);
  border: 1px solid #eee;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

/* card body & typography */
.card-body .card-title,
.note-card .card-body .card-title {
  font-size: 18px;
  margin: 0 0 8px;
  color: var(--accent, #6b5b2e);
  letter-spacing: 0.2px;
}
.card-subtitle {
  font-size: 13px;
  color: #8b8b8b;
  margin-bottom: 12px;
}

/* price row for note-card */
.price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.original-price {
  color: #9b9b9b;
  text-decoration: line-through;
  font-size: 14px;
}
.discounted-price {
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
}

/* actions for note-card */
.card-actions, .note-card .card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}
.btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #e9e2d9;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}
.btn.primary, .btn.add-primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

/* ---------- Preview & Cart modal tweaks ---------- */
.modal-content { max-width: 880px; padding: 20px; }
.preview-embed { width:100%; height:480px; border-radius:8px; border:1px solid #eee; }

.cart-item { display:flex; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px dashed #efefef; }
.cart-item .meta { font-size:13px; color:var(--muted); }

/* ---------- Floating cart button badge ---------- */
/* The openCartBtn will get a data-count attribute (JS sets it). We show it using ::after */
#openCartBtn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1100;
  border-radius: 999px;
  width: 54px;
  height: 54px;
  display:flex;align-items:center;justify-content:center;
  background: var(--accent); color:#fff; border:none; box-shadow:0 6px 18px rgba(0,0,0,0.12);
  font-size: 20px;
}
#openCartBtn::after {
  content: attr(data-count);
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ff4b4b;
  color: #fff;
  min-width: 20px;
  height: 20px;
  font-size: 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  transform: translate(0, 0);
  /* hide when no data-count */
  opacity: 1;
}
#openCartBtn:not([data-count])::after { display: none; }

/* ---------- Utilities ---------- */
.visually-hidden { position:absolute !important; height:1px; width:1px; overflow:hidden; clip:rect(1px,1px,1px,1px); white-space:nowrap; }

/* ---------- Responsive adjustments ---------- */
@media (max-width: 900px) {
  #shopSearch.search { width: 100%; min-width: 0; }
  .select { min-width: 140px; }
  .shop-header h2 { font-size: 22px; }
  .grid { gap: 16px; }
  .card .thumb { height: 140px; }
  .note-card { min-height: 280px; }
  .card-media { min-height: 200px; }
}

@media (max-width: 600px) {
  .shop-header { flex-direction: column; align-items: flex-start; gap:12px; }
  .shop-controls { width:100%; display:flex; flex-direction:column; gap:10px; }
  .shop-controls .select, .shop-controls .search, #resetFilters { width: 100%; }
  .card { min-height: auto; padding: 14px; }
  .note-card { min-height: auto; padding: 14px; }
  #openCartBtn { right: 12px; bottom: 12px; width:48px; height:48px; }
  #openCartBtn::after { top: -4px; right: -4px; min-width:18px; height:18px; font-size:11px; }
}

/* ======================================
   SHOP PAGE — DARK MODE (BLUE + RED)
   Clean • Modern • Tech Feel
====================================== */

body.dark .shop-hero {
  background:
    radial-gradient(900px 400px at 10% -20%, rgba(59,130,246,0.18), transparent 45%),
    radial-gradient(700px 350px at 90% 0%, rgba(239,68,68,0.15), transparent 45%),
    #000;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06);
}

/* Header */
body.dark .shop-header h2 {
  color: #f9fafb;
  text-shadow:
    0 0 18px rgba(59,130,246,0.25),
    0 0 28px rgba(239,68,68,0.15);
}

body.dark .shop-header p {
  color: #9ca3af;
}

/* =========================
   CONTROLS (FILTERS)
========================= */
body.dark .filter-label {
  color: #cbd5f5;
}

body.dark .select,
body.dark .search {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.14);
  color: #e5e7eb;
  backdrop-filter: blur(10px);
}

body.dark .select:focus,
body.dark .search:focus {
  border-color: #3b82f6;
  box-shadow:
    0 0 0 2px rgba(59,130,246,0.35),
    0 0 16px rgba(59,130,246,0.25);
}

body.dark #resetFilters.btn {
  background: rgba(255,255,255,0.05);
  color: #93c5fd;
  border-color: rgba(255,255,255,0.14);
}
body.dark #resetFilters.btn:hover {
  background: rgba(59,130,246,0.15);
}

/* =========================
   GRID CARDS (GENERIC)
========================= */
body.dark .card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.95));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 45px rgba(0,0,0,0.85);
}

body.dark .card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow:
    0 30px 70px rgba(0,0,0,0.95),
    0 0 35px rgba(59,130,246,0.25);
}

body.dark .card h3 {
  color: #f9fafb;
}

body.dark .card .desc {
  color: #9ca3af;
}

body.dark .card .meta {
  color: #94a3b8;
}

body.dark .card .price {
  color: #60a5fa;
}

/* =========================
   NOTE CARD (PREMIUM)
========================= */
body.dark .note-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.95));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 50px rgba(0,0,0,0.9);
}

body.dark .card-media {
  background:
    radial-gradient(circle at center,
      rgba(59,130,246,0.22),
      rgba(0,0,0,0.95)
    );
}

body.dark .card-body .card-title {
  color: #93c5fd;
}

body.dark .card-subtitle {
  color: #9ca3af;
}

/* discount badge */
body.dark .discount-badge {
  background: linear-gradient(135deg, #3b82f6, #ef4444);
  box-shadow: 0 0 14px rgba(59,130,246,0.6);
}

/* preview button */
body.dark .preview-btn {
  background: rgba(0,0,0,0.7);
  color: #e5e7eb;
  border-color: rgba(255,255,255,0.15);
}

/* =========================
   ACTION BUTTONS
========================= */
body.dark .btn {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.14);
  color: #e5e7eb;
}

body.dark .btn:hover {
  background: rgba(59,130,246,0.15);
}

body.dark .btn.primary,
body.dark .btn.add-primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1, #ef4444);
  color: #fff;
  box-shadow:
    0 8px 24px rgba(59,130,246,0.5),
    inset 0 -2px 0 rgba(0,0,0,0.35);
}

body.dark .btn.primary:hover {
  box-shadow:
    0 14px 38px rgba(239,68,68,0.55),
    0 0 30px rgba(59,130,246,0.45);
}

/* =========================
   FLOATING CART BUTTON
========================= */
body.dark #openCartBtn {
  background: linear-gradient(135deg, #3b82f6, #ef4444);
  box-shadow:
    0 12px 30px rgba(59,130,246,0.55),
    0 0 30px rgba(239,68,68,0.35);
}

body.dark #openCartBtn::after {
  background: #ef4444;
}
