:root {
  --bg: #fdf6ea;
  --bg-elevated: #fffbf3;
  --card: #ffffff;
  --text: #4a3d33;
  --text-dim: #a3907d;
  --accent: #ffb84d;
  --accent-2: #6ea8ff;
  --border: #f1e3cc;
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

a { color: inherit; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(253, 246, 234, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  font-weight: 800;
  font-size: 1.2rem;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.logo span { color: var(--accent-2); }

.search-box { flex: 1; }
.search-box input {
  width: 100%;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.95rem;
}
.search-box input:focus {
  outline: none;
  border-color: var(--accent);
}

.cart-btn {
  background: var(--accent);
  color: #4a3d33;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform 0.15s ease;
}
.cart-btn:hover { transform: translateY(-1px); }
.cart-btn.pulse { animation: pulse 0.4s ease; }
@keyframes pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 60px 20px 46px;
  background: linear-gradient(180deg, #cfe4ff 0%, #fdf6ea 100%);
}
.hero-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-stars span {
  position: absolute;
  color: #ffffff;
  font-size: 1.4rem;
  text-shadow: 0 0 6px rgba(255,255,255,0.9);
  animation: twinkle 2.4s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}
.hero h1 {
  position: relative;
  font-size: 2rem;
  margin: 0 0 10px;
  color: #3c4a66;
}
.hero p {
  position: relative;
  color: #6d7a94;
  margin: 0;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  --chip-color: var(--accent);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--chip-color); }
.chip.active {
  background: var(--chip-color);
  color: #4a3d33;
  border-color: var(--chip-color);
  font-weight: 700;
}

#category-select {
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.9rem;
}

.result-row {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.empty-msg {
  color: var(--text-dim);
  text-align: center;
  padding: 40px 0;
  width: 100%;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(160, 130, 90, 0.18);
}

.product-thumb {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.product-body {
  padding: 14px 16px 6px;
  flex: 1;
}

.product-movie {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.product-name {
  font-weight: 700;
  margin-bottom: 8px;
}

.product-price {
  color: #e2933f;
  font-weight: 800;
}

.btn-add {
  margin: 12px 16px 16px;
  padding: 11px;
  border: none;
  border-radius: 999px;
  background: var(--accent-2);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.btn-add:hover { filter: brightness(1.06); }

/* Footer */
.site-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 24px 20px 40px;
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 61, 51, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 30;
}
.overlay.show { opacity: 1; pointer-events: auto; }

/* Cart drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(400px, 92vw);
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 31;
  display: flex;
  flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.cart-header h2 { margin: 0; font-size: 1.1rem; }

.icon-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}

.cart-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.cart-thumb {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.cart-info { flex: 1; }
.cart-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.cart-price { color: #e2933f; font-size: 0.85rem; margin-bottom: 6px; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
.remove-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #e2725c;
  font-size: 0.8rem;
  cursor: pointer;
}

.cart-footer {
  padding: 18px 20px 22px;
  border-top: 1px solid var(--border);
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.btn-checkout {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #4a3d33;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
}
.btn-checkout:disabled {
  background: var(--border);
  color: var(--text-dim);
  cursor: not-allowed;
}

/* Checkout modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}
.modal.show { display: flex; }

.modal-content {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
}
.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
}
.modal-icon { font-size: 2.6rem; margin-bottom: 8px; }
.modal-note {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 14px;
}

@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; }
  .search-box { order: 3; flex-basis: 100%; }
  .hero h1 { font-size: 1.5rem; }
}
