/* ==========================================================================
   Submit Order Page — 해청농원 두릅 주문하기
   ========================================================================== */

@import url('../reset.css');
@import url('../design-system.css');

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; }
body {
  font-family: var(--f-sans);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: var(--lead-normal);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
br { display: block; content: ''; margin: 0; }

/* ── Shared Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  font-family: var(--f-sans);
  font-weight: 600;
  border-radius: var(--r-full);
  transition: all var(--ease-base);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: var(--c-brand); color: #fff; padding: 14px 32px; font-size: 1.0625rem; border-radius: var(--r-md); }
.btn-primary:hover { background: var(--c-brand-dark); transform: translateY(-1px); box-shadow: var(--sh-md); }
.btn-secondary { background: var(--c-bg-card); color: var(--c-text); border: 1.5px solid var(--c-border); padding: 10px 20px; font-size: var(--text-sm); border-radius: var(--r-full); }
.btn-secondary:hover { border-color: var(--c-text-sub); background: var(--c-bg-alt); }

/* ═══════════════════════════════════════
   PAGE HEADER (sticky nav)
═══════════════════════════════════════ */
.page-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(var(--c-text-inv-rgb),.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border-light);
  height: 56px;
  display: flex;
  align-items: center;
}
.page-header__inner {
  max-width: 900px;
  margin-inline: auto;
  padding-inline: var(--sp-5);
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.page-header__back {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  transition: color var(--ease-fast);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  margin-left: -8px;
}
.page-header__back:hover { color: var(--c-text); background: var(--c-bg-alt); }
.page-header__back svg { flex-shrink: 0; }
.page-header__title {
  font-family: var(--f-serif);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -.02em;
}

/* ═══════════════════════════════════════
   INTRO / HERO BAND
═══════════════════════════════════════ */
#intro {
  max-width: 900px;
  margin-inline: auto;
  padding: var(--sp-10) var(--sp-5) 0;
}

/* Title injected by JS */
#product_type_selector h1 {
  font-family: var(--f-serif);
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: var(--lead-tight);
  text-align: center;
  margin-bottom: var(--sp-8);
}

/* Closed-order notice */
#notify {
  text-align: center;
  padding: var(--sp-10) var(--sp-5);
}
#notify h4 {
  font-size: var(--text-lg);
  line-height: var(--lead-relaxed);
  color: var(--c-text-sub);
  margin-bottom: var(--sp-4);
}
#notify h4:first-child {
  font-family: var(--f-serif);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: var(--sp-3);
}
#notify button {
  display: inline-flex;
  align-items: center;
  margin-top: var(--sp-6);
  padding: 14px 32px;
  background: var(--c-brand);
  color: #fff;
  border: none;
  border-radius: var(--r-full);
  font-family: var(--f-sans);
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--ease-base);
}
#notify button:hover { background: var(--c-brand-dark); }
#notify button a { color: #fff; }

/* Description box */
.box_description {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-6);
  /* margin-top: var(--sp-6); */
  line-height: var(--lead-relaxed);
}
.box_description h3,
.box_description h4 {
  font-size: var(--text-base);
  color: var(--c-text-sub);
  margin: var(--sp-3) 0 ;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
/* Hide <br> so multi-line text stays in a single flex item (br would become its own flex item otherwise) */
.box_description h3 br,
.box_description h4 br { display: none; }
.box_description h3 > button,
.box_description h4 > button { flex-shrink: 0; margin: 0; }
.box_description h4 { font-weight: 600; color: var(--c-text); }
.box_description button {
  display: inline-flex;
  align-items: center;
  margin: var(--sp-1);
  padding: 8px 18px;
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-full);
  font-family: var(--f-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-text);
  cursor: pointer;
  transition: all var(--ease-base);
}
.box_description button:hover { background: var(--c-brand); color: #fff; border-color: var(--c-brand); }
.box_description button a { color: inherit; }

/* Detail button: inherits size from .box_description button, only color differs */
#btn_detail {
  background: var(--c-brand);
  color: #fff;
  border-color: var(--c-brand);
}
#btn_detail a { color: #fff; }

/* Durup intro text */
.product_intro p.dsc {
  font-size: var(--text-base);
  color: var(--c-text-sub);
  line-height: var(--lead-relaxed);
  text-align: center;
  padding: var(--sp-5) 0;
}
.dsc { margin: 15px 0; }
#durup_intro,
#durup_desc,
#gotgam_intro,
#gotgam_desc { text-align: center; }
#gotgam_desc h4 { text-align: left; }
.product_intro .img1,
.product_intro .img2 {
  width: 100% !important;
  max-width: 560px;
  margin: var(--sp-5) auto;
  border-radius: var(--r-md);
  object-fit: cover;
}

/* ═══════════════════════════════════════
   ORDER BOX
═══════════════════════════════════════ */
#orderBox {
  max-width: 900px;
  margin-inline: auto;
  padding: var(--sp-8) var(--sp-5) 140px;
}
#orderForm {
  display: flex;
  flex-direction: column;
  gap: var(--sp-10);
}

