/* ===========================
   VARIABLES & RESET
=========================== */
:root {
  --green-dark:   #1a2e1a;
  --green-mid:    #2d4f2d;
  --green-light:  #4a7c4a;
  --gold:         #c9a84c;
  --gold-light:   #e8c96e;
  --cream:        #fdf6e3;
  --cream-dark:   #f0e6c8;
  --text-dark:    #1a1a1a;
  --text-mid:     #4a4a4a;
  --text-light:   #888;
  --white:        #ffffff;
  --shadow:       0 4px 24px rgba(0,0,0,0.12);
  --radius:       12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ===========================
   HEADER
=========================== */
header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--green-dark);
  padding: 0 2rem;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'Playfair Display', serif;
  color: var(--gold);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.logo-text {
  margin-left: 0.6rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .logo-img { height: 32px; }
  .logo-text { font-size: 1rem; letter-spacing: 0.14em; }
}

/* Announcement banner (shown while checkout is disabled) */
.announcement-banner {
  background: var(--gold);
  color: var(--green-dark);
  text-align: center;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* Disabled add-to-cart button */
.btn-add:disabled {
  background: #b8b8b8 !important;
  color: #fff !important;
  cursor: not-allowed !important;
  opacity: 0.85;
}
.btn-add:disabled:hover { background: #b8b8b8 !important; }

nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

nav a {
  color: var(--cream);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  opacity: 0.85;
  transition: opacity 0.2s, color 0.2s;
}

nav a:hover { opacity: 1; color: var(--gold-light); }

/* --- Cart Icon Button --- */
.cart-icon-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0.2rem 0.4rem;
  line-height: 1;
  transition: transform 0.15s;
}

.cart-icon-btn:hover { transform: scale(1.12); }

.cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--gold);
  color: var(--green-dark);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ===========================
   CART DRAWER
=========================== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 95vw;
  height: 100%;
  background: var(--white);
  z-index: 400;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,0.2);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 1.6rem;
  border-bottom: 1px solid var(--cream-dark);
  background: var(--green-dark);
}

.drawer-header h3 {
  font-family: 'Playfair Display', serif;
  color: var(--gold);
  font-size: 1.2rem;
}

.drawer-close {
  background: none;
  border: none;
  color: var(--cream);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 0.2rem;
}

.drawer-close:hover { opacity: 1; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.6rem;
}

.empty-cart {
  text-align: center;
  color: var(--text-light);
  padding: 2rem 0;
  font-size: 0.9rem;
}

.empty-cart a { color: var(--green-light); }

/* Drawer cart items */
.drawer-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--cream-dark);
}

.drawer-item-emoji { font-size: 2rem; }

.drawer-item-info { flex: 1; }

.drawer-item-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--green-dark);
  margin-bottom: 0.2rem;
}

.drawer-item-price {
  font-size: 0.82rem;
  color: var(--text-light);
}

.drawer-item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  background: var(--cream-dark);
  border: none;
  color: var(--text-dark);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s;
  line-height: 1;
}

.qty-btn:hover { background: #ddd; }

.qty-count { font-size: 0.9rem; font-weight: 500; min-width: 16px; text-align: center; }

.drawer-footer {
  padding: 1.2rem 1.6rem 2rem;
  border-top: 1px solid var(--cream-dark);
  background: var(--cream);
}

.drawer-total {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--green-dark);
  margin-bottom: 1rem;
  text-align: right;
}

.btn-checkout {
  width: 100%;
  padding: 0.9rem;
  text-align: center;
  border-radius: 8px;
  font-size: 1rem;
}

/* ===========================
   BUTTONS
=========================== */
.btn-primary {
  display: inline-block;
  background: var(--gold);
  color: var(--green-dark);
  border: none;
  padding: 0.85rem 2.2rem;
  border-radius: 50px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(201,168,76,0.35);
}

.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201,168,76,0.45);
}

.btn-add {
  background: var(--green-mid);
  color: var(--cream);
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}

.btn-add:hover { background: var(--green-light); transform: translateY(-1px); }

