/* ===== Happy Food Warehouse — Warm Artisan Theme ===== */

:root {
  --hfw-primary: #C2452D;
  --hfw-primary-dark: #9E3723;
  --hfw-primary-light: #E8654D;
  --hfw-gold: #D4A24E;
  --hfw-gold-light: #F0C97A;
  --hfw-espresso: #2D1810;
  --hfw-bark: #5C3A28;
  --hfw-warm-gray: #8B7355;
  --hfw-cream: #FDF6F0;
  --hfw-cream-dark: #F5EBE0;
  --hfw-white: #FFFFFF;
  --hfw-shadow-warm: 0 2px 16px rgba(45, 24, 16, 0.08);
  --hfw-shadow-hover: 0 8px 32px rgba(45, 24, 16, 0.14);
  --hfw-radius: 12px;
  --hfw-radius-sm: 8px;
  --hfw-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Global ---- */
* { box-sizing: border-box; }

body {
  font-family: "Noto Sans SC", -apple-system, "Segoe UI", sans-serif;
  background: var(--hfw-cream);
  color: var(--hfw-espresso);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

a { color: var(--hfw-primary); text-decoration: none; transition: color var(--hfw-transition); }
a:hover { color: var(--hfw-primary-dark); }

/* ---- Navbar ---- */
.hfw-nav {
  background: linear-gradient(135deg, var(--hfw-espresso) 0%, var(--hfw-bark) 100%);
  padding: 0;
  border-bottom: 3px solid var(--hfw-gold);
  box-shadow: 0 4px 20px rgba(45, 24, 16, 0.25);
}

.hfw-nav .navbar-brand {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--hfw-gold-light) !important;
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hfw-nav .navbar-brand i {
  font-size: 1.5rem;
  color: var(--hfw-gold);
}

.hfw-nav .nav-link {
  color: rgba(255,255,255,0.75) !important;
  font-weight: 500;
  font-size: 0.92rem;
  padding: 16px 18px !important;
  position: relative;
  transition: color var(--hfw-transition);
}

.hfw-nav .nav-link:hover,
.hfw-nav .nav-link.active {
  color: var(--hfw-gold-light) !important;
}

.hfw-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 18px;
  right: 18px;
  height: 3px;
  background: var(--hfw-gold);
  border-radius: 3px 3px 0 0;
  transform: scaleX(0);
  transition: transform var(--hfw-transition);
}

.hfw-nav .nav-link:hover::after,
.hfw-nav .nav-link.active::after {
  transform: scaleX(1);
}

.hfw-nav .badge {
  background: var(--hfw-primary) !important;
  font-size: 0.7rem;
  vertical-align: top;
  margin-left: 2px;
}

.hfw-nav .navbar-text {
  color: rgba(255,255,255,0.6) !important;
  font-size: 0.85rem;
}

.hfw-nav .btn-outline-light {
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.7);
  font-size: 0.82rem;
  border-radius: 20px;
  padding: 4px 16px;
}

.hfw-nav .btn-outline-light:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}

/* ---- Page Container ---- */
.hfw-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ---- Page Title ---- */
.hfw-page-title {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--hfw-espresso);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hfw-page-title i {
  color: var(--hfw-gold);
  font-size: 1.3rem;
}

/* ---- Cards ---- */
.hfw-card {
  background: var(--hfw-white);
  border: 1px solid rgba(45, 24, 16, 0.06);
  border-radius: var(--hfw-radius);
  box-shadow: var(--hfw-shadow-warm);
  transition: box-shadow var(--hfw-transition), transform var(--hfw-transition);
  overflow: hidden;
}

.hfw-card:hover {
  box-shadow: var(--hfw-shadow-hover);
  transform: translateY(-2px);
}

.hfw-card-header {
  background: linear-gradient(135deg, var(--hfw-cream-dark) 0%, var(--hfw-cream) 100%);
  padding: 14px 20px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--hfw-bark);
  border-bottom: 1px solid rgba(45, 24, 16, 0.06);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hfw-card-header i { color: var(--hfw-gold); }

.hfw-card-body { padding: 20px; }

/* ---- Product Card ---- */
.hfw-product-card {
  background: var(--hfw-white);
  border: 1px solid rgba(45, 24, 16, 0.06);
  border-radius: var(--hfw-radius);
  box-shadow: var(--hfw-shadow-warm);
  transition: all var(--hfw-transition);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.hfw-product-card:hover {
  box-shadow: var(--hfw-shadow-hover);
  transform: translateY(-4px);
}

.hfw-product-img {
  height: 180px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, var(--hfw-cream-dark), var(--hfw-cream));
  display: flex;
  align-items: center;
  justify-content: center;
}

.hfw-product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.hfw-product-card:hover .hfw-product-img img {
  transform: scale(1.06);
}

.hfw-product-img .bi-image {
  font-size: 3rem;
  color: var(--hfw-warm-gray);
  opacity: 0.4;
}

.hfw-product-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hfw-product-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--hfw-espresso);
}

