:root {
  --primary: #06C755;
  --primary-dark: #059347;
  --secondary: #FF9500;
  --danger: #FF3B30;
  --bg: #F5F5F7;
  --white: #FFFFFF;
  --text: #1C1C1E;
  --text-light: #8E8E93;
  --border: #E5E5EA;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --radius: 16px;
  --radius-sm: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Screen Management */
.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: block;
}

/* Login Screen */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.logo {
  text-align: center;
  color: white;
  margin-bottom: 40px;
}

.logo h1 {
  font-size: 42px;
  margin-bottom: 10px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.logo p {
  font-size: 20px;
  font-weight: 600;
  opacity: 0.95;
}

.login-info {
  text-align: center;
  color: white;
  margin-bottom: 48px;
}

.login-info p {
  font-size: 16px;
  margin-bottom: 6px;
  opacity: 0.9;
  font-weight: 500;
}

.login-info .subtitle {
  font-size: 13px;
  opacity: 0.7;
  font-weight: 400;
}

.btn-line-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 300px;
  padding: 18px 28px;
  background: white;
  color: var(--text);
  border: none;
  border-radius: 50px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.02em;
}

.btn-line-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
}

.btn-line-login:active {
  transform: translateY(0) scale(0.98);
}

.line-icon {
  background: #06C755;
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.login-note {
  color: white;
  opacity: 0.65;
  margin-top: 20px;
  font-size: 13px;
  font-weight: 400;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 24px 20px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 480px;
  margin: 0 auto;
}

.user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.user-info span {
  font-size: 14px;
  opacity: 0.9;
  font-weight: 500;
}

.btn-text {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 20px;
  transition: background 0.2s ease;
  font-weight: 500;
}

.btn-text:hover {
  background: rgba(255,255,255,0.25);
}

.header h1 {
  font-size: 26px;
  margin-bottom: 6px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header p {
  font-size: 14px;
  opacity: 0.85;
  font-weight: 400;
}

/* Sections */
.section {
  background: var(--white);
  padding: 24px 20px;
  margin-bottom: 8px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Form Elements */
.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.input-group select,
.input-group input,
.input-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: var(--white);
  transition: all 0.2s ease;
  color: var(--text);
}

.input-group select:focus,
.input-group input:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 199, 85, 0.12);
}

.input-group textarea {
  min-height: 100px;
  resize: vertical;
}

/* Calendar Widget */
.calendar-wrapper {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.2s ease;
}

.calendar-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 199, 85, 0.12);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.cal-nav {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  font-size: 16px;
  font-weight: bold;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.cal-nav:hover {
  background: var(--primary);
  color: white;
}

.cal-nav:active {
  transform: scale(0.95);
}

.cal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-dow {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cal-days {
  margin-top: 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  background: transparent;
  color: var(--text);
  position: relative;
}

.cal-day:hover:not(.disabled):not(.selected) {
  background: rgba(6, 199, 85, 0.08);
}

.cal-day.selected {
  background: var(--primary);
  color: white;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(6, 199, 85, 0.35);
}

.cal-day.today {
  font-weight: 700;
  color: var(--primary);
}

.cal-day.today::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
}

.cal-day.disabled {
  color: var(--border);
  cursor: not-allowed;
  background: transparent;
}

.cal-day.other-month {
  color: var(--border);
}

.calendar-note {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 8px;
  text-align: center;
}

/* Menu Items */
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 16px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(6, 199, 85, 0.08);
  transform: translateY(-1px);
}

.item-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  flex-shrink: 0;
  overflow: hidden;
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.item-placeholder {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 5px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.item-desc {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 10px;
  line-height: 1.4;
}

.item-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.item-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--white);
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  user-select: none;
}

.qty-btn:hover {
  background: var(--primary);
  color: var(--white);
}

.qty-btn:active {
  transform: scale(0.92);
}

.qty-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  border-color: var(--border);
  color: var(--border);
}

.qty-value {
  font-size: 18px;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
  color: var(--text);
}

/* Cart Footer */
.cart-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  z-index: 1000;
}

.cart-info {
  flex: 1;
}

.cart-total {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 4px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.cart-amount {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.btn-checkout {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(6, 199, 85, 0.25);
}

.btn-checkout:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 199, 85, 0.35);
}

.btn-checkout:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn-checkout:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--border);
  box-shadow: none;
}

