/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --text: #1A1A1A;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --accent: #8B6F5E;
  --accent-dark: #6D5548;
  --accent-light: #D4A574;
  --accent-bg: #F5F0EB;
  --border: #E5E5E3;
  --border-light: #F0EDE8;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --price-color: #C0392B;
  --price-bg: #FEF2F0;
  --success-color: #27AE60;
  --warning-color: #D97706;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 220px;
}

/* ===== Header ===== */
.header {
  background: linear-gradient(145deg, #7A5F4F 0%, #A68B7B 50%, #C4A882 100%);
  color: #fff;
  text-align: center;
  padding: 52px 20px 44px;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.header-inner {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.header-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(4px);
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 18px;
}

.header-title {
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.header-sub {
  font-size: 16px;
  font-weight: 600;
  opacity: 0.92;
  margin-bottom: 12px;
}

.header-desc {
  font-size: 13px;
  opacity: 0.72;
  font-weight: 400;
}

/* ===== Main ===== */
.main {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== Section Title ===== */
.section-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}

/* ===== Schedule ===== */
.schedule-section {
  margin-top: 28px;
}

.schedule-grid {
  display: flex;
  gap: 10px;
}

.schedule-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.schedule-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.schedule-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.schedule-date {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

/* ===== Info Form ===== */
.info-section {
  margin-top: 32px;
}

.info-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.input-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.input-group input {
  font-family: inherit;
  font-size: 15px;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,111,94,0.1);
}

.input-group input::placeholder {
  color: #C4C4C4;
}

/* ===== Notice ===== */
.notice-section {
  margin-top: 28px;
}

.notice-box {
  background: var(--accent-bg);
  border: 1px solid rgba(139,111,94,0.12);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  font-size: 13.5px;
  color: var(--accent-dark);
  line-height: 1.8;
}

.notice-box strong {
  font-weight: 800;
  color: var(--accent);
}

/* ===== Products ===== */
.products-section {
  margin-top: 32px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.product-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.25s;
  box-shadow: var(--shadow-sm);
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-light);
  transform: translateY(-2px);
}

.product-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.product-img-wrap:hover img {
  transform: scale(1.06);
}

/* ===== Product Info ===== */
.product-info {
  padding: 14px 14px 16px;
}

.product-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.product-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.product-price-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--price-color);
  background: var(--price-bg);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.product-box-price {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 12px;
  padding-left: 1px;
}

.batch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.batch-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.batch-select {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  min-width: 80px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 26px;
}

.batch-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,111,94,0.1);
}

/* ===== Product Subtotal ===== */
.product-subtotal {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  transition: color 0.2s;
}

.product-subtotal.has-value {
  color: var(--accent);
  font-weight: 800;
}

/* ===== Lightbox ===== */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 300;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 20px;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-img {
  max-width: 90%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 10px;
}

.lightbox-name {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin-top: 16px;
  letter-spacing: 0.5px;
}

/* ===== Order Summary (Fixed Bottom) ===== */
.order-summary {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.1);
  z-index: 100;
}

.summary-inner {
  max-width: 740px;
  margin: 0 auto;
  padding: 16px 20px 18px;
}

.summary-info {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.summary-batches {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.summary-row span:last-child {
  font-weight: 700;
  color: var(--text);
  font-size: 12.5px;
}

.summary-total-area {
  min-width: 120px;
  text-align: right;
  padding: 10px 14px;
  background: var(--accent-bg);
  border-radius: var(--radius-sm);
}

.summary-total {
  font-size: 13px;
}

.summary-total span:last-child {
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
}

.summary-total-amount {
  font-size: 18px;
  font-weight: 900;
  color: var(--price-color);
  margin-top: 2px;
  letter-spacing: -0.5px;
}

.summary-warning {
  font-size: 12px;
  color: var(--warning-color);
  font-weight: 600;
  margin-bottom: 10px;
  display: none;
}

.summary-warning.visible {
  display: block;
}

.submit-btn {
  width: 100%;
  padding: 15px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 4px 12px rgba(139,111,94,0.3);
  letter-spacing: 0.5px;
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139,111,94,0.4);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.submit-btn.loading {
  pointer-events: none;
  opacity: 0.6;
}

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 44px 36px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #E8F5E9;
  color: var(--success-color);
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.modal-content h3 {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 8px;
}

.modal-content p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.modal-btn {
  padding: 13px 44px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(139,111,94,0.25);
}

.modal-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(139,111,94,0.35);
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 28px 20px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (min-width: 640px) {
  .header {
    padding: 60px 20px 52px;
  }

  .header-title {
    font-size: 36px;
  }

  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .info-form {
    flex-direction: row;
    gap: 12px;
  }

  .input-group {
    flex: 1;
  }

  .summary-batches {
    flex-direction: row;
    gap: 20px;
  }
}

@media (min-width: 960px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 400px) {
  .product-name-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .summary-info {
    flex-direction: column;
    gap: 10px;
  }

  .summary-total-area {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .summary-total-amount {
    margin-top: 0;
  }
}