/* ===========================
   SECTION TITLES
=========================== */
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 2.5rem;
  text-align: center;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--gold);
  margin: 0.6rem auto 0;
  border-radius: 2px;
}

/* ===========================
   HERO
=========================== */
.hero {
  background: linear-gradient(135deg, rgba(30,60,30,0.82) 0%, rgba(46,90,42,0.78) 60%, rgba(74,124,60,0.72) 100%), url('Images/durian_main_backup.png') center/cover no-repeat;
  min-height: 88vh;
  display: flex;
  align-items: center;
  padding: 6rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(201,168,76,0.12) 0%, transparent 70%);
}

.hero-content { max-width: 560px; animation: fadeUp 0.9s ease both; }

.hero-sub {
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  font-weight: 500;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 900;
  color: var(--cream);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-desc {
  color: rgba(253,246,227,0.75);
  font-size: 1rem;
  font-weight: 300;
  margin-bottom: 2.5rem;
  line-height: 1.9;
}


/* ===========================
   PRODUCTS
=========================== */
.products-section {
  padding: 6rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.8rem;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
  animation: fadeUp 0.7s ease both;
}

.product-card:hover { transform: translateY(-6px); box-shadow: 0 12px 40px rgba(0,0,0,0.16); }

.product-emoji {
  background: linear-gradient(135deg, var(--green-mid), var(--green-light));
  text-align: center;
  font-size: 4rem;
  padding: 2rem 1rem;
}

.product-info { padding: 1.4rem; display: flex; flex-direction: column; flex: 1; }

.product-info h3 { font-family: 'Playfair Display', serif; font-size: 1.25rem; color: var(--green-dark); margin-bottom: 0.25rem; }

.product-origin { font-size: 0.78rem; color: var(--text-light); margin-bottom: 0.75rem; letter-spacing: 0.05em; }

.product-desc { font-size: 0.88rem; color: var(--text-mid); line-height: 1.7; flex: 1; margin-bottom: 1rem; }

.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }

.price { font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 700; color: var(--green-dark); }
.price small { font-family: 'Noto Sans JP', sans-serif; font-size: 0.75rem; font-weight: 300; color: var(--text-light); }

/* ===========================
   ABOUT SECTION
=========================== */
.about-section {
  background: var(--green-dark);
  padding: 6rem 2rem;
}

.about-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.about-title { color: var(--gold) !important; }
.about-title::after { background: rgba(253,246,227,0.3) !important; }

.about-lead {
  color: rgba(253,246,227,0.8);
  font-size: 1rem;
  line-height: 2;
  font-weight: 300;
  margin-bottom: 3rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.about-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.about-feature {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  transition: background 0.2s;
}

.about-feature:hover { background: rgba(255,255,255,0.1); }

.feature-icon { font-size: 2.2rem; margin-bottom: 0.75rem; }

.about-feature h4 {
  font-family: 'Playfair Display', serif;
  color: var(--gold-light);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.about-feature p { color: rgba(253,246,227,0.65); font-size: 0.85rem; line-height: 1.8; }

/* ===========================
   CHECKOUT PAGE
=========================== */
.checkout-page { background: #f5f0e8; }

.checkout-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

.checkout-heading {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--green-dark);
  margin-bottom: 2rem;
}

.checkout-heading::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--gold);
  margin-top: 0.5rem;
  border-radius: 2px;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}

/* Form cards */
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.form-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--green-dark);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--cream-dark);
}

.form-group { margin-bottom: 1.2rem; }

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-mid);
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e0d8c8;
  border-radius: 8px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--cream);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--green-light);
  box-shadow: 0 0 0 3px rgba(74,124,74,0.12);
}

.form-group textarea { min-height: 80px; resize: vertical; }

.field-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-light, #888);
}

.field-hint.error {
  color: #c0392b;
}

.form-group input.invalid,
.form-group textarea.invalid {
  border-color: #c0392b;
  background: #fff5f3;
}

.form-group input:disabled,
.form-group textarea:disabled {
  background: #f5f0e8;
  color: #999;
  cursor: not-allowed;
}

