/* ============================================
   DESIGN SYSTEM FOR DONG TAO CHICKEN WEBSITE
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  --primary:        #B71C1C; /* Đỏ đô - màu mào gà Đông Tảo chuẩn */
  --primary-light:  #EF5350;
  --primary-dark:   #7F0000;
  --primary-bg:     #FFEBEE;
  --accent:         #FF6F00; /* Vàng nghệ/Cam - màu da chân gà Đông Tảo */
  --accent-light:   #FFB300;
  --accent-bg:      #FFF8E1;
  --text-primary:   #212121;
  --text-secondary: #555555;
  --text-muted:     #9e9e9e;
  --bg-main:        #FFFDE7; /* Kem nhẹ sang trọng hoàng cung */
  --bg-white:       #FFFFFF;
  --border:         #E0E0E0;
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.12);
  --radius-md:      12px;
  --transition:     all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Nunito', sans-serif; }
body { background: var(--bg-main); color: var(--text-primary); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* TOP BAR */
.topbar { background: var(--primary-dark); color: white; font-size: 13px; padding: 8px 0; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar-left { display: flex; gap: 15px; }
.topbar-right a { margin-left: 15px; font-weight: 600; }
.divider { color: rgba(255,255,255,0.3); }

/* HEADER */
.header { background: var(--bg-white); box-shadow: var(--shadow-sm); padding: 15px 0; position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 32px; }
.logo-text strong { display: block; font-size: 22px; color: var(--primary); font-weight: 900; }
.logo-text span { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); font-weight: bold;}

.search-bar { flex: 1; max-width: 450px; display: flex; border: 2px solid var(--primary); border-radius: 24px; overflow: hidden; background: white;}
.search-bar input { flex: 1; padding: 10px 18px; border: none; outline: none; font-size: 14px; }
.search-bar .search-btn { background: var(--primary); border: none; padding: 0 20px; color: white; cursor: pointer; font-size: 16px; }

.header-actions { display: flex; gap: 20px; align-items: center; }
.header-action-item { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.header-action-item .icon { font-size: 24px; position: relative; width: 40px; height: 40px; background: var(--primary-bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--primary); }
.text-sm { font-size: 11px; color: var(--text-muted); }
.text-main { font-size: 14px; font-weight: 700; }

/* NAVBAR */
.navbar { background: var(--primary); color: white; padding: 12px 0; }
.nav-list { display: flex; gap: 30px; list-style: none; }
.nav-link { font-weight: 700; font-size: 15px; transition: var(--transition); cursor: pointer; }
.nav-link:hover { color: var(--accent-light); }

/* SLIDER */
.hero { height: 420px; position: relative; overflow: hidden; }
.slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.8s ease; display: flex; align-items: center; }
.slide.active { opacity: 1; z-index: 1; }
.slide-bg { position: absolute; top:0; left:0; width:100%; height:100%; background-size: cover; background-position: center; z-index: -1; }
.slide-content { max-width: 550px; color: white; z-index: 2; }
.slide-label { background: var(--accent); padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 800; display: inline-block; margin-bottom: 15px; text-transform: uppercase; }
.slide-content h1 { font-size: 40px; font-weight: 800; line-height: 1.2; margin-bottom: 15px; }
.slide-content p { font-size: 16px; margin-bottom: 25px; color: #f5f5f5; }
.btn { display: inline-block; padding: 12px 28px; border-radius: 24px; font-weight: 700; cursor: pointer; transition: var(--transition); border: none; }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: #e65100; transform: translateY(-2px); }
.btn-outline { background: transparent; border: 2px solid white; color: white; margin-left: 10px; }
.btn-outline:hover { background: white; color: var(--primary); }
.slider-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.4); border: none; color: white; width: 45px; height: 45px; border-radius: 50%; cursor: pointer; z-index: 10; font-size: 18px; transition: var(--transition); }
.slider-arrow:hover { background: var(--primary); }
.slider-prev { left: 20px; }
.slider-next { right: 20px; }
.slider-dots { position: absolute; bottom: 20px; width: 100%; display: flex; justify-content: center; gap: 8px; z-index: 10; }
.dot { width: 10px; height: 10px; background: rgba(255,255,255,0.4); border-radius: 50%; cursor: pointer; }
.dot.active { background: white; width: 24px; border-radius: 5px; }

/* POLICY BAR */
.policy-bar { background: var(--bg-white); padding: 20px 0; border-bottom: 1px solid var(--border); }
.policy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.policy-item { display: flex; align-items: center; gap: 15px; }
.policy-icon { font-size: 30px; }
.policy-text strong { display: block; font-size: 15px; color: var(--text-primary); }
.policy-text span { font-size: 13px; color: var(--text-muted); }

/* SECTIONS */
.section { padding: 40px 0; }
.section-sm { padding: 25px 0; }
.section-header { margin-bottom: 25px; display: flex; justify-content: space-between; align-items: flex-end; }
.section-title { font-size: 26px; font-weight: 800; color: var(--primary-dark); }
.section-title span { color: var(--accent); }
.section-subtitle { font-size: 14px; color: var(--text-secondary); }

