/* ============================================================
   PJ ONLINE STORE
   SUNSET FOREST → MIDNIGHT FOREST
   Glassmorphism Design
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,600;0,700;1,600&family=Quicksand:wght@500;600;700&family=Permanent+Marker&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
button, input, select { font: inherit; }

:root {
  --bg-start: #F5B942;
  --bg-mid: #F2894A;
  --bg-end: #B85C3E;
  --scrim: rgba(20, 10, 5, 0.30);

  --glass: rgba(255, 255, 255, 0.16);
  --glass-light: rgba(255, 255, 255, 0.24);
  --glass-hover: rgba(255, 255, 255, 0.28);
  --glass-border: rgba(255, 255, 255, 0.30);

  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.82);
  --hairline: rgba(255, 255, 255, 0.28);

  /* accent = readable text/price color; accent-2 = soft glow-only tone */
  --accent: #A8570B;
  --accent-2: #FFD166;

  --whatsapp: #25D366;
  --blur: blur(18px);

  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Quicksand', sans-serif;
  --font-mono: 'Quicksand', sans-serif;
  --font-brush: 'Permanent Marker', cursive;
}

[data-theme="dark"] {
  --bg-start: #07152B;
  --bg-mid: #05091B;
  --bg-end: #000000;
  --scrim: rgba(0, 0, 12, 0.55);

  --glass: rgba(255, 255, 255, 0.08);
  --glass-light: rgba(255, 255, 255, 0.14);
  --glass-hover: rgba(255, 255, 255, 0.18);
  --glass-border: rgba(210, 220, 255, 0.20);

  --ink: #ffffff;
  --muted: rgba(235, 238, 255, 0.78);

  --accent: #C9B1FF;
  --accent-2: #8F7CFF;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  overflow-x: hidden;
  position: relative;

  background-image:
    linear-gradient(var(--scrim), var(--scrim)),
    url("images/forest.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  transition: background 0.9s ease, color 0.5s ease;
}

[data-theme="dark"] body {
  background-image:
    linear-gradient(rgba(0,0,15,0.62), rgba(0,0,8,0.82)),
    url("images/forest.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Ambient light glows */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 15%, rgba(255,220,130,0.16), transparent 30%),
    radial-gradient(circle at 80% 30%, rgba(255,150,80,0.12), transparent 30%),
    linear-gradient(180deg, transparent, rgba(0,0,0,0.20));
  transition: opacity 0.9s ease, background 0.9s ease;
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(circle at 20% 15%, rgba(100,140,255,0.12), transparent 28%),
    radial-gradient(circle at 80% 20%, rgba(170,120,255,0.13), transparent 28%),
    radial-gradient(circle at 50% 80%, rgba(50,90,180,0.08), transparent 35%),
    linear-gradient(180deg, rgba(0,0,20,0.05), rgba(0,0,10,0.45));
}

/* Keep every real element above the fixed background layers */
* { position: relative; z-index: 1; }
body::before { z-index: 0; }

/* Consolidated glass surface (adds blur to all of these at once) */
header, .category-card, .product-card, .page-title, .cart-item, .modal-box,
.order-confirmation, .search-wrap input, .view-toggle button, .theme-toggle-btn,
.start-store-tile, .add-btn, .whatsapp-btn, .preview-box {
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes glowPulse { from { opacity: 0.55; } to { opacity: 1; } }

/* ===== Header / Nav ===== */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--glass-light), rgba(255,255,255,0.03));
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 10px 35px rgba(0,0,0,0.12);
}
header .logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  font-size: 21px;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  text-shadow: 0 0 14px rgba(255,209,102,0.40);
}
.logo-wordmark {
  font-family: var(--font-brush);
  font-size: 21px;
  letter-spacing: 0.01em;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.35), 0 0 16px rgba(255,209,102,0.30);
  margin-left: 8px;
}
nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
nav a {
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 30px;
  transition: background 0.25s ease, transform 0.25s ease;
}
nav a:hover { background: rgba(255,255,255,0.18); transform: translateY(-1px); }
.cart-link {
  background: rgba(255,209,102,0.28) !important;
  border: 1px solid rgba(255,209,102,0.50);
  padding: 8px 16px;
  border-radius: 30px;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 12px !important;
}
.theme-toggle-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.3s ease;
}
.theme-toggle-btn:hover { background: var(--glass-hover); transform: rotate(20deg); }