/* ═══════════════════════════════════════
   PRODUCT LIST
═══════════════════════════════════════ */
.product_list { display: flex; flex-direction: column; gap: var(--sp-2); }

/* Section label via pseudo */
#gotgam_products::before {
  content: '곶감 선물세트';
  display: block;
  font-family: var(--f-serif);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: var(--sp-5);
}
#durup_products::before {
  content: '지리산 산두릅';
  display: block;
  font-family: var(--f-serif);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: var(--sp-5);
}

/* Wrapper added in HTML */
.product-item {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-xs);
  transition: box-shadow var(--ease-base);
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: stretch;
}
.product-item:hover { box-shadow: var(--sh-md); }

/* Product image */
.imgBox {
  position: relative;
  background: var(--c-bg-alt);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.productImg {
  width: 100% !important;
  height: 100% !important;
  max-height: 200px;
  object-fit: cover !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block;
}

/* Product info */
.imgBox .imgCaption {
  display: none; /* caption moved to product-item__info */
}

/* Info + select column */
.product-item__info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-6);
}
.product-item__name {
  font-family: var(--f-serif);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -.02em;
}
.product-item__meta {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
}
.product-item__price {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -.02em;
}
.product-item__price span {
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--c-text-muted);
}

/* SELECT */
select {
  width: 100%;
  max-width: 240px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--c-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239E8272' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 11px 44px 11px 16px;
  font-family: var(--f-sans);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--c-text);
  cursor: pointer;
  transition: border-color var(--ease-base), box-shadow var(--ease-base);
  margin-bottom: 0 !important;
}
select:focus {
  outline: none;
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px rgba(var(--c-brand-rgb),.15);
  background-color: var(--c-bg-card);
}
select:hover { border-color: var(--c-text-sub); }

/* ═══════════════════════════════════════
   DURUP-SPECIFIC
═══════════════════════════════════════ */
#durup_products .product-item {
  grid-template-columns: 1fr;
}
#durup_products .imgBox { min-height: 220px; }
#durup_products .productImg { max-height: 280px !important; }

/* Gosari section */
.gosariBox {
  background: var(--c-bg-card);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  text-align: center;
}
.gosariBox .imageBox {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}
.gosariBox .imageBox img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--r-sm);
}
.gosariBox h4 {
  font-family: var(--f-serif);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--sp-3);
}
.gosariBox button {
  display: inline-flex;
  align-items: center;
  padding: 10px 24px;
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-full);
  font-family: var(--f-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease-base);
}
.gosariBox button:hover { background: var(--c-brand); color: #fff; border-color: var(--c-brand); }

/* ═══════════════════════════════════════
   DATE SELECTOR
═══════════════════════════════════════ */
.date_selector {
  background: var(--c-bg-alt);
  border-radius: var(--r-lg);
  padding: var(--sp-8) var(--sp-6);
  border: 1px solid var(--c-border-light);
}
.date_selector label {
  display: block;
  font-family: var(--f-serif);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: var(--sp-5);
}
.box_reserve_date h4 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: var(--sp-2);
}
.box_reserve_date h5 {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  line-height: var(--lead-relaxed);
  margin-bottom: var(--sp-1);
}
.box_reserve_date select {
  max-width: 360px;
  margin-top: var(--sp-5);
}

/* ═══════════════════════════════════════
   ORDER SUMMARY
═══════════════════════════════════════ */
.summary_order {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--c-text-sub);
  line-height: var(--lead-relaxed);
  min-height: 56px;
  text-align: center;
}
.summary_order:empty { display: none; }

/* ═══════════════════════════════════════
   CUSTOMER INFO FORM
═══════════════════════════════════════ */
.order_info {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-lg);
  padding: var(--sp-8) var(--sp-6);
  box-shadow: var(--sh-xs);
}
.order_info-fields {
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
}
.order_info-title {
  font-family: var(--f-serif);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: var(--sp-6);
}
.order_info label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-top: var(--sp-5);
  margin-bottom: var(--sp-2);
}
.order_info label:first-of-type { margin-top: 0; }
.order_info input {
  display: block;
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  font-family: var(--f-sans);
  font-size: var(--text-base);
  color: var(--c-text);
  background: var(--c-bg);
  transition: all var(--ease-base);
  margin: 0;
}
.order_info input:focus {
  outline: none;
  border-color: var(--c-brand);
  background: var(--c-bg-card);
  box-shadow: 0 0 0 3px rgba(var(--c-brand-rgb),.12);
}
.order_info input::placeholder { color: var(--c-text-muted); }