/* CATEGORY CARDS */
.category-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; }
.category-card { background: var(--bg-white); border: 2px solid var(--border); border-radius: var(--radius-md); padding: 18px; text-align: center; cursor: pointer; transition: var(--transition); }
.category-card:hover, .category-card.active { border-color: var(--primary); background: var(--primary-bg); transform: translateY(-3px); }
.cat-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.cat-name { font-weight: 700; font-size: 15px; }
.cat-count { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* FILTER TABS */
.filter-tabs { display: flex; gap: 10px; margin-bottom: 25px; flex-wrap: wrap; }
.filter-tab { padding: 8px 22px; border: 2px solid var(--border); background: white; border-radius: 20px; font-weight: 700; font-size: 13px; cursor: pointer; transition: var(--transition); }
.filter-tab:hover, .filter-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

/* PRODUCT GRID & CARD */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.product-card { background: var(--bg-white); border-radius: var(--radius-md); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow-sm); position: relative; display: flex; flex-direction: column; transition: var(--transition); }
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.product-img-wrap { width: 100%; height: 200px; position: relative; background: #f5f5f5; overflow: hidden; }
.product-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.product-card:hover .product-img-wrap img { transform: scale(1.05); }
.product-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 5px; }
.badge { padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 800; color: white; text-transform: uppercase; }
.badge-hot { background: var(--primary); }
.badge-new { background: #2E7D32; }
.badge-sale { background: var(--accent); }
.product-body { padding: 15px; display: flex; flex-direction: column; flex: 1; }
.product-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; line-height: 1.4; height: 42px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-rating { color: #FFB300; font-size: 12px; margin-bottom: 10px; }
.product-price-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; margin-bottom: 12px; }
.price-current { font-size: 18px; font-weight: 800; color: var(--primary); }
.price-old { font-size: 13px; color: var(--text-muted); text-decoration: line-through; }
.product-btn { width: 100%; background: var(--accent-bg); border: 1px dashed var(--accent); color: var(--accent); padding: 10px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 5px; }
.product-btn:hover { background: var(--accent); color: white; border-style: solid; }

/* TOASTS */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: white; border-left: 5px solid #4CAF50; padding: 15px 20px; border-radius: 4px; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 12px; font-weight: 600; min-width: 300px; animation: slideInRight 0.3s ease; }
.toast.error { border-left-color: var(--primary); }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* FLOATING CART */
.floating-cart { position: fixed; bottom: 30px; right: 30px; z-index: 999; transform: scale(0); transition: var(--transition); }
.floating-cart.visible { transform: scale(1); }
.floating-cart-btn { background: var(--primary); color: white; width: 60px; height: 60px; border-radius: 50%; border: none; box-shadow: var(--shadow-md); font-size: 24px; cursor: pointer; position: relative; }
.floating-cart-count { position: absolute; top: -5px; right: -5px; background: var(--accent); color: white; font-size: 11px; font-weight: 800; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid white; }

/* FOOTER */
.footer { background: #212121; color: #e0e0e0; padding: 40px 0 20px; margin-top: 5px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; margin-bottom: 30px; }
.footer h3 { color: white; margin-bottom: 15px; font-size: 18px; }
.footer-bottom { border-top: 1px solid #333; padding-top: 20px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* AUTHENTICATION & DROPDOWN */
.user-menu-trigger { display: flex; align-items: center; gap: 8px; position: relative; }
.user-dropdown { position: absolute; top: 100%; right: 0; background: white; border: 1px solid var(--border); box-shadow: var(--shadow-md); border-radius: 8px; width: 260px; display: none; padding: 15px; z-index: 150; }
.user-dropdown.open { display: block; }
.user-dropdown-header { display: flex; gap: 10px; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 10px; }
.ud-avatar { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; }
.ud-name { font-weight: 700; font-size: 14px; }
.ud-email { font-size: 12px; color: var(--text-muted); }
.ud-links a { display: block; padding: 8px 0; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.ud-links a:hover { color: var(--primary); }
.ud-logout { width: 100%; background: #f5f5f5; border: none; padding: 8px; margin-top: 10px; border-radius: 4px; font-weight: 700; color: var(--primary); cursor: pointer; }

/* SHOPPING CART PAGE */
.cart-wrap { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; margin-top: 20px; }
.cart-main, .cart-sidebar { background: white; padding: 25px; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.cart-item { display: flex; align-items: center; gap: 15px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.cart-item img { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; }
.cart-item-details { flex: 1; }
.cart-item-title { font-weight: 700; font-size: 15px; }
.cart-qty-ctrl { display: flex; align-items: center; gap: 5px; margin-top: 5px; }
.cart-qty-ctrl input { width: 45px; text-align: center; padding: 4px; border: 1px solid var(--border); }
.cart-qty-btn { background: #f5f5f5; border: 1px solid var(--border); width: 24px; height: 24px; cursor: pointer; font-weight: bold;}
.cart-remove-btn { color: var(--primary); font-size: 12px; cursor: pointer; margin-top: 5px; border:none; background:none; text-align: left;}
.summary-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 14px; }
.summary-total { font-size: 18px; font-weight: 800; color: var(--primary); border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }

/* ANIMATION */
.fade-in { animation: fadeIn 0.4s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.back-to-top { position: fixed; bottom: 100px; right: 35px; background: rgba(0,0,0,0.5); color: white; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; cursor: pointer; display: none; z-index: 99; }
.back-to-top.visible { display: block; }
/* ============================================
   AUTHENTICATION PAGES (LOGIN / SIGNUP)
   ============================================ */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-main);
  background-image: linear-gradient(rgba(255, 253, 231, 0.9), rgba(255, 253, 231, 0.9)), url('https://images.unsplash.com/photo-1548550023-2bdb3c5beed7?w=1600&q=80');
  background-size: cover;
  background-position: center;
}

.auth-box {
  background: white;
  padding: 40px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 450px;
  text-align: center;
  border-top: 5px solid var(--primary);
}

.auth-box h2 {
  color: var(--primary-dark);
  margin-bottom: 5px;
  font-size: 28px;
  font-weight: 800;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 25px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-input {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: var(--transition);
  background: #fafafa;
}

.auth-input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.auth-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 15px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 10px;
}

.auth-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.auth-links {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-links a {
  color: var(--accent);
  font-weight: 800;
}

.auth-links a:hover {
  text-decoration: underline;
}