.hfw-product-spec {
  font-size: 0.8rem;
  color: var(--hfw-warm-gray);
  margin-bottom: 10px;
}

.hfw-product-price {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--hfw-primary);
  margin-top: auto;
}

.hfw-product-price small {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--hfw-warm-gray);
}

.hfw-product-footer {
  padding: 0 16px 16px;
}

/* ---- Category Sidebar ---- */
.hfw-category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hfw-category-item {
  display: block;
  padding: 12px 18px;
  color: var(--hfw-bark);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--hfw-radius-sm);
  margin-bottom: 4px;
  transition: all var(--hfw-transition);
  border-left: 3px solid transparent;
}

.hfw-category-item:hover {
  background: var(--hfw-cream-dark);
  color: var(--hfw-primary);
  border-left-color: var(--hfw-gold);
}

.hfw-category-item.active {
  background: linear-gradient(135deg, var(--hfw-primary), var(--hfw-primary-dark));
  color: #fff !important;
  border-left-color: var(--hfw-gold);
  box-shadow: 0 2px 8px rgba(194, 69, 45, 0.3);
}

/* ---- Buttons ---- */
.hfw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  border: none;
  border-radius: var(--hfw-radius-sm);
  padding: 10px 20px;
  cursor: pointer;
  transition: all var(--hfw-transition);
}

