/* =====================================================
   CLIENT STOREFRONT — Modern E-commerce Theme
   Font: Inter (Google Fonts)
   Primary: #6366f1 | Gradient: indigo→violet
   ===================================================== */

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

:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --accent: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  --bg-main: #ffffff;
  --bg-muted: #f8fafc;
  --bg-dark: #0f172a;

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-white: #f8fafc;

  --border: #e2e8f0;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 4px rgba(0,0,0,.07);
  --shadow-md: 0 4px 20px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.14);

  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);

  --header-height: 68px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  background: var(--bg-main);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

/* ======================== HEADER ======================== */
.header {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,0,0,.06);
  transition: var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--header-height);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Logo --- */
.header-logo { flex-shrink: 0; }
.header-logo img {
  height: 42px;
  width: auto;
  object-fit: contain;
  transition: var(--transition);
  display: block;
}
.header-logo img:hover { opacity: .85; transform: scale(1.03); }

/* --- Search bar --- */
.header-search {
  flex: 1;
  min-width: 0;
  max-width: 560px;
}
.search-form {
  display: flex;
  align-items: center;
  background: var(--bg-muted);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0 6px 0 14px;
  transition: var(--transition);
  height: 42px;
}
.search-form:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.search-icon {
  color: var(--text-muted);
  font-size: 14px;
  margin-right: 10px;
  flex-shrink: 0;
}
.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  outline: none;
  min-width: 0;
}
.search-input::placeholder { color: var(--text-muted); }
.search-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  height: 32px;
  display: flex;
  align-items: center;
}
.search-btn:hover { opacity: .9; }

/* --- Actions area (right side) --- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Nav icon links (Trang chủ, Sản phẩm) */
.nav-link-icon {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.nav-link-icon:hover { color: var(--primary); background: rgba(99,102,241,.07); }
.nav-link-icon i { font-size: 14px; }
.nav-chevron { font-size: 10px !important; color: var(--text-muted); }

/* Nav dropdown (Sản phẩm) */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: 8px 0;
  display: none;
  z-index: 99;
}
.nav-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 0;
  width: 100%;
  height: 15px;
  background: transparent;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu ul {
  list-style: none;
  padding: 0; margin: 0;
}
.nav-dropdown-menu ul li a {
  display: block;
  padding: 9px 18px;
  font-size: 13.5px;
  color: var(--text-secondary);
  transition: var(--transition);
}
.nav-dropdown-menu ul li a:hover {
  background: rgba(99,102,241,.07);
  color: var(--primary);
}
.nav-dropdown-menu ul li ul {
  position: absolute;
  left: 100%;
  top: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: 8px 0;
  display: none;
}
.nav-dropdown-menu ul li:hover > ul { display: block; }

/* Cart */
.nav-cart {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  position: relative;
  transition: var(--transition);
  white-space: nowrap;
  background: rgba(99,102,241,.06);
  border: 1.5px solid rgba(99,102,241,.15);
}
.nav-cart:hover {
  background: rgba(99,102,241,.12);
  color: var(--primary);
  border-color: rgba(99,102,241,.3);
}
.nav-cart i { font-size: 15px; }
.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(135deg, var(--danger), #f97316);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(239,68,68,.4);
  border: 2px solid #fff;
}

/* Divider */
.nav-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  margin: 0 6px;
  flex-shrink: 0;
}

/* Login / Register buttons */
.btn-nav-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  border: 1.5px solid rgba(99,102,241,.3);
  background: rgba(99,102,241,.06);
  transition: var(--transition);
  white-space: nowrap;
}
.btn-nav-login:hover {
  background: rgba(99,102,241,.12);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-nav-register {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: 1.5px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(99,102,241,.3);
}
.btn-nav-register:hover {
  opacity: .9;
  box-shadow: 0 4px 16px rgba(99,102,241,.45);
  transform: translateY(-1px);
  color: #fff;
}

/* User Dropdown */
.user-dropdown { position: relative; }

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 24px;
  border: 1.5px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.user-avatar-btn:hover {
  border-color: rgba(99,102,241,.4);
  box-shadow: 0 2px 12px rgba(99,102,241,.15);
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.user-avatar-circle.lg {
  width: 44px;
  height: 44px;
  font-size: 18px;
}

.user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* User dropdown panel */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.13);
  min-width: 230px;
  padding: 8px;
  display: none;
  z-index: 99;
  animation: fadeInDown .2s ease;
}
.user-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 0;
  width: 100%;
  height: 15px;
  background: transparent;
}
.user-dropdown:hover .user-dropdown-menu { display: block; }

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.user-info-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 14px;
}
.user-display-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.user-display-email {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.user-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: pointer;
}
.user-menu-item:hover {
  background: rgba(99,102,241,.07);
  color: var(--primary);
}
.user-menu-item i { width: 16px; text-align: center; font-size: 14px; }

