@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Great+Vibes&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Color Palette based on Branding Image */
  --bg-cream: #F4F0E6;
  --bg-card: #FFFFFF;
  --text-primary: #2C3E2B;
  --text-muted: #4A4A4A;
  --accent-sage: #8A9A86;
  --accent-sage-light: #A5B3A1;
  --accent-wood: #C8A27B;
  --border-light: #E8E5DF;
  --success: #7A8B75;
  --error: #D67A7A;
  
  /* Typography */
  --font-serif: 'Inter', sans-serif;
  --font-sans: 'Inter', sans-serif;
  --font-subtitle: 'Montserrat', sans-serif;
  --font-script: 'Great Vibes', cursive;
  
  --radius: 12px;
  --shadow-soft: 0 4px 20px rgba(44, 62, 43, 0.05);
  --shadow-hover: 0 8px 30px rgba(44, 62, 43, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-cream);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
  touch-action: pan-y pinch-zoom; /* Fix for horizontal swipe-back gesture accuracy */
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  text-align: center;
  padding: 12px 0 8px 0;
}

.logo-leaf-icon {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: -4px;
}

.logo-text {
  font-family: var(--font-subtitle);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 0;
}

.logo-subtitle {
  font-family: var(--font-subtitle);
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 5px;
  text-transform: uppercase;
  margin-top: 2px;
}

.tagline {
  font-family: var(--font-script);
  font-size: 1.4rem;
  color: #1a2919;
  font-weight: 700;
  margin-top: 2px;
  opacity: 1;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

/* Sample Photos Showcase */
.sample-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.polaroid-frame {
  background: #ffffff;
  padding: 12px 12px 30px 12px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.04);
  transform: rotate(-1.5deg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.polaroid-frame:nth-child(even) {
  transform: rotate(2deg);
}

.polaroid-frame:hover {
  transform: rotate(0deg) scale(1.02);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

.polaroid-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: #f8f6f0;
}

.polaroid-caption {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  margin-top: 10px;
}

/* Quantity Selection Buttons */
.quantity-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0 24px 0;
}

.qty-btn {
  background: var(--bg-cream);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 14px 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-family: var(--font-sans);
}

.qty-btn.active {
  background: var(--text-primary);
  color: #ffffff;
  border-color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(44, 62, 43, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  font-family: var(--font-subtitle);
  text-transform: uppercase;
}

.btn-primary {
  background: var(--text-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(44, 62, 43, 0.15);
}

.btn-primary:hover, .btn-primary:active {
  background: var(--accent-sage);
  box-shadow: 0 6px 16px rgba(138, 154, 134, 0.25);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-cream);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: #F0EDE5;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--text-primary);
  color: var(--text-primary);
}

/* Upload Slots */
.upload-slot-card {
  background: #fff;
  border: 1px dashed var(--accent-sage-light);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  margin-bottom: 0;
  position: relative;
  transition: all 0.2s ease;
}

.upload-slot-card.has-image {
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  padding: 16px 16px 32px 16px; /* Increased padding to make image smaller */
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.upload-slot-title {
  font-family: var(--font-subtitle);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.upload-slot-card.has-image .upload-slot-title {
  display: none; /* Hide title when image is shown to look like polaroid */
}

.preview-box {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: #f8f6f0;
  margin-bottom: 12px;
}

.file-input {
  display: none;
}

.upload-trigger-btn {
  background: var(--bg-cream);
  border: 1px solid var(--border-light);
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.upload-trigger-btn:hover {
  background: #F0EDE5;
}

.slot-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* Order Summary Table */
.summary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.summary-table td {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.summary-table tr:last-child td {
  border-bottom: none;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
  padding-top: 16px;
}

/* Badges */
.feature-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  margin-bottom: 12px;
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  width: 80px;
}

.badge-icon {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 6px;
  opacity: 0.8;
}

.status-badge {
  background: var(--bg-cream);
  color: var(--text-primary);
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.8rem;
  border: 1px solid var(--border-light);
}

/* Order Success Box */
.success-banner {
  text-align: center;
  padding: 32px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: var(--shadow-soft);
}

.order-number-display {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 2px;
  margin: 16px 0;
}

.wait-time-badge {
  display: inline-block;
  background: var(--bg-cream);
  color: var(--accent-wood);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid var(--border-light);
}

/* Footer */
.footer {
  margin-top: auto;
  padding: 8px 0;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

/* Popups and Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card);
  padding: 32px 24px;
  border-radius: var(--radius);
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transform: scale(0.8);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease-in-out;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
  opacity: 1;
}

.modal-input {
  width: 100px;
  padding: 12px;
  font-size: 1.5rem;
  text-align: center;
  border: 2px solid var(--border-light);
  border-radius: 8px;
  margin: 16px 0;
  font-family: var(--font-sans);
  color: var(--text-primary);
  outline: none;
}
.modal-input:focus {
  border-color: var(--text-primary);
}

/* Cropper Customizations */
.cropper-view-box,
.cropper-face {
  border-radius: 4px;
}
.cropper-view-box {
  outline: 2px solid var(--accent-sage);
  outline-color: rgba(138, 154, 134, 0.8);
}
.cropper-point {
  background-color: var(--accent-sage);
}

/* Thermal Cash Receipt Old-Style Bus Ticket Design */
.thermal-receipt {
  background: #ffffff;
  width: 90%;
  max-width: 300px;
  margin: 16px auto;
  padding: 16px 14px;
  font-family: 'Courier New', Courier, monospace;
  color: #111111;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  position: relative;
  border-top: none;
  border-bottom: none;
}

/* Sharp ZigZag Sawtooth Edges Top and Bottom */
.thermal-receipt::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  width: 100%;
  height: 10px;
  background: linear-gradient(135deg, transparent 50%, #ffffff 50%),
              linear-gradient(225deg, transparent 50%, #ffffff 50%);
  background-position: top left;
  background-size: 10px 10px;
  background-repeat: repeat-x;
}

.thermal-receipt::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 10px;
  background: linear-gradient(45deg, transparent 50%, #ffffff 50%),
              linear-gradient(315deg, transparent 50%, #ffffff 50%);
  background-position: bottom left;
  background-size: 10px 10px;
  background-repeat: repeat-x;
}

.receipt-divider {
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: -1px;
  font-size: 0.72rem;
  color: #444444;
  margin: 4px 0;
  text-align: center;
  font-weight: 700;
}