.spacer {
  height: 100px;
}

/* Checkout Screen */
.checkout-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.btn-back {
  background: rgba(6, 199, 85, 0.08);
  border: none;
  color: var(--primary);
  font-size: 15px;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.btn-back:hover {
  background: rgba(6, 199, 85, 0.15);
}

.checkout-header h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.checkout-summary {
  background: var(--bg);
  padding: 24px;
  border-radius: var(--radius);
}

.checkout-summary h3 {
  margin-bottom: 20px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.checkout-item:last-child {
  border-bottom: none;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 16px;
}

.summary-row.discount {
  color: var(--danger);
  font-weight: 600;
}

.summary-row.total {
  font-size: 22px;
  font-weight: 800;
  border-top: 2px solid var(--border);
  padding-top: 16px;
  margin-top: 8px;
  letter-spacing: -0.02em;
}

/* Coupon */
.coupon-section {
  background: var(--bg);
  padding: 24px;
  border-radius: var(--radius);
}

.coupon-section label {
  display: block;
  font-weight: 700;
  margin-bottom: 14px;
  font-size: 15px;
}

.coupon-input {
  display: flex;
  gap: 10px;
}

.coupon-input input {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  transition: all 0.2s ease;
}

.coupon-input input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 199, 85, 0.12);
}

.btn-small {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-small:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 199, 85, 0.25);
}

.btn-small:active {
  transform: translateY(0) scale(0.98);
}

#coupon-message {
  margin-top: 10px;
  font-size: 14px;
  min-height: 20px;
  font-weight: 500;
}

#coupon-message.success {
  color: var(--primary);
}

#coupon-message.error {
  color: var(--danger);
}

/* Points */
.points-section {
  background: var(--bg);
  padding: 24px;
  border-radius: var(--radius);
}

.points-section label {
  display: block;
  font-weight: 700;
  margin-bottom: 14px;
  font-size: 15px;
}

.points-section label span {
  font-weight: 500;
  color: var(--text-light);
  font-size: 14px;
}

.points-control {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

#points-to-use {
  font-size: 22px;
  font-weight: 800;
  min-width: 40px;
  text-align: center;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* Final Summary */
.final-summary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 28px 24px;
  border-radius: var(--radius);
  text-align: center;
}

.final-summary .summary-row {
  font-size: 26px;
  margin-bottom: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.points-earn {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 18px;
  font-weight: 500;
}

.pickup-info {
  text-align: left;
  background: rgba(255,255,255,0.15);
  padding: 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.pickup-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pickup-row:last-child {
  margin-bottom: 0;
}

.pickup-label {
  opacity: 0.8;
}

.detail-label {
  display: inline-block;
  min-width: 48px;
  color: var(--text-light);
  font-weight: 500;
}

/* Success Screen */
.success-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(6, 199, 85, 0.06) 0%, var(--bg) 40%);
}

.success-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: white;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(6, 199, 85, 0.25);
}

.success-container h2 {
  font-size: 28px;
  margin-bottom: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.order-number {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 20px;
  background: rgba(6, 199, 85, 0.08);
  padding: 8px 20px;
  border-radius: 20px;
  display: inline-block;
}

.success-message {
  color: var(--text-light);
  margin-bottom: 28px;
  line-height: 1.7;
  font-size: 15px;
  max-width: 320px;
}

.success-details {
  background: var(--white);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 28px;
  text-align: left;
  width: 100%;
  max-width: 400px;
  border: 1.5px solid var(--border);
}

.success-details p {
  margin-bottom: 10px;
  font-size: 15px;
  display: flex;
  gap: 12px;
}

.success-details p:last-child {
  margin-bottom: 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  padding: 16px 48px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(6, 199, 85, 0.25);
  letter-spacing: 0.02em;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 199, 85, 0.35);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

/* Responsive */
@media (min-width: 768px) {
  body {
    background: #E8E8E8;
  }
  
  .screen {
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg);
    min-height: 100vh;
  }
  
  .cart-footer {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Loading State */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Error State */
.error-message {
  color: var(--danger);
  font-size: 14px;
  margin-top: 8px;
  padding: 12px;
  background: rgba(255, 59, 48, 0.1);
  border-radius: var(--radius-sm);
  display: none;
}

.error-message.visible {
  display: block;
}