/* ===== Hero ===== */
.hero {
  min-height: 44vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}
.hero .eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(15, 10, 5, 0.55);
  border: 1px solid rgba(255,255,255,0.30);
  padding: 7px 16px;
  border-radius: 30px;
  margin-bottom: 20px;
  display: inline-block;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  animation: glowPulse 3s ease-in-out infinite alternate;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(36px, 9vw, 58px);
  line-height: 1;
  margin-bottom: 14px;
  text-shadow: 0 5px 25px rgba(0,0,0,0.40);
}
.hero h1 .accent { color: var(--accent); text-shadow: 0 2px 6px rgba(0,0,0,0.6), 0 0 16px rgba(255,209,102,0.4); }
.hero p { max-width: 460px; color: var(--muted); font-size: 15px; line-height: 1.65; margin: 0 auto; }

/* ===== Category shelf ===== */
.category-grid {
  width: min(900px, 92%);
  margin: 0 auto 46px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}
.category-card {
  position: relative;
  overflow: hidden;
  height: 150px;
  border-radius: 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  transition: transform 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
  animation: fadeUp 0.5s ease both;
}
.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), transparent 45%);
  opacity: 0.5;
}
.category-card:hover { transform: translateY(-8px); background: var(--glass-hover); box-shadow: 0 25px 60px rgba(0,0,0,0.35); }
.category-card:active { transform: scale(0.94); transition: transform 0.1s ease; }
.category-card span {
  z-index: 2;
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  font-size: 21px;
  color: #ffffff;
  text-shadow: 0 3px 12px rgba(0,0,0,0.40);
}
.category-card:nth-child(1) { animation-delay: 0.05s; }
.category-card:nth-child(2) { animation-delay: 0.12s; }
.category-card:nth-child(3) { animation-delay: 0.19s; }
.category-card:nth-child(4) { animation-delay: 0.26s; }
.category-card:nth-child(5) { animation-delay: 0.33s; }

/* ===== "Start your store" tile ===== */
.start-store-tile {
  display: block;
  max-width: 220px;
  margin: 16px auto 0;
  padding: 14px 18px;
  text-align: center;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,209,102,0.28), rgba(255,140,66,0.14));
  border: 1px solid rgba(255,209,102,0.45);
  color: #fff !important;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  font-size: 16px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.start-store-tile:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(0,0,0,0.25); }

/* ===== Search bar ===== */
.search-wrap { display: flex; justify-content: center; margin: 6px 0 14px; }
.search-wrap input {
  width: min(320px, 84%);
  padding: 11px 18px;
  border-radius: 30px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 13.5px;
}
.search-wrap input::placeholder { color: rgba(255,255,255,0.6); }
.search-wrap input:focus { outline: none; border-color: var(--accent-2); background: var(--glass-hover); }

/* ===== About / marketplace ===== */
#about h2, #marketplace h2 { font-family: var(--font-display); font-style: italic; color: #fff; }
#about p, #marketplace p { color: var(--muted) !important; }

/* ===== Page title ===== */
.page-title {
  text-align: center;
  padding: 30px 20px 22px;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.02));
  border-bottom: 1px solid var(--glass-border);
}
.page-title h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  font-size: 28px;
  margin: 0 0 6px;
  color: #fff;
}
.page-title p { color: var(--muted); font-size: 13.5px; margin: 0; }

