:root {
  --cream: #fbf3e7;
  --brown: #6b4a30;
  --brown-dark: #4a2f1c;
  --accent: #d98b3f;
  --closed: #d64545;
  --card-bg: #ffffff;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--brown-dark);
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { color: var(--brown); margin: 0 0 0.5em; }

/* Header */
.site-header {
  background: var(--card-bg);
  border-bottom: 1px solid #eadfce;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
}

.logo-icon { font-size: 1.8rem; }
.logo-text { font-size: 0.85rem; line-height: 1.3; }
.logo-text strong { font-size: 1.2rem; color: var(--brown); }

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 22px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.main-nav a {
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s;
}

.main-nav a:hover { border-color: var(--accent); }

.cart-icon {
  position: relative;
  font-size: 1.3rem;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 999px;
}

/* News ticker */
.news-ticker {
  background: var(--brown);
  color: #fff;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 6px 0;
}

.ticker-label {
  background: var(--accent);
  padding: 2px 12px;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 999px;
  margin: 0 14px;
  flex-shrink: 0;
}

.ticker-track {
  display: flex;
  gap: 60px;
  white-space: nowrap;
  animation: scroll-left 22s linear infinite;
}

@keyframes scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Hero */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 20px;
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-text { flex: 1 1 340px; }
.hero-text h1 { font-size: 2rem; }

.btn-primary {
  display: inline-block;
  margin-top: 16px;
  background: var(--accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: bold;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(217,139,63,0.4);
}

.hero-art {
  flex: 1 1 260px;
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 4rem;
}

.cookie { animation: float 3s ease-in-out infinite; }
.cookie-2 { animation-delay: 0.5s; }
.cookie-3 { animation-delay: 1s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* Items */
.items, .about, .news-section, .access {
  max-width: 1100px;
  margin: 0 auto;
  padding: 50px 20px;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.item-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(107,74,48,0.08);
  transition: transform 0.2s;
}

.item-card:hover { transform: translateY(-4px); }

.item-thumb {
  font-size: 3rem;
  margin-bottom: 12px;
}

.price { color: var(--accent); font-weight: bold; }

.btn-add-cart {
  margin-top: 12px;
  background: var(--brown);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-add-cart:hover { background: var(--accent); }
.btn-add-cart:disabled { opacity: 0.7; cursor: default; }

.stock-badge {
  min-height: 22px;
  margin: 10px 0 0;
}

.stock-badge.low {
  display: inline-block;
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e0553f, #f0883e);
  box-shadow: 0 2px 8px rgba(224, 85, 63, 0.35);
  animation: pulse-badge 1.3s ease-in-out infinite;
}

.stock-badge.soldout {
  display: inline-block;
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 4px 12px;
  border-radius: 999px;
  background: #9a9a9a;
  letter-spacing: 0.05em;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

.item-card.sold-out { opacity: 0.55; }
.item-card.sold-out .item-thumb { filter: grayscale(1); }

.btn-secondary {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid var(--brown);
  color: var(--brown);
  font-weight: bold;
}

.btn-secondary:hover { background: rgba(107,74,48,0.06); }

.btn-full { width: 100%; border: none; cursor: pointer; font-size: 1rem; }

button.btn-primary { border: none; cursor: pointer; font-size: 1rem; font-family: inherit; }
button.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Generic inner pages */
.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 50px 20px 80px;
}

.page-title { font-size: 1.6rem; margin-bottom: 8px; }

.demo-note {
  background: #fff3e0;
  border: 1px solid #f0c988;
  color: #8a5a17;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.empty-msg { padding: 30px 0; }
.empty-msg a { color: var(--accent); text-decoration: underline; }

/* Cart table */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(107,74,48,0.08);
}

.cart-table th, .cart-table td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid #f0e4d4;
}

.qty-input {
  width: 60px;
  padding: 6px;
  border: 1px solid #ddc9ae;
  border-radius: 6px;
}

.btn-remove {
  background: none;
  border: none;
  color: var(--closed);
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: underline;
}

.cart-summary {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  font-size: 1.2rem;
  font-weight: bold;
  padding: 20px 4px;
  color: var(--brown);
}

.cart-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Checkout */
.checkout-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 720px) {
  .checkout-layout { grid-template-columns: 1fr; }
}

.checkout-form fieldset {
  background: var(--card-bg);
  border: none;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(107,74,48,0.08);
}

.checkout-form legend {
  font-weight: bold;
  color: var(--brown);
  padding: 0 6px;
}

.checkout-form label {
  display: block;
  margin-top: 14px;
  margin-bottom: 4px;
  font-size: 0.85rem;
  color: var(--brown-dark);
}

.checkout-form input[type="text"],
.checkout-form input[type="tel"],
.checkout-form input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddc9ae;
  border-radius: 8px;
  font-size: 0.95rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.9rem;
}

.radio-label input { margin: 0; }

.card-fields-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #ddc9ae;
  font-size: 0.85rem;
  color: var(--brown-dark);
  line-height: 1.6;
}

.checkout-summary {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(107,74,48,0.08);
  position: sticky;
  top: 90px;
}

.summary-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.summary-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 6px 0;
  border-bottom: 1px solid #f0e4d4;
}

.checkout-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--brown);
}

/* Order complete */
.order-summary {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 14px rgba(107,74,48,0.08);
  margin-bottom: 24px;
}

.order-number { font-weight: bold; color: var(--accent); font-size: 1.1rem; }
.summary-total { font-weight: bold; color: var(--brown); font-size: 1.1rem; }

/* Admin */
.admin-label {
  font-size: 0.8rem;
  color: var(--brown);
  background: var(--cream);
  border: 1px solid #eadfce;
  padding: 4px 12px;
  border-radius: 999px;
}

.admin-login {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  max-width: 360px;
  box-shadow: 0 4px 14px rgba(107,74,48,0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-login label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--brown-dark);
}

.admin-login input {
  padding: 10px 12px;
  border: 1px solid #ddc9ae;
  border-radius: 8px;
  font-size: 0.95rem;
}

.admin-error { color: var(--closed); font-size: 0.85rem; }

.admin-orders { display: flex; flex-direction: column; gap: 16px; }

.admin-order-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(107,74,48,0.08);
}

.admin-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-order-date {
  margin-left: 10px;
  color: #8a7862;
  font-size: 0.85rem;
}

.status-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #ddc9ae;
  font-size: 0.85rem;
}

.admin-order-shipping {
  font-size: 0.85rem;
  color: var(--brown-dark);
  margin-top: 10px;
}

.admin-order-card.needs-attention {
  border: 2px solid var(--closed);
}

/* Calendar */
.calendar-wrap {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(107,74,48,0.08);
  max-width: 420px;
}

#calendar table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

#calendar caption {
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--brown);
}

#calendar th, #calendar td {
  padding: 8px 4px;
  font-size: 0.85rem;
}

#calendar td.closed { color: var(--closed); font-weight: bold; }
#calendar td.today { background: var(--cream); border-radius: 8px; }

.calendar-note { font-size: 0.85rem; color: var(--brown); margin-top: 12px; }

/* Footer */
.site-footer {
  background: var(--brown-dark);
  color: #f0e4d4;
  margin-top: 40px;
}

.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
}

.footer-grid h4 { color: #fff; margin-bottom: 10px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { opacity: 0.8; font-size: 0.9rem; }
.footer-grid a:hover { opacity: 1; text-decoration: underline; }

.copyright {
  text-align: center;
  font-size: 0.75rem;
  padding: 16px;
  opacity: 0.6;
  border-top: 1px solid rgba(255,255,255,0.1);
}