.user-menu-item.logout { color: var(--danger); }
.user-menu-item.logout:hover { background: rgba(239,68,68,.07); color: var(--danger); }


/* ======================== FOOTER ======================== */
.footer {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  color: var(--text-white);
  padding: 40px 0 20px;
  margin-top: auto;
}

.footer p {
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  margin: 0;
}

/* ======================== SECTION TITLES ======================== */
.box-head {
  margin-bottom: 28px;
  text-align: center;
  position: relative;
}

.box-head .inner-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: capitalize;
  display: inline-block;
  position: relative;
}

.box-head .inner-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  margin: 8px auto 0;
}

/* ======================== PRODUCT CARDS ======================== */
.product-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 100%;
  background: #fff;
  transition: var(--transition);
  position: relative;
}

.product-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99,102,241,.25);
}

.product-item .inner-image {
  width: 100%;
  aspect-ratio: 4/3;
  position: relative;
  overflow: hidden;
  background: var(--bg-muted);
}

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

.product-item:hover .inner-image img { transform: scale(1.06); }

.product-item .inner-featured {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  letter-spacing: .5px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.product-item .inner-content {
  padding: 16px;
}

.product-item .inner-content .inner-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-item .inner-content .inner-price-new {
  font-size: 17px;
  font-weight: 700;
  color: var(--success);
}

.product-item .inner-content .inner-price-old {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 6px;
}

.product-item .inner-content .inner-discount {
  display: inline-block;
  background: linear-gradient(135deg, var(--danger), #f97316);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  margin-top: 6px;
}

.product-item .inner-content .btn-cart {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 9px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}
.product-item .inner-content .btn-cart:hover {
  opacity: .9;
  box-shadow: 0 4px 16px rgba(99,102,241,.35);
}

/* ======================== SUB MENU ======================== */
.sub-menu { position: relative; z-index: 999; }

.sub-menu ul {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  list-style: none;
  padding: 8px 0; margin: 0;
  background: #fff;
  min-width: 200px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: none;
}

.sub-menu ul li a {
  display: block;
  padding: 9px 16px;
  font-size: 13.5px;
  color: var(--text-secondary);
  transition: var(--transition);
}
.sub-menu ul li a:hover {
  background: rgba(99,102,241,.07);
  color: var(--primary);
}

.sub-menu:hover > ul { display: block; }
.sub-menu ul li { position: relative; }
.sub-menu ul li ul { right: 100%; top: 0; left: auto; }
.sub-menu ul li:hover > ul { display: block; }

/* ======================== PRODUCT DETAIL ======================== */
.product-detail .inner-thumb img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.product-detail .inner-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 14px;
  line-height: 1.3;
}

.product-detail .inner-price-new {
  color: var(--success);
  font-weight: 700;
  font-size: 26px;
  margin-bottom: 8px;
}
.product-detail .inner-price-old {
  color: var(--text-muted);
  font-size: 18px;
  text-decoration: line-through;
  margin-bottom: 8px;
}
.product-detail .inner-percent span {
  background: linear-gradient(135deg, var(--danger), #f97316);
  color: #fff;
  font-weight: 700;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
}
.product-detail .inner-stock span {
  background: rgba(16,185,129,.12);
  color: var(--success);
  border: 1px solid rgba(16,185,129,.3);
  font-weight: 600;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
}

/* ======================== AUTH / FORMS ======================== */
.form-auth-wrapper {
  min-height: 80vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #f8fafc 0%, #ede9fe 100%);
  padding: 40px 0;
}

.form-auth-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.form-auth-card h1 {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.form-auth-card .auth-links {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.form-auth-card .auth-links a {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  transition: var(--transition);
}
.form-auth-card .auth-links a:hover { color: var(--primary-dark); text-decoration: underline; }

.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  background: #fff;
  transition: var(--transition);
  outline: none;
  display: block;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  display: inline-block;
}
.btn-primary:hover {
  opacity: .92;
  box-shadow: 0 4px 18px rgba(99,102,241,.38);
  transform: translateY(-1px);
}
.btn-block { width: 100%; text-align: center; display: block; }

/* ======================== CART ======================== */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.cart-table th {
  background: var(--bg-muted);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .4px;
}
.cart-table img {
  border-radius: var(--radius-sm);
  object-fit: cover;
}

/* ======================== CHAT UI ======================== */
.chat {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.chat .inner-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat .inner-head .inner-avatar {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 14px;
  flex-shrink: 0;
}
.chat .inner-head .inner-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.chat .inner-body {
  padding: 16px;
  height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fafbfc;
}

.chat .inner-body .inner-content {
  background: #f1f5f9;
  max-width: 260px;
  padding: 8px 14px;
  border-radius: 0 14px 14px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-primary);
  word-break: break-word;
}

.chat .inner-outgoing .inner-content {
  margin-left: auto;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 14px 0 14px 14px;
}

.chat .inner-body .inner-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.chat .inner-foot {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  background: #fff;
}
.chat .inner-form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat .inner-form input {
  flex: 1;
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 0 14px;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: var(--transition);
  color: var(--text-primary);
}
.chat .inner-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.chat .inner-form button {
  height: 38px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}
.chat .inner-form button:hover { opacity: .9; }

.chat .inner-preview-images .label-container { display: none; }
.chat .inner-preview-images .input-container { display: none; }
.chat .inner-preview-images .image-preview { height: auto; padding: 0; border-radius: 0; }
.chat .inner-preview-images .image-preview-item { width: 90px; background-size: contain; }

.chat .inner-body .inner-images img {
  width: 80px; height: 80px;
  object-fit: contain;
  background: #efefef;
  padding: 8px;
  margin: 0 4px 4px 0;
  border-radius: var(--radius-sm);
}
.chat .inner-body .inner-outgoing .inner-images { margin-left: auto; text-align: right; }
.chat .inner-body .inner-outgoing .inner-images img { margin: 0 0 4px 4px; }

/* ======================== TYPING DOTS ======================== */
.box-typing { position: relative; }
.box-typing .inner-dots {
  position: relative; height: 22px; width: 54px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f1f5f9; border-radius: 45px; margin-top: 4px;
}
.box-typing .inner-dots span {
  animation: blink 1.5s infinite;
  height: 6px; width: 6px;
  background: var(--text-muted);
  border-radius: 50%; display: inline-block; margin: 0 3px;
}
.box-typing .inner-dots span:nth-child(2) { animation-delay: .2s; }
.box-typing .inner-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink {
  0%   { opacity: .15; }
  20%  { opacity: 1; }
  100% { opacity: .15; }
}

/* ======================== TOOLTIP ======================== */
.tooltip { visibility: hidden; }
.tooltip.shown { visibility: visible; opacity: 1; }

/* ======================== ALERTS ======================== */
[show-alert] {
  position: fixed; top: 80px; right: 16px;
  min-width: 280px; max-width: 380px;
  padding: 14px 18px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500; z-index: 9999;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight .35s cubic-bezier(0.4,0,0.2,1);
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

[show-alert].alert-hidden {
  animation: slideOutRight .4s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

[show-alert] [close-alert] {
  background: rgba(0,0,0,.1);
  width: 22px; height: 22px;
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; cursor: pointer; flex-shrink: 0;
  transition: var(--transition);
}
[show-alert] [close-alert]:hover { background: rgba(0,0,0,.2); }

/* ======================== BOX USER / ROOM ======================== */
.box-user, .box-room {
  display: flex;
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  background: #fff;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.box-user:hover, .box-room:hover {
  border-color: rgba(99,102,241,.3);
  box-shadow: var(--shadow-md);
}

.box-user .inner-avatar, .box-room .inner-avatar {
  width: 56px; height: 56px;
  border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  margin-right: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #fff;
}
.box-user .inner-avatar img,
.box-room .inner-avatar img { width: 100%; height: 100%; object-fit: cover; }

.box-user .inner-info, .box-room .inner-info { flex: 1; }
.box-user .inner-info .inner-name,
.box-room .inner-info .inner-name {
  font-size: 16px; font-weight: 700;
  color: var(--text-primary); margin-bottom: 2px;
}

.box-user [btn-cancel-friend]  { display: none; }
.box-user.add [btn-add-friend] { display: none; }
.box-user.add [btn-cancel-friend] { display: inline-block; }
.box-user [btn-deleted-friend] { display: none; }
.box-user.refuse [btn-accept-friend] { display: none; }
.box-user.refuse [btn-refuse-friend] { display: none; }
.box-user.refuse [btn-deleted-friend] { display: inline-block; }
.box-user [btn-accepted-friend] { display: none; }
.box-user.accepted [btn-accept-friend] { display: none; }
.box-user.accepted [btn-refuse-friend] { display: none; }
.box-user.accepted [btn-accepted-friend] { display: inline-block; }

.box-user .inner-status {
  font-size: 12px; color: var(--success);
  font-weight: 500; opacity: 0; transition: var(--transition);
}
.box-user .inner-status[status="online"] { opacity: 1; }

/* ======================== HEADER LOGO IMPROVED ======================== */
.header .inner-logo img {
  max-height: 44px;
  width: auto;
  object-fit: contain;
  transition: var(--transition);
}
.header .inner-logo img:hover { opacity: .85; transform: scale(1.03); }

/* ======================== HERO SECTION ======================== */
.hero-section {
  position: relative;
  overflow: hidden;
  min-height: 480px;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 55%, #2d1b69 100%);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 50%, rgba(99,102,241,.25) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(139,92,246,.15) 0%, transparent 50%);
  pointer-events: none;
}

.hero-section .container { position: relative; z-index: 1; padding: 60px 15px; }

.hero-content {
  display: flex;
  align-items: center;
  gap: 40px;
}

.hero-text { flex: 1; min-width: 0; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99,102,241,.2);
  border: 1px solid rgba(99,102,241,.4);
  color: #a5b4fc;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
  letter-spacing: .3px;
}

.hero-title {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.hero-highlight {
  background: linear-gradient(135deg, #818cf8, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  color: #94a3b8;
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 440px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  padding: 13px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 24px rgba(99,102,241,.45);
  transition: var(--transition);
  text-decoration: none;
}
.hero-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(99,102,241,.6);
  color: #fff;
}

.hero-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 20px;
  border-radius: 12px;
  border: 1.5px solid rgba(255,255,255,.15);
  transition: var(--transition);
  text-decoration: none;
}
.hero-btn-secondary:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.hero-image {
  flex: 0 0 480px;
  max-width: 480px;
}
.hero-image img {
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}

@media (max-width: 991px) {
  .hero-content { flex-direction: column; text-align: center; }
  .hero-image { flex: none; max-width: 100%; }
  .hero-desc { margin: 0 auto 28px; }
  .hero-actions { justify-content: center; }
  .hero-badge { margin: 0 auto 18px; }
}

/* ======================== FEATURES STRIP ======================== */
.features-strip {
  background: #fff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 22px 0;
}

.features-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 180px;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(99,102,241,.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.feature-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.feature-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

@media (max-width: 768px) {
  .features-grid { justify-content: center; }
  .feature-item { min-width: 140px; }
}

/* ======================== PROMO BANNER ======================== */
.promo-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
  padding: 56px 0;
  margin: 24px 0;
}

.promo-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.promo-text { flex: 1; }

.promo-tag {
  font-size: 14px;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 10px;
}

.promo-text h2 {
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 12px;
  line-height: 1.25;
}
.promo-text h2 span {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.promo-desc {
  color: #94a3b8;
  font-size: 15px;
  line-height: 1.65;
  max-width: 460px;
  margin-bottom: 24px;
}

.promo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #fff;
  padding: 12px 26px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(251,191,36,.35);
  transition: var(--transition);
  text-decoration: none;
}
.promo-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(251,191,36,.5);
  color: #fff;
}

.promo-visual {
  font-size: 100px;
  color: rgba(255,255,255,.08);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .promo-inner { flex-direction: column; text-align: center; }
  .promo-visual { display: none; }
  .promo-desc { margin: 0 auto 24px; }
}

/* ======================== PRODUCT CARD IMPROVED ======================== */
.product-item a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.inner-badge-discount {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: linear-gradient(135deg, var(--danger), #f97316);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .3px;
}

.inner-pricing {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.view-detail-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 9px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  opacity: 0;
  transform: translateY(4px);
}

.view-detail-btn-wrapper {
  display: block;
  width: 100%;
  text-decoration: none !important;
  color: #fff !important;
}

.product-item:hover .view-detail-btn {
  opacity: 1;
  transform: translateY(0);
}

/* ======================== PROFILE CARD ======================== */
.profile-card {
  background: #fff;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: var(--transition);
}
.profile-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.12);
}

.profile-cover {
  height: 140px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  position: relative;
}

.profile-header {
  text-align: center;
  padding: 0 24px 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.profile-avatar-wrapper {
  width: 100px;
  height: 100px;
  margin: -50px auto 14px;
  position: relative;
  z-index: 2;
}

.profile-avatar-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 40px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.profile-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.profile-status {
  background: rgba(16, 185, 129, 0.1) !important;
  color: #10b981 !important;
  border: 1.5px solid rgba(16, 185, 129, 0.2);
  border-radius: 20px;
  padding: 5px 14px !important;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}

.profile-body {
  padding: 28px 32px;
}

.profile-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-section-title i {
  color: var(--primary);
  font-size: 18px;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.profile-info-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-muted);
  border-radius: 16px;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.profile-info-item:hover {
  background: #fff;
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.05);
}

.profile-info-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.profile-info-content {
  flex: 1;
  min-width: 0;
}

.profile-info-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.profile-info-value {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-footer {
  padding: 0 32px 32px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-profile-edit {
  flex: 1;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
  transition: var(--transition);
}
.btn-profile-edit:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
  color: #fff;
}

.btn-profile-password {
  flex: 1;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  background: #fff;
  transition: var(--transition);
}
.btn-profile-password:hover {
  background: var(--bg-muted);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* ======================== ROOMS CHAT ======================== */
.page-title-custom {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.btn-create-room {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff !important;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
  transition: var(--transition);
  border: none;
  text-decoration: none;
  cursor: pointer;
}
.btn-create-room:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  opacity: 0.95;
}

.room-card {
  background: #fff;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: var(--transition);
}
.room-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
}

.room-card-body {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.room-avatar-wrapper {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.room-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  background: var(--bg-muted);
}

.room-status-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #fff;
}

.room-info {
  flex: 1;
  min-width: 0;
}

.room-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.room-card-footer {
  padding: 0 24px 24px;
}

.btn-enter-room {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: rgba(99, 102, 241, 0.06);
  border: 1.5px solid rgba(99, 102, 241, 0.15);
  color: var(--primary);
  padding: 10px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  transition: var(--transition);
  text-decoration: none !important;
}
.room-card:hover .btn-enter-room {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

.empty-rooms-state {
  background: #fff;
  border-radius: 24px;
  border: 1px dashed var(--border);
  padding: 60px 40px;
}
.empty-icon {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 20px;
  opacity: 0.6;
}

/* ======================== ROOM CHAT FORM ======================== */
.room-form-card {
  background: #fff;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 36px 32px;
}

.room-form-header {
  text-align: center;
  margin-bottom: 28px;
}
.form-header-icon {
  font-size: 40px;
  color: var(--primary);
  margin-bottom: 12px;
}
.room-form-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.form-label-custom {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.form-input-custom {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  height: auto;
  font-size: 14.5px;
  background: var(--bg-muted);
  transition: var(--transition);
}
.form-input-custom:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Custom list chọn bạn bè */
.friends-selection-list {
  border: 1.5px solid var(--border);
  border-radius: 16px;
  max-height: 250px;
  overflow-y: auto;
  padding: 8px;
  background: var(--bg-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Scrollbar */
.friends-selection-list::-webkit-scrollbar {
  width: 6px;
}
.friends-selection-list::-webkit-scrollbar-thumb {
  background-color: rgba(99, 102, 241, 0.2);
  border-radius: 4px;
}

.friend-checkbox-item {
  margin: 0;
  cursor: pointer;
  width: 100%;
}

.friend-checkbox-input {
  display: none;
}

.friend-checkbox-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  transition: var(--transition);
}

.friend-checkbox-input:checked + .friend-checkbox-tile {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.04);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

.friend-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.friend-info {
  flex: 1;
  min-width: 0;
}

.friend-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-status {
  font-size: 11px;
  color: var(--text-muted);
}

.friend-check-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: transparent;
  transition: var(--transition);
}
.friend-checkbox-input:checked + .friend-checkbox-tile .friend-check-mark {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.empty-friends-list {
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  background: var(--bg-muted);
  color: var(--text-muted);
}
.empty-friends-list i {
  font-size: 28px;
  margin-bottom: 10px;
  opacity: 0.6;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.btn-room-cancel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  background: #fff;
  text-decoration: none !important;
  transition: var(--transition);
}
.btn-room-cancel:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.btn-room-submit {
  flex: 1.5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
  transition: var(--transition);
  border: none;
  cursor: pointer;
}
.btn-room-submit:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}

/* ======================== PRODUCT DETAIL ======================== */
.product-detail-wrapper {
  color: var(--text-primary);
}

.btn-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  transition: var(--transition);
  cursor: pointer;
  outline: none !important;
}
.btn-detail-back:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.detail-image-card {
  background: #fff;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 400px;
}

.detail-featured-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 10px rgba(251, 191, 36, 0.3);
}

.detail-main-img {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: 16px;
  transition: transform 0.4s ease;
}
.detail-image-card:hover .detail-main-img {
  transform: scale(1.03);
}

.detail-info-card {
  padding: 10px 0;
}

.detail-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
}
.detail-category a {
  color: inherit;
  text-decoration: none;
}

.detail-title {
  font-size: clamp(24px, 3.5vw, 34px);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 20px;
}

.detail-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  color: #fbbf24;
  font-size: 14px;
}
.detail-rating span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  margin-left: 5px;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
}
.badge-status.in-stock { color: #10b981; }
.badge-status.out-stock { color: var(--danger); }

.detail-pricing-box {
  background: var(--bg-muted);
  border-radius: 20px;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  border: 1px solid var(--border);
}

.detail-price-new {
  font-size: 32px;
  font-weight: 800;
  color: #10b981;
  letter-spacing: -0.5px;
}

.detail-price-old {
  font-size: 18px;
  text-decoration: line-through;
  color: var(--text-muted);
  font-weight: 500;
}

.detail-discount-tag {
  background: linear-gradient(135deg, var(--danger), #f97316);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

.detail-purchase-form {
  margin-bottom: 28px;
}

/* Bộ nhập số lượng mượt mà */
.input-quantity-wrapper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  height: 48px;
}

.btn-quantity-minus,
.btn-quantity-plus {
  background: none;
  border: none;
  width: 44px;
  height: 100%;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  outline: none !important;
}
.btn-quantity-minus:hover,
.btn-quantity-plus:hover {
  background: var(--bg-muted);
  color: var(--primary);
}

.input-quantity-value {
  width: 60px;
  height: 100%;
  border: none !important;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  background: none;
  padding: 0 !important;
  box-shadow: none !important;
}
/* Ẩn các nút điều khiển gốc của thẻ input number */
.input-quantity-value::-webkit-outer-spin-button,
.input-quantity-value::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.btn-detail-add-to-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 12px;
  height: 48px;
  width: 100%;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  transition: var(--transition);
  cursor: pointer;
  outline: none !important;
}
.btn-detail-add-to-cart:hover {
  opacity: 0.95;
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.5);
}

.detail-mini-features {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1.5px solid var(--border);
  padding-top: 24px;
  flex-wrap: wrap;
}

.mini-feat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}
.mini-feat-item i {
  color: var(--primary);
  font-size: 15px;
}

/* Khung mô tả sản phẩm */
.detail-desc-card {
  background: #fff;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  padding: 36px;
}

.desc-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.desc-title i {
  color: var(--primary);
  font-size: 20px;
}

.desc-content {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-secondary);
}
.desc-content p {
  margin-bottom: 12px;
}