@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #FDFBF7; /* Warm off-white */
  --bg-secondary: #FFFFFF;
  --text-primary: #1F2937; /* Gray 800 */
  --text-secondary: #6B7280; /* Gray 500 */
  --border-color: #F3F4F6;
  --accent-color: #EA580C; /* Burnt Orange */
  --accent-light: #FFF7ED; /* Orange 50 */
  --accent-dark: #C2410C;
  
  --cubic-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --cubic-snappy: cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Typography Rules */
h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: #111827; /* Gray 900 for headings */
}

p {
  color: var(--text-secondary);
  line-height: 1.6;
  text-wrap: pretty;
}

/* Animations & Transitions */
.transition-snappy {
  transition: all 400ms var(--cubic-snappy);
}

.transition-spring {
  transition: transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Hide scrollbar for clean UI */
.hide-scroll::-webkit-scrollbar {
  display: none;
}
.hide-scroll {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Glassmorphism */
.glass {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.glass-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 1);
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.03), 0 10px 15px -3px rgba(0, 0, 0, 0.02);
}

/* Mobile First Bottom Sheet */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-secondary);
  border-top-left-radius: 32px;
  border-top-right-radius: 32px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.08);
  transform: translateY(100%);
  transition: transform 500ms var(--cubic-spring);
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Drag Handle for Bottom Sheet */
.drag-handle {
  width: 48px;
  height: 6px;
  background-color: #E5E7EB;
  border-radius: 9999px;
  margin: 16px auto;
}

@media (min-width: 768px) {
  .bottom-sheet {
    left: auto;
    right: 2rem;
    bottom: 2rem;
    width: 26rem; 
    height: calc(100vh - 4rem) !important;
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(calc(100% + 4rem));
  }
}

.bottom-sheet.open {
  transform: translateY(0);
}

.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(17, 24, 39, 0.4); /* Gray 900 */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms var(--cubic-snappy);
  z-index: 40;
}

.bottom-sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Add Button Micro-Animation */
.add-btn {
  background-color: var(--accent-light);
  color: var(--accent-color);
}
.add-btn:active {
  transform: scale(0.9);
}

/* Tabular numbers */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Custom Checkbox / Radio for Payment */
.payment-select {
  appearance: none;
  background-color: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  cursor: inherit;
  line-height: inherit;
  outline: none;
  font-weight: 600;
  color: var(--accent-color);
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: env(safe-area-inset-top, 20px);
  left: 50%;
  transform: translateX(-50%) translateY(-150%);
  z-index: 60;
  transition: transform 500ms var(--cubic-spring), opacity 400ms ease;
  opacity: 0;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.toast-container.show {
  transform: translateX(-50%) translateY(20px);
  opacity: 1;
}

.toast-content {
  background: rgba(31, 41, 55, 0.95); /* Gray 800 */
  backdrop-filter: blur(12px);
  padding: 14px 20px;
  border-radius: 16px;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #FFFFFF;
}

.toast-error .toast-icon { color: #F87171; }
.toast-success .toast-icon { color: #34D399; }

/* Image placeholder animation */
@keyframes pulse-bg {
  0%, 100% { background-color: #F3F4F6; }
  50% { background-color: #E5E7EB; }
}
.img-placeholder {
  animation: pulse-bg 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Add to Cart Animation Keyframes */
@keyframes flyToCart {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.1) translateY(300px); opacity: 0; }
}

/* Swipe Hint Animation */
@keyframes swipe-hand {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-15px) rotate(-5deg); }
  75% { transform: translateX(15px) rotate(5deg); }
}

.swipe-animation {
  animation: swipe-hand 2s ease-in-out infinite;
}
