/* ===== Base Styles ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ea580c;
  color: #fff;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  background: #c2410c;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

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

.btn-danger {
  background: #dc2626;
  color: #fff;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background 0.15s ease;
}

.btn-danger:hover {
  background: #b91c1c;
}

/* ===== Cards ===== */
.card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 1.25rem;
  border: 1px solid #f0f0f0;
}

/* ===== Forms ===== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  background: #fff;
  color: #1f2937;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #ea580c;
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.2);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

/* ===== Tables ===== */
table {
  border-collapse: collapse;
}

table th {
  font-weight: 600;
  color: #6b7280;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

table td {
  color: #374151;
}

/* ===== Utility ===== */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Responsive Enhancements ===== */
@media (max-width: 640px) {
  .card {
    padding: 0.75rem;
    border-radius: 0.5rem;
  }

  .card.overflow-x-auto::-webkit-scrollbar {
    height: 6px;
  }
  .card.overflow-x-auto::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
  }

  .btn {
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    min-height: 44px;
  }

  .btn-secondary {
    width: 100%;
  }

  input, select, textarea {
    font-size: 16px !important;
  }

  #nav-links {
    max-height: 80vh;
    overflow-y: auto;
  }
}

/* Desktop: hover effects */
@media (min-width: 641px) {
  .card {
    transition: box-shadow 0.2s ease;
  }

  .card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .btn {
    transition: all 0.15s ease;
  }

  .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
  }
}

/* ===== Toast notification ===== */
#cart-toast {
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===== Collapsible category arrow ===== */
.rotate-180 {
  transform: rotate(180deg);
}

/* ===== Notification badge pulse ===== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ===== Sticky category menubar ===== */
nav.sticky ul {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

nav.sticky ul::-webkit-scrollbar {
  display: none;
}

/* ===== Print-friendly bill ===== */
@media print {
  nav, footer, .btn, #cart-toast, button {
    display: none !important;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}


/* ===== Toggle Switch ===== */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

input[type="checkbox"]:checked {
  background: #ea580c;
}

input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}

.toggle-slider {
  display: none;
}