.view-toggle { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.view-toggle button {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: rgba(255,255,255,0.8);
  padding: 7px 16px;
  border-radius: 30px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
}
.view-toggle button.active { background: rgba(255,209,102,0.3); color: #fff; border-color: rgba(255,209,102,0.5); }

/* ===== Product grid ===== */
.product-grid {
  width: min(1200px, 94%);
  margin: 0 auto;
  padding: 18px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.product-card {
  overflow: hidden;
  border-radius: 18px;
  padding: 8px;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 26px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  animation: fadeUp 0.4s ease both;
}
.product-card:hover { transform: translateY(-6px); background: var(--glass-hover); box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
.product-card img { width: 100%; height: 100px; object-fit: cover; border-radius: 12px; }
.product-info { padding: 8px 4px 4px; display: flex; flex-direction: column; flex: 1; }
.product-info h3 { font-family: var(--font-body); font-weight: 600; font-size: 11px; margin: 0 0 4px; color: #fff; }
.product-info .price {
  font-family: var(--font-display); font-weight: 700; font-style: italic;
  color: var(--accent); background: rgba(0,0,0,0.35); display: inline-block;
  padding: 2px 9px; border-radius: 8px; margin-bottom: 7px; font-size: 13px;
}
.add-btn {
  margin-top: auto; background: var(--glass); color: #fff; border: 1px solid var(--glass-border);
  border-radius: 30px; padding: 7px 4px; cursor: pointer; font-size: 10.5px; font-weight: 700;
  font-family: var(--font-body); transition: background 0.25s;
}
.add-btn:hover { background: rgba(255,209,102,0.3); border-color: rgba(255,209,102,0.5); }
.add-btn.added { background: rgba(37,211,102,0.4); border-color: var(--whatsapp); }

/* ===== List view ===== */
.product-grid.list-view { grid-template-columns: 1fr; max-width: 700px; }
.product-grid.list-view .product-card { flex-direction: row; align-items: center; }
.product-grid.list-view .product-card img { width: 84px; height: 84px; flex-shrink: 0; }
.product-grid.list-view .product-info { flex-direction: row; align-items: center; gap: 12px; flex: 1; padding: 6px 10px; }
.product-grid.list-view .product-info h3 { margin: 0; flex: 1; font-size: 13.5px; }
.product-grid.list-view .product-info .price { margin: 0; white-space: nowrap; font-size: 14px; }
.product-grid.list-view .add-btn { margin-top: 0; width: auto; padding: 8px 14px; font-size: 11.5px; }

/* ===== Cart page ===== */
.cart-page { width: min(900px, 92%); margin: 30px auto; }
.cart-item {
  display: flex; align-items: center; gap: 16px; padding: 14px; margin-bottom: 12px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border);
}
.cart-item img { width: 70px; height: 70px; object-fit: cover; border-radius: 12px; }
.cart-item-details { flex: 1; }
.cart-item-details h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: #fff; }
.cart-item-details .price { color: var(--muted); font-size: 12.5px; }
.qty-controls { display: flex; align-items: center; gap: 8px; }
.qty-controls button {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--glass-border);
  background: var(--glass); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
}
.remove-link { color: #ffb3b3; font-size: 12px; cursor: pointer; border: none; background: none; text-decoration: underline; }
.cart-summary { text-align: right; margin: 25px 0; }
.cart-summary .grand-total {
  font-size: 28px; font-weight: 700; font-style: italic; font-family: var(--font-display);
  color: var(--accent); background: rgba(0,0,0,0.35); padding: 3px 12px; border-radius: 10px;
}
.whatsapp-btn {
  display: block; width: 100%; background: rgba(37,211,102,0.35); border: 1px solid rgba(140,255,176,0.5);
  color: #fff; padding: 16px; border-radius: 30px; font-size: 15px; font-weight: 700; font-family: var(--font-body);
  cursor: pointer; text-align: center; text-decoration: none;
  box-shadow: 0 15px 40px rgba(37,211,102,0.2); transition: 0.3s;
}
.whatsapp-btn:hover { background: rgba(37,211,102,0.5); transform: translateY(-3px); }
.empty-cart { text-align: center; color: var(--muted); padding: 60px 20px; }

/* ===== Footer ===== */
footer {
  margin-top: 40px; padding: 30px 20px; text-align: center;
  background: rgba(0,0,0,0.20); border-top: 1px solid var(--glass-border);
  color: rgba(255,255,255,0.6); font-size: 12px;
}

/* ===== Order Details Modal ===== */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.active { display: flex; }
.modal-box {
  width: 100%; max-width: 400px; padding: 26px; border-radius: 26px;
  background: linear-gradient(135deg, rgba(255,255,255,0.20), rgba(255,255,255,0.06));
  border: 1px solid var(--glass-border); box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
.modal-box h2 { font-family: var(--font-display); font-weight: 700; font-style: italic; font-size: 22px; margin: 0 0 6px; color: #fff; }
.modal-box p { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); }
.modal-box label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 4px; color: rgba(255,255,255,0.85); text-transform: uppercase; letter-spacing: 0.03em; }
.modal-box input, .modal-box select {
  width: 100%; padding: 12px 14px; margin-bottom: 14px; border-radius: 16px; border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.10); color: #fff; font-size: 14px; font-family: var(--font-body);
}
.modal-box input::placeholder { color: rgba(255,255,255,0.5); }
.modal-error { color: #ffb3b3; font-size: 12px; margin: -8px 0 12px; display: none; }
.modal-buttons { display: flex; gap: 10px; }
.modal-buttons button { flex: 1; padding: 13px; border-radius: 30px; border: 1px solid var(--glass-border); font-size: 13.5px; font-weight: 700; cursor: pointer; font-family: var(--font-body); }
.modal-cancel-btn { background: var(--glass); color: #fff; }
.modal-send-btn { background: rgba(37,211,102,0.4); color: #fff; border-color: rgba(140,255,176,0.5); }
.modal-send-btn:hover { background: rgba(37,211,102,0.55); }

/* ===== Order Confirmation ===== */
.order-confirmation {
  display: none; text-align: center; padding: 50px 24px; margin: 24px auto; max-width: 460px; border-radius: 26px;
  background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border);
}
.order-confirmation.active { display: block; }
.order-confirmation .checkmark { font-size: 46px; color: var(--accent); text-shadow: 0 0 20px rgba(255,209,102,0.4); margin-bottom: 10px; }
.order-confirmation h2 { font-family: var(--font-display); font-weight: 700; font-style: italic; color: #fff; margin: 0 0 8px; }
.order-confirmation p { color: var(--muted); font-size: 14.5px; margin: 0 0 22px; }
.order-confirmation a {
  display: inline-block; background: rgba(255,209,102,0.3); color: #fff; text-decoration: none;
  padding: 13px 26px; border-radius: 30px; font-size: 13.5px; font-weight: 700; font-family: var(--font-body);
  border: 1px solid rgba(255,209,102,0.5);
}

/* ===== Product Preview Popup ===== */
.preview-box { padding: 20px; text-align: center; }
.preview-close {
  position: absolute; top: 12px; right: 12px; background: var(--glass); border: 1px solid var(--glass-border);
  width: 32px; height: 32px; border-radius: 50%; font-size: 14px; color: #fff; cursor: pointer; z-index: 2;
}
.preview-img { width: 100%; height: 240px; object-fit: cover; border-radius: 18px; margin-bottom: 16px; }
.preview-name { font-family: var(--font-display); font-weight: 700; font-style: italic; font-size: 21px; color: #fff; margin: 0 0 8px; }
.preview-price {
  font-family: var(--font-display); font-weight: 700; font-style: italic; font-size: 18px; color: var(--accent);
  background: rgba(0,0,0,0.35); display: inline-block; padding: 4px 14px; border-radius: 10px; margin-bottom: 18px;
}
.preview-add-btn {
  width: 100%; background: rgba(255,209,102,0.3); color: #fff; border: 1px solid rgba(255,209,102,0.5);
  padding: 14px; border-radius: 30px; font-size: 13.5px; font-weight: 700; font-family: var(--font-body);
  cursor: pointer; transition: 0.3s;
}
.preview-add-btn:hover { background: rgba(255,209,102,0.45); transform: translateY(-2px); }

/* ===== Product options (size / colour / quantity) ===== */
.option-row { text-align: left; margin-bottom: 14px; }
.option-row label {
  display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: rgba(255,255,255,0.8); margin-bottom: 5px;
}
.option-row select, .option-row input[type="text"] {
  width: 100%; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.10); color: #fff; font-size: 14px; font-family: var(--font-body);
}
.option-row input::placeholder { color: rgba(255,255,255,0.5); }
.qty-picker { display: flex; align-items: center; gap: 14px; }
.qty-picker button {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--glass-border);
  background: var(--glass); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
}
.qty-picker span { font-size: 16px; font-weight: 700; min-width: 20px; text-align: center; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.4); }