/* ═══════════════════════════════════════
   FLOATING PRICE TAG
═══════════════════════════════════════ */
#priceTag {
  position: fixed;
  bottom: var(--sp-6);
  left: var(--sp-5);
  z-index: 50;
  background: var(--c-bg-dark);
  color: var(--c-text-inv);
  padding: 14px 20px;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xl);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: var(--lead-relaxed);
  min-width: 160px;
  animation: slideUp .3s var(--ease-spring);
}
@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.none { display: none !important; }

/* ═══════════════════════════════════════
   SUBMIT SECTION
═══════════════════════════════════════ */
#gotgam_outro, #durup_outro {
  background: var(--c-bg-alt);
  border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-6);
  font-size: var(--text-base);
  color: var(--c-text-sub);
  line-height: var(--lead-relaxed);
  text-align: center;
}
#durup_outro {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-light);
  padding: var(--sp-8) var(--sp-6);
  font-size: var(--text-m);
  font-weight: 500;
  line-height: 1.8;
  color: var(--c-text);
  letter-spacing: -.01em;
}

#btn_submit {
  display: block;
  width: 40%;
  margin-inline: auto;
  padding: var(--sp-5);
  background: var(--c-brand);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--f-sans);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: all var(--ease-base);
}
#btn_submit:hover { background: var(--c-brand-dark); transform: translateY(-2px); box-shadow: var(--sh-md); }
#btn_submit:active { transform: translateY(0); }

#loading {
  text-align: center;
  color: var(--c-text-muted);
  font-size: var(--text-sm);
  padding: var(--sp-3) 0;
  display: none;
}

/* Privacy notice */
#orderForm > p:not([id]) {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  line-height: var(--lead-relaxed);
  text-align: center;
}

/* ═══════════════════════════════════════
   RESULT PAGE
═══════════════════════════════════════ */
#result {
  max-width: 680px;
  margin-inline: auto;
  padding: var(--sp-16) var(--sp-5) 120px;
  text-align: center;
}
#result h2 {
  font-family: var(--f-serif);
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: var(--sp-4);
}
#result h4 {
  font-size: var(--text-lg);
  color: var(--c-text-sub);
  line-height: var(--lead-relaxed);
  margin-bottom: var(--sp-3);
}
#result #totalFee {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--c-brand);
  margin: var(--sp-6) 0;
}
.orderReview {
  text-align: left;
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  margin: var(--sp-6) 0;
  line-height: var(--lead-relaxed);
  font-size: var(--text-sm);
  color: var(--c-text-sub);
  box-shadow: var(--sh-xs);
}
#result button,
#result .btn-result {
  display: inline-flex;
  align-items: center;
  margin: var(--sp-2);
  padding: 12px 28px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-full);
  background: var(--c-bg-card);
  font-family: var(--f-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-text);
  cursor: pointer;
  transition: all var(--ease-base);
}
#result button:hover { background: var(--c-brand); color: #fff; border-color: var(--c-brand); }
#result button a { color: inherit; }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 640px) {
  .product-item { grid-template-columns: 1fr; }
  .imgBox { min-height: 200px; }
  .productImg {
    max-height: 220px !important;
    object-position: top center !important;
  }
  .productImg[src*="durup/big_2"],
  .productImg[src*="durup/small_2"] { display: none; }
  .product-item__info { padding: var(--sp-4) var(--sp-4); }

  select { max-width: 100%; }

  .order_info { padding: var(--sp-6) var(--sp-4); }
  .order_info input { max-width: 100%; }

  .date_selector { padding: var(--sp-6) var(--sp-4); }
  .box_reserve_date select { max-width: 100%; }

  #priceTag { bottom: 16px; left: 12px; font-size: var(--text-xs); padding: 10px 14px; }

  .gosariBox .imageBox { grid-template-columns: 1fr; }
  .gosariBox .imageBox img { height: 200px; }

  #btn_submit { width: 60%; }

  /* box_description on mobile: shrink text/button so button stays on the right */
  .box_description h3,
  .box_description h4 {
    font-size: var(--text-s);
    gap: var(--sp-2);
  }
  .box_description h3 > button,
  .box_description h4 > button {
    font-size: var(--text-xs);
    padding: 8px 10px;
  }
  .box_description p.dsc,
  .dsc {
    font-size: var(--text-s);
  }
}

/* ── Desktop: box_description — tighter row layout ── */
@media (min-width: 641px) {
  .box_description h3,
  .box_description h4 {
    gap: 24px;
    padding: 14px 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--c-border-light);
  }
  .box_description h3:last-child { border-bottom: none; }
  .gosariBox h4 {
    display: block;
    border-bottom: none;
  }
}

/* ── Desktop: larger product images ── */
@media (min-width: 768px) {
  .product-item { grid-template-columns: 280px 1fr; }
  .imgBox { min-height: 240px; }
  .productImg { max-height: 260px !important; }
}

@media (min-width: 1024px) {
  .product-item { grid-template-columns: 340px 1fr; }
  .imgBox { min-height: 280px; }
  .productImg { max-height: 300px !important; }
}