.hfw-btn-primary {
  background: linear-gradient(135deg, var(--hfw-primary), var(--hfw-primary-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(194, 69, 45, 0.3);
}

.hfw-btn-primary:hover {
  background: linear-gradient(135deg, var(--hfw-primary-light), var(--hfw-primary));
  box-shadow: 0 4px 16px rgba(194, 69, 45, 0.4);
  transform: translateY(-1px);
  color: #fff;
}

.hfw-btn-gold {
  background: linear-gradient(135deg, var(--hfw-gold), #C69440);
  color: #fff;
  box-shadow: 0 2px 8px rgba(212, 162, 78, 0.3);
}

.hfw-btn-gold:hover {
  box-shadow: 0 4px 16px rgba(212, 162, 78, 0.4);
  transform: translateY(-1px);
  color: #fff;
}

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

.hfw-btn-outline:hover {
  background: var(--hfw-primary);
  color: #fff;
}

.hfw-btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: 6px;
}

.hfw-btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
  border-radius: var(--hfw-radius);
}

.hfw-btn-block { width: 100%; }

.hfw-btn-outline-danger {
  background: transparent;
  color: #c0392b;
  border: 1.5px solid #e0c5c0;
}

.hfw-btn-outline-danger:hover {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}

.hfw-btn-outline-success {
  background: transparent;
  color: #27ae60;
  border: 1.5px solid #b5d8c5;
}

.hfw-btn-outline-success:hover {
  background: #27ae60;
  color: #fff;
  border-color: #27ae60;
}

/* ---- Status Badges ---- */
.hfw-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hfw-badge-pending { background: #FFF3E0; color: #E65100; }
.hfw-badge-approved { background: #E3F2FD; color: #1565C0; }
.hfw-badge-shipped { background: #F3E5F5; color: #7B1FA2; }
.hfw-badge-completed { background: #E8F5E9; color: #2E7D32; }
.hfw-badge-cancelled { background: #FAFAFA; color: #757575; }
.hfw-badge-default { background: linear-gradient(135deg, var(--hfw-gold), #C69440); color: #fff; }

/* ---- Status Pills (Order List) ---- */
.hfw-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.hfw-pill {
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--hfw-bark);
  background: var(--hfw-white);
  border: 1px solid rgba(45, 24, 16, 0.1);
  transition: all var(--hfw-transition);
}

.hfw-pill:hover {
  border-color: var(--hfw-primary);
  color: var(--hfw-primary);
  background: rgba(194, 69, 45, 0.04);
}

.hfw-pill.active {
  background: linear-gradient(135deg, var(--hfw-primary), var(--hfw-primary-dark));
  color: #fff !important;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(194, 69, 45, 0.3);
}

/* ---- Tables ---- */
.hfw-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.hfw-table thead th {
  background: var(--hfw-cream-dark);
  color: var(--hfw-warm-gray);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 2px solid rgba(45, 24, 16, 0.08);
}

.hfw-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(45, 24, 16, 0.04);
  font-size: 0.9rem;
  vertical-align: middle;
}

.hfw-table tbody tr:hover {
  background: rgba(253, 246, 240, 0.6);
}

/* ---- Form Inputs ---- */
.hfw-input {
  border: 1.5px solid rgba(45, 24, 16, 0.12);
  border-radius: var(--hfw-radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--hfw-espresso);
  background: var(--hfw-white);
  transition: all var(--hfw-transition);
  width: 100%;
}

.hfw-input:focus {
  outline: none;
  border-color: var(--hfw-gold);
  box-shadow: 0 0 0 3px rgba(212, 162, 78, 0.15);
}

.hfw-input::placeholder { color: #bfa98a; }

.hfw-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--hfw-bark);
  margin-bottom: 6px;
}

/* ---- Alert messages ---- */
.hfw-alert {
  border-radius: var(--hfw-radius-sm);
  padding: 14px 20px;
  font-size: 0.9rem;
  border: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hfw-alert-success {
  background: #E8F5E9;
  color: #2E7D32;
}

.hfw-alert-error {
  background: #FFEBEE;
  color: #C62828;
}

.hfw-alert-warning {
  background: #FFF3E0;
  color: #E65100;
}

/* ---- Login Page ---- */
.hfw-login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--hfw-espresso) 0%, var(--hfw-bark) 40%, var(--hfw-primary-dark) 100%);
  position: relative;
  overflow: hidden;
}

.hfw-login-wrapper::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(212, 162, 78, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hfw-login-wrapper::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(194, 69, 45, 0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.hfw-login-card {
  background: var(--hfw-white);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

.hfw-login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.hfw-login-logo i {
  font-size: 2.5rem;
  color: var(--hfw-gold);
  display: block;
  margin-bottom: 12px;
}

.hfw-login-logo h2 {
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--hfw-espresso);
  margin: 0;
}

.hfw-login-logo p {
  color: var(--hfw-warm-gray);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* ---- Empty State ---- */
.hfw-empty {
  text-align: center;
  padding: 60px 20px;
}

.hfw-empty i {
  font-size: 4rem;
  color: var(--hfw-warm-gray);
  opacity: 0.3;
  display: block;
  margin-bottom: 16px;
}

.hfw-empty p {
  color: var(--hfw-warm-gray);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

/* ---- Address Card ---- */
.hfw-address-card {
  background: var(--hfw-white);
  border: 1.5px solid rgba(45, 24, 16, 0.06);
  border-radius: var(--hfw-radius);
  padding: 20px;
  margin-bottom: 12px;
  transition: all var(--hfw-transition);
  box-shadow: var(--hfw-shadow-warm);
}

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

.hfw-address-card.is-default {
  border-color: var(--hfw-gold);
  background: linear-gradient(135deg, #FFFBF5, var(--hfw-white));
}

/* ---- Radio address select in cart ---- */
.hfw-address-radio {
  padding: 14px 18px;
  border: 1.5px solid rgba(45, 24, 16, 0.08);
  border-radius: var(--hfw-radius-sm);
  margin-bottom: 8px;
  transition: all var(--hfw-transition);
  cursor: pointer;
}

.hfw-address-radio:hover {
  border-color: var(--hfw-gold);
  background: rgba(253, 246, 240, 0.5);
}

.hfw-address-radio input[type="radio"] {
  accent-color: var(--hfw-primary);
}

/* ---- Order Card ---- */
.hfw-order-card {
  background: var(--hfw-white);
  border: 1px solid rgba(45, 24, 16, 0.06);
  border-radius: var(--hfw-radius);
  margin-bottom: 16px;
  box-shadow: var(--hfw-shadow-warm);
  overflow: hidden;
  transition: box-shadow var(--hfw-transition);
}

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

.hfw-order-header {
  padding: 14px 20px;
  background: var(--hfw-cream-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(45, 24, 16, 0.04);
  font-size: 0.85rem;
  color: var(--hfw-warm-gray);
}

.hfw-order-body {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---- Cart Summary ---- */
.hfw-cart-summary {
  background: linear-gradient(135deg, var(--hfw-cream-dark), var(--hfw-cream));
  border: 1px solid rgba(45, 24, 16, 0.06);
  border-radius: var(--hfw-radius);
  padding: 24px;
  box-shadow: var(--hfw-shadow-warm);
}

.hfw-total {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--hfw-primary);
}

/* ---- Quantity Input ---- */
.hfw-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hfw-qty input {
  width: 60px;
  text-align: center;
  border: 1.5px solid rgba(45, 24, 16, 0.1);
  border-radius: 6px;
  padding: 6px;
  font-size: 0.9rem;
  color: var(--hfw-espresso);
}

.hfw-qty input:focus {
  outline: none;
  border-color: var(--hfw-gold);
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hfw-animate {
  animation: fadeInUp 0.5s ease forwards;
}

.hfw-animate-delay-1 { animation-delay: 0.05s; opacity: 0; }
.hfw-animate-delay-2 { animation-delay: 0.1s; opacity: 0; }
.hfw-animate-delay-3 { animation-delay: 0.15s; opacity: 0; }
.hfw-animate-delay-4 { animation-delay: 0.2s; opacity: 0; }
.hfw-animate-delay-5 { animation-delay: 0.25s; opacity: 0; }
.hfw-animate-delay-6 { animation-delay: 0.3s; opacity: 0; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hfw-container { padding: 16px 12px 40px; }
  .hfw-product-img { height: 140px; }
  .hfw-login-card { padding: 32px 24px; margin: 16px; }
  .hfw-nav .nav-link { padding: 12px 14px !important; }
  .hfw-pills { gap: 6px; }
  .hfw-pill { padding: 6px 14px; font-size: 0.8rem; }
}
