/* ========================================================
   DICHVU5S.SHOP - THEME TRẮNG & XANH NGỌC (EMERALD & WHITE)
   Phong cách hiện đại, tinh gọn, siêu tốc độ cho cPanel
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Fira+Code:wght@400;500;600&display=swap');

:root {
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-dark: #047857;
  --primary-light: #ecfdf5;
  --primary-border: #a7f3d0;
  --primary-glow: rgba(16, 185, 129, 0.25);

  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-color-hover: #cbd5e1;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --info: #3b82f6;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-emerald: 0 10px 25px -5px rgba(16, 185, 129, 0.3);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button, input, select, textarea {
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ================= HEADER ================= */
.header-top {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-emerald);
}

.logo-title span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-item {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-item:hover, .nav-item.active {
  color: var(--primary);
}

.nav-admin-badge {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.wallet-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wallet-badge:hover {
  background: #d1fae5;
  box-shadow: var(--shadow-sm);
}

.wallet-balance {
  font-weight: 800;
  color: var(--primary-dark);
  font-size: 0.95rem;
}

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-emerald);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

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

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

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

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

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

/* ================= PHẦN TỐI BÔI ĐEN (HIGHLIGHT TEXT) ================= */
.admin-highlight-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.15);
}

.highlight-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.highlight-tag {
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
}

/* ================= MARQUEE ANNOUNCEMENT ================= */
.announcement-bar {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.announcement-icon {
  color: var(--primary);
  display: flex;
  align-items: center;
  font-weight: bold;
}

.announcement-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================= HERO SECTION ================= */
.hero-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 60%, #f0fdf4 100%);
  border: 1.5px solid var(--primary-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.hero-title span {
  color: var(--primary);
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 650px;
  margin-bottom: 1.5rem;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

.stat-item h4 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.stat-item p {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

/* ================= SEARCH & CATEGORIES ================= */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.85rem 1.25rem 0.85rem 3rem;
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.category-tabs {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.cat-tab {
  padding: 0.6rem 1.2rem;
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cat-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.cat-tab.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--shadow-emerald);
}

/* ================= PRODUCT CARDS ================= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.product-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-xl);
}

.product-thumb {
  position: relative;
  width: 100%;
  height: 180px;
  background: #f1f5f9;
  overflow: hidden;
}

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

.product-card:hover .product-thumb img {
  transform: scale(1.05);
}

.product-badge {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 6px;
  color: #fff;
  letter-spacing: 0.02em;
}

.badge-hot { background: #ef4444; }
.badge-sale { background: #f59e0b; }
.badge-new { background: #10b981; }
.badge-vip { background: #8b5cf6; }

.stock-tag {
  position: absolute;
  bottom: 0.85rem;
  right: 0.85rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.stock-tag.in-stock {
  background: rgba(16, 185, 129, 0.9);
  color: #ffffff;
}

.stock-tag.out-stock {
  background: rgba(239, 68, 68, 0.9);
  color: #ffffff;
}

.product-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-cat {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.product-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8rem;
}

.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-top: auto;
  margin-bottom: 1rem;
}

.current-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.original-price {
  font-size: 0.85rem;
  color: var(--text-light);
  text-decoration: line-through;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

/* ================= MODALS ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 550px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  animation: modalIn 0.25s ease forwards;
}

.modal-box.modal-lg {
  max-width: 800px;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ================= PROFILE MODAL STYLES ================= */
.profile-tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  padding: 0 1.5rem;
  background: #f8fafc;
  overflow-x: auto;
}

.profile-tab-btn {
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  margin-bottom: -2px;
}

.profile-tab-btn:hover {
  color: var(--primary);
}

.profile-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.profile-tab-section {
  display: none;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.profile-info-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.profile-info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.profile-info-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

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

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

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea.form-control {
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Account delivery box */
.delivery-box {
  background: #f8fafc;
  border: 1.5px dashed var(--primary);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1rem 0;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 250px;
  overflow-y: auto;
}

/* ================= TOAST NOTIFICATION ================= */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #ffffff;
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  min-width: 280px;
  animation: slideIn 0.3s ease;
}

.toast.error {
  border-left-color: var(--danger);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ================= FOOTER ================= */
.footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.footer-col p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ================= MOBILE BOTTOM NAVIGATION (APP STYLE) ================= */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  z-index: 999;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
  padding: 0 0.5rem;
}

.mob-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  flex: 1;
  padding: 0.4rem 0;
  transition: color 0.2s ease;
}

.mob-nav-item.active, .mob-nav-item:hover {
  color: var(--primary);
}

.mob-nav-icon {
  font-size: 1.25rem;
  line-height: 1;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  body {
    padding-bottom: 74px; /* Tránh bị che bởi thanh điều hướng đáy */
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .nav-links {
    display: none; /* Ẩn menu ngang trên mobile, chuyển sang thanh đáy */
  }

  .header-inner {
    height: 60px;
    padding: 0;
  }

  .logo-brand {
    font-size: 1.15rem;
  }

  .logo-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .wallet-badge {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
  }

  .hero-card {
    padding: 1.5rem 1.25rem;
    border-radius: var(--radius-lg);
  }

  .hero-title {
    font-size: 1.45rem;
  }

  .hero-desc {
    font-size: 0.9rem;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    text-align: center;
    padding-top: 1rem;
  }

  .stat-item h4 {
    font-size: 1.1rem;
  }

  .stat-item p {
    font-size: 0.65rem;
  }

  /* Lưới sản phẩm 2 cột cực đẹp chuẩn mobile */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .product-thumb {
    height: 120px;
  }

  .product-body {
    padding: 0.75rem;
  }

  .product-title {
    font-size: 0.82rem;
    height: 2.3rem;
    margin-bottom: 0.4rem;
  }

  .current-price {
    font-size: 1rem;
  }

  .original-price {
    font-size: 0.75rem;
  }

  .product-actions {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .admin-highlight-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    flex-direction: row;
    overflow-x: auto;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    border-right: none;
  }

  .admin-nav-item {
    white-space: nowrap;
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
  }

  .admin-content {
    padding: 1rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