.phone-row {
  display: flex;
  gap: 0.5rem;
}
.phone-country {
  flex: 0 0 auto;
  padding: 0.75rem 0.8rem;
  border: 1.5px solid #e0d8c8;
  border-radius: 8px;
  background: var(--white);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}
.phone-country:focus { border-color: var(--green-light); }
.phone-row input[type="tel"] { flex: 1; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Payment options */
.payment-options { display: flex; flex-direction: column; gap: 0.6rem; }

.payment-option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border: 1.5px solid #e0d8c8;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.payment-option:hover { border-color: var(--green-light); background: rgba(74,124,74,0.05); }

.payment-option-disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
  background: #f5f0e8;
}
.payment-option-disabled:hover {
  border-color: #e0d8c8 !important;
  background: #f5f0e8 !important;
}
.payment-option-disabled .payment-label strong {
  text-decoration: line-through;
  color: #888;
}
.payment-option-disabled input[type="radio"] {
  cursor: not-allowed;
}

/* ==========================================================
   ORDER PROCESSING OVERLAY (shown during checkout submission)
   ========================================================== */
.processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 46, 26, 0.92);
  z-index: 9999;
  display: flex !important;   /* override style="display:none" once shown via JS */
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.processing-overlay[style*="display:none"],
.processing-overlay[style*="display: none"] {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.processing-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.processing-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--green-dark);
  margin: 1rem 0 0.5rem;
}

.processing-msg {
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-bottom: 0.8rem;
  line-height: 1.7;
}

.processing-msg strong {
  color: #c0392b;
}

.processing-sub {
  font-size: 0.8rem;
  color: var(--text-mid);
  margin-top: 0.8rem;
}

.processing-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border: 4px solid var(--cream-dark);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.payment-option input[type="radio"] { accent-color: var(--green-mid); flex-shrink: 0; }

.payment-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.payment-icon { font-size: 1.4rem; }

.payment-label strong { display: block; font-size: 0.9rem; color: var(--text-dark); }
.payment-label small { font-size: 0.75rem; color: var(--text-light); }

.form-error {
  background: #fff0f0;
  border: 1px solid #f5a0a0;
  color: #c0392b;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.btn-order {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  border-radius: 8px;
}

.form-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 0.75rem;
}

/* Order summary card */
.summary-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0;
}

.summary-item-emoji { font-size: 1.5rem; }

.summary-item-info { flex: 1; }

.summary-item-name { font-size: 0.88rem; font-weight: 500; color: var(--green-dark); }
.summary-item-qty  { font-size: 0.78rem; color: var(--text-light); }

.summary-item-subtotal {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
}

.summary-divider { border: none; border-top: 1px solid var(--cream-dark); margin: 0.75rem 0; }

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-mid);
  padding: 0.25rem 0;
}

.summary-total-row {
  font-size: 1.05rem;
  color: var(--green-dark);
  padding-top: 0.5rem;
}

/* ===========================
   MODAL
=========================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.25s ease;
}

.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: fadeUp 0.3s ease;
}

.modal-icon { font-size: 3rem; margin-bottom: 1rem; }

.modal-box h3 {
  font-family: 'Playfair Display', serif;
  color: var(--green-dark);
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.modal-box p { color: var(--text-mid); font-size: 0.9rem; margin-bottom: 1.5rem; line-height: 1.8; }

/* ===========================
   FOOTER
=========================== */
footer {
  background: #111d11;
  padding: 2rem;
  text-align: center;
  color: rgba(253,246,227,0.45);
  font-size: 0.82rem;
  line-height: 2;
}

/* ===========================
   ANIMATIONS
=========================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 900px) {
  .checkout-grid { grid-template-columns: 1fr; }
  .summary-card  { position: static; }
}

@media (max-width: 768px) {
  .hero { padding: 5rem 1.5rem; min-height: auto; }
  .hero-image { display: none; }
  nav a { font-size: 0.82rem; }
  .product-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
  .cart-drawer  { width: 100vw; }
}
