/*!
 * Madam 3 Kitchen Responsive Grid & Base Utility Styles
 * Optimized for Mobile-first Nigerian Food Ordering System
 */
:root {
  --primary: #FF6B00;
  --primary-dark: #D84315;
  --primary-light: #FFE0B2;
  --secondary: #2E1A11;
  --secondary-light: #4E342E;
  --accent: #FFB300;
  --success: #2E7D32;
  --danger: #D32F2F;
  --warning: #F57C00;
  --info: #0288D1;
  --bg-cream: #FDFBF7;
  --bg-warm: #FFF8F0;
  --card-bg: #FFFFFF;
  --text-dark: #1F2421;
  --text-muted: #6B7280;
  --border-color: #EADBC8;
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 2px 8px rgba(46, 26, 17, 0.06);
  --shadow-md: 0 8px 24px rgba(46, 26, 17, 0.09);
  --shadow-lg: 0 16px 40px rgba(46, 26, 17, 0.12);
  --shadow-hover: 0 14px 32px rgba(255, 107, 0, 0.18);
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-cream);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--secondary);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 4vw + 1rem, 3.25rem); }
h2 { font-size: clamp(1.6rem, 2.5vw + 1rem, 2.4rem); }
h3 { font-size: clamp(1.25rem, 1.5vw + 0.8rem, 1.75rem); }
h4 { font-size: 1.35rem; }
h5 { font-size: 1.15rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 1rem; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; vertical-align: middle; }

/* Grid System */
.container, .container-fluid {
  width: 100%;
  padding-right: 1.25rem;
  padding-left: 1.25rem;
  margin-right: auto;
  margin-left: auto;
}

.container {
  max-width: 1240px;
}

.container-narrow {
  max-width: 860px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -0.75rem;
  margin-left: -0.75rem;
}

.row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
}

.g-2 { margin-right: -0.375rem; margin-left: -0.375rem; }
.g-2 > * { padding-right: 0.375rem; padding-left: 0.375rem; }
.g-3 { margin-right: -0.5rem; margin-left: -0.5rem; }
.g-3 > * { padding-right: 0.5rem; padding-left: 0.5rem; }
.g-4 { margin-right: -1rem; margin-left: -1rem; }
.g-4 > * { padding-right: 1rem; padding-left: 1rem; }

.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }

@media (min-width: 576px) {
  .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
  .col-sm-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
  .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (min-width: 768px) {
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
  .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (min-width: 992px) {
  .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
  .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-lg-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
  .col-lg-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
}

@media (min-width: 1200px) {
  .col-xl-3 { flex: 0 0 25%; max-width: 25%; }
  .col-xl-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-xl-6 { flex: 0 0 50%; max-width: 50%; }
}

/* Flexbox Utilities */
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }
.d-grid { display: grid !important; }

@media (min-width: 576px) { .d-sm-block { display: block !important; } .d-sm-none { display: none !important; } .d-sm-flex { display: flex !important; } }
@media (min-width: 768px) { .d-md-block { display: block !important; } .d-md-none { display: none !important; } .d-md-flex { display: flex !important; } }
@media (min-width: 992px) { .d-lg-block { display: block !important; } .d-lg-none { display: none !important; } .d-lg-flex { display: flex !important; } }

.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }

.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }

.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-stretch { align-items: stretch !important; }

.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.gap-5 { gap: 2rem !important; }

/* Spacing */
.m-0 { margin: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 2.5rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 2.5rem !important; }
.my-2 { margin-top: 0.5rem !important; margin-bottom: 0.5rem !important; }
.my-3 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
.my-5 { margin-top: 2.5rem !important; margin-bottom: 2.5rem !important; }

.p-0 { padding: 0 !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 2.5rem !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.px-5 { padding-left: 2.5rem !important; padding-right: 2.5rem !important; }

/* Text Utilities */
.text-start { text-align: left !important; }
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-white { color: #ffffff !important; }
.text-gold { color: var(--accent) !important; }

.fw-normal { font-weight: 400 !important; }
.fw-medium { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.fw-extrabold { font-weight: 800 !important; }

.fs-xs { font-size: 0.75rem !important; }
.fs-sm { font-size: 0.875rem !important; }
.fs-base { font-size: 1rem !important; }
.fs-lg { font-size: 1.125rem !important; }
.fs-xl { font-size: 1.25rem !important; }
.fs-2xl { font-size: 1.5rem !important; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.4;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, #FF6B00 0%, #E65100 100%);
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(255, 107, 0, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #E65100 0%, #BF360C 100%);
  box-shadow: 0 6px 20px rgba(255, 107, 0, 0.45);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--secondary);
  color: #FFFFFF !important;
}

.btn-secondary:hover {
  background: var(--secondary-light);
  transform: translateY(-2px);
}

.btn-outline-primary {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary) !important;
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: #FFFFFF !important;
}

.btn-outline-secondary {
  background: transparent;
  border-color: var(--border-color);
  color: var(--secondary) !important;
}

.btn-outline-secondary:hover {
  background: var(--secondary);
  color: #FFFFFF !important;
  border-color: var(--secondary);
}

.btn-whatsapp {
  background: #25D366;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp:hover {
  background: #1EBE5D;
  transform: translateY(-2px);
}

.btn-success {
  background: var(--success);
  color: #FFFFFF !important;
}

.btn-danger {
  background: var(--danger);
  color: #FFFFFF !important;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.825rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.95rem 1.85rem;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
}

.btn-block, .w-100 {
  width: 100% !important;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--secondary);
  margin-bottom: 0.4rem;
}

.form-control, .form-select {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-dark);
  background-color: #FFFFFF;
  background-clip: padding-box;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
  outline: none;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.15);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  border-radius: 999px;
}

.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: #E8F5E9; color: #2E7D32; }
.badge-warning { background: #FFF3E0; color: #E65100; }
.badge-danger { background: #FFEBEE; color: #C62828; }
.badge-secondary { background: #EFEBE9; color: #4E342E; }
.badge-dark { background: var(--secondary); color: #FFF8F0; }

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-body {
  padding: 1.5rem;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  margin-bottom: 1rem;
  color: var(--text-dark);
  vertical-align: top;
  border-collapse: collapse;
}

.table th, .table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.table th {
  background: var(--bg-warm);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success { background: #E8F5E9; color: #1B5E20; border: 1px solid #A5D6A7; }
.alert-danger { background: #FFEBEE; color: #B71C1C; border: 1px solid #FFCDD2; }
.alert-warning { background: #FFF3E0; color: #E65100; border: 1px solid #FFE0B2; }
.alert-info { background: #E1F5FE; color: #01579B; border: 1px solid #B3E5FC; }
