/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700;800&display=swap");

:root {
  --primary: #f277bb;
  --primary-hover: #e062a4;
  --primary-light: #fef0f6;
  --secondary: #f472b6;
  --background: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --font: "Plus Jakarta Sans", "Inter", sans-serif;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode basic styling (optional class) */
body.dark {
  --background: #0f172a;
  --card-bg: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.6;
  transition: var(--transition);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

input,
textarea,
select,
button {
  font-family: inherit;
  font-size: 1rem;
  outline: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ==========================================================================
   LAYOUT CONTAINERS
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

header {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition);
}

body.dark header {
  background-color: rgba(15, 23, 42, 0.8);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.nav-links a:hover {
  color: var(--primary);
}

/* Cart Button in Header */
.cart-btn {
  position: relative;
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.cart-btn:hover {
  background-color: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cart-count {
  background-color: var(--danger);
  color: white;
  font-size: 0.75rem;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  padding: 0 4px;
}

/* ==========================================================================
   HERO & SECTION STYLE
   ========================================================================== */
.hero {
  padding: 4rem 0 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 50px;
  height: 4px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 2px;
}

/* ==========================================================================
   PRODUCT GRID & CARDS
   ========================================================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

@media (min-width: 992px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

.product-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.product-image-container {
  position: relative;
  padding-bottom: 85%;
  background-color: #f1f5f9;
  overflow: hidden;
}

.product-image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

.product-category {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

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

.product-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  line-height: 1.35;
  color: var(--text-main);
  height: 4.05em; /* Exactly 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.product-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}

.btn-add-cart {
  background-color: var(--primary);
  color: white;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.btn-add-cart:hover {
  background-color: var(--primary-hover);
  transform: scale(1.03);
}

.btn-buy-now {
  background-color: var(--primary);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}

.btn-buy-now:hover {
  background-color: var(--primary-hover);
  transform: scale(1.03);
}

.btn-shopee {
  background-color: #ee4d2d;
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-shopee:hover {
  background-color: #d73c1d;
  color: white;
  transform: scale(1.03);
}

.btn-outline-primary {
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  cursor: pointer;
}

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

/* ==========================================================================
   CART SLIDE OVERLAY (DRAWER)
   ========================================================================== */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: -450px;
  width: 100%;
  max-width: 450px;
  height: 100vh;
  background-color: var(--card-bg);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-overlay.active .cart-drawer {
  right: 0;
}

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

.cart-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.btn-close-cart {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.btn-close-cart:hover {
  background-color: var(--border);
  color: var(--text-main);
}

.cart-items-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 1rem;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-img {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background-color: #f1f5f9;
}

.cart-item-details {
  flex-grow: 1;
}

.cart-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: var(--text-main);
}

.cart-item-price {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background-color: var(--background);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  transition: var(--transition);
}

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

.cart-item-remove {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 500;
  margin-left: auto;
  transition: var(--transition);
}

.cart-item-remove:hover {
  text-decoration: underline;
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  background-color: var(--background);
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.btn-checkout {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  text-align: center;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  opacity: 0.95;
}

.cart-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
  margin: auto;
}

.cart-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--border);
}

/* ==========================================================================
   FORMS & CHECKOUT & PAYMENT PAGE
   ========================================================================== */
.checkout-wrapper {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2.5rem;
  margin: 3rem 0;
}

@media (max-width: 900px) {
  .checkout-wrapper {
    grid-template-columns: 1fr;
  }
}

.checkout-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.captcha-display {
  background-color: white;
  border: 1.5px solid var(--primary-light);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 2px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
}

.checkout-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--background);
  color: var(--text-main);
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  background-color: var(--card-bg);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.checkout-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.checkout-summary-item.total {
  border-bottom: none;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  padding-top: 1rem;
}

/* Payment (QR Code) Page styles */
.payment-container {
  max-width: 600px;
  margin: 4rem auto;
  text-align: center;
}

.qr-code-wrapper {
  background-color: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  display: inline-block;
  box-shadow: var(--shadow-lg);
  margin: 2rem 0;
  border: 1px solid var(--border);
}

.qr-code-wrapper img {
  max-width: 280px;
  margin: 0 auto;
}

.payment-details {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: left;
  margin-bottom: 2rem;
}

.payment-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.payment-row:last-child {
  border-bottom: none;
}

.payment-row .label {
  color: var(--text-muted);
  font-weight: 500;
}

.payment-row .val {
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-btn {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background-color: var(--primary-light);
}

.copy-btn:hover {
  background-color: var(--primary);
  color: white;
}

/* ==========================================================================
   ADMIN PANEL STYLING
   ========================================================================== */
.admin-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

@media (max-width: 768px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
}

.admin-sidebar {
  background-color: #0f172a;
  color: white;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.admin-logo {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 3rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-logo span {
  color: var(--secondary);
}

.admin-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-menu a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  color: #94a3b8;
  font-weight: 500;
}

.admin-menu a:hover,
.admin-menu li.active a {
  color: white;
  background-color: #1e293b;
}

.admin-main {
  background-color: #f1f5f9;
  padding: 2.5rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.admin-title {
  font-size: 1.75rem;
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background-color: white;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.stat-title {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Data Tables */
.table-card {
  background-color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 2rem;
}

.table-responsive {
  overflow-x: auto;
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table.admin-table th {
  background-color: #fafafa;
  color: var(--text-muted);
  font-weight: 700;
  padding: 1rem 1.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1.5px solid var(--border);
}

table.admin-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
  vertical-align: middle;
  color: var(--text-main);
}

table.admin-table tr {
  transition: background-color 0.15s ease;
}

table.admin-table tr:hover {
  background-color: #fff0f6; /* Soft brand pink hover */
}

table.admin-table tr:last-child td {
  border-bottom: none;
}

.badge {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50px;
  display: inline-block;
}

.badge.pending {
  background-color: #fef3c7;
  color: #d97706;
}

.badge.paid {
  background-color: #d1fae5;
  color: #059669;
}

.badge.delivered {
  background-color: #dbeafe;
  color: #2563eb;
}

.badge.cancelled {
  background-color: #fee2e2;
  color: #dc2626;
}

/* Admin forms and buttons */
.btn {
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

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

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

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

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

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

/* Login Page Admin */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1f5f9;
  padding: 1.5rem;
}

.login-card {
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 0.5rem;
}

/* ==========================================================================
   FOOTER STYLING
   ========================================================================== */
footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 4rem 0 2rem;
  margin-top: 5rem;
  border-top: 1px solid #1e293b;
}

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

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.footer-logo {
  color: white;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.footer-logo span {
  color: var(--secondary);
}

.footer-title {
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #1e293b;
  font-size: 0.9rem;
}

/* ==========================================================================
   SEO CONTENT BLOCKS (Lighthouse Booster)
   ========================================================================== */
.seo-section {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  margin: 4rem 0;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.seo-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

/* Product Detail Page Styles */
.product-detail-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 3rem;
  margin: 2.5rem 0;
  align-items: start;
}

@media (max-width: 768px) {
  .product-detail-wrapper {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin: 1rem 0;
  }
}

.product-detail-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

.product-detail-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background-color: #ffffff;
  max-width: 380px;
  height: 380px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.product-detail-img img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

.product-detail-thumbnails {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0;
  scrollbar-width: thin;
  justify-content: center;
}

.product-detail-thumbnails::-webkit-scrollbar {
  height: 4px;
}

.product-detail-thumbnails::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 4px;
}

.thumb-item {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  background-color: #ffffff;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
}

.thumb-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.2);
}

.thumb-item:hover {
  border-color: var(--primary-light);
}

.product-detail-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.product-detail-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  line-height: 1.25;
}

.product-detail-category {
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
}

.product-detail-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0.5rem 0 0.75rem 0;
}

.product-detail-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 1rem;
}

/* ==========================================================================
   RESPONSIVE UPGRADES (Mobile-First / Adaptability)
   ========================================================================== */

/* Tablet & Mobile (width < 992px) */
@media (max-width: 992px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    padding: 1.5rem;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e293b;
  }
  .admin-logo {
    margin-bottom: 0;
  }
  .admin-menu {
    flex-direction: row;
    gap: 0.5rem;
    margin-top: 0 !important;
  }
  .admin-menu a {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
  .admin-main {
    padding: 1.5rem;
  }
}

/* Mobile Screens (width < 768px) */
@media (max-width: 768px) {
  /* Main Layout container padding reduction */
  main.container {
    padding: 1rem 0.75rem !important;
  }

  /* Header & Navigation */
  .header-container {
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
  .logo {
    font-size: 1.3rem;
  }
  .header-search-container {
    order: 3;
    margin: 0.5rem 0 0 0 !important;
    max-width: 100% !important;
    width: 100%;
  }
  .desktop-nav {
    display: none !important; /* Hide desktop nav */
  }
  .mobile-actions {
    display: flex !important; /* Show mobile cart and hamburger */
  }

  /* Hero Banner */
  .hero {
    padding: 1.75rem 0 1rem;
  }
  .hero h1 {
    font-size: 1.6rem;
  }
  .hero p {
    font-size: 0.88rem;
    margin-bottom: 1rem;
  }

  /* Grids & Cards */
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
  }
  .product-card {
    border-radius: var(--radius-md);
  }
  .product-title {
    font-size: 1rem;
  }

  /* Product Details */
  .product-detail-wrapper {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin: 1rem 0;
  }
  .product-detail-gallery {
    max-width: 100%;
    gap: 0.5rem;
  }
  .product-detail-img {
    height: auto;
    max-height: 250px;
    max-width: 100%;
    width: auto;
    border: none;
    background-color: transparent;
    border-radius: 0;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .product-detail-img img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 250px;
    display: block;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
  }
  .product-detail-title {
    font-size: 1.25rem;
    line-height: 1.25;
    margin-bottom: 0.2rem;
  }
  .product-detail-price {
    font-size: 1.2rem;
    margin: 0.25rem 0 0.5rem 0;
  }
  .product-detail-desc {
    font-size: 0.85rem;
    line-height: 1.45;
    margin-bottom: 0.65rem;
  }
  .product-variants-section {
    margin: 0.65rem 0 !important;
    padding: 0.65rem 0 !important;
  }
  .product-gift-box {
    margin: 0.65rem 0 !important;
    padding: 0.65rem !important;
    gap: 0.5rem !important;
  }
  .product-gift-box img {
    width: 50px !important;
    height: 50px !important;
  }
  .product-detail-info button {
    padding: 0.65rem 1rem !important;
    font-size: 0.9rem !important;
  }
  .product-detail-actions {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background-color: var(--card-bg, #ffffff) !important;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.08) !important;
    padding: 0.75rem 1rem !important;
    margin: 0 !important;
    z-index: 999 !important;
    display: flex !important;
    gap: 0.5rem !important;
    flex-direction: column !important;
  }
  .product-detail-actions button,
  .product-detail-actions .btn-shopee {
    width: 100% !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem !important;
    margin: 0 !important;
  }
  main.container {
    padding-bottom: 190px !important;
  }

  /* Checkout & Payment */
  .checkout-wrapper {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
    display: grid !important;
  }
  .checkout-wrapper > .checkout-card:nth-child(1) {
    order: 2;
  }
  .checkout-wrapper > .checkout-card:nth-child(2) {
    order: 1;
  }
  .checkout-card {
    padding: 1.5rem;
  }
  .captcha-display {
    font-size: 0.95rem !important;
    padding: 0.5rem 0.65rem !important;
    letter-spacing: 1px !important;
  }
  .payment-container {
    margin: 2rem auto;
    padding: 0 1rem;
  }
  .qr-code-wrapper {
    padding: 1rem;
    width: 100%;
    max-width: 320px;
  }
  .qr-code-wrapper img {
    max-width: 100%;
  }

  /* Footer */
  footer {
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
  }
  .footer-grid {
    gap: 1.5rem;
  }

  /* Admin Panel Details */
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
  }
  .stats-grid {
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  .stat-card {
    padding: 1rem;
  }
  .stat-value {
    font-size: 1.6rem;
  }
  .admin-main > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* Responsive forms inside admin */
  .variant-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
  }
  .variant-row input[name="variant_sku[]"] {
    grid-column: span 2;
  }
  .variant-row button {
    grid-column: span 2;
    text-align: center;
    padding: 0.5rem;
    background-color: var(--border);
    border-radius: var(--radius-sm);
  }
}

/* Extra Small Screens (width < 480px) */
@media (max-width: 480px) {
  .logo {
    font-size: 1.15rem;
  }
  .hero h1 {
    font-size: 1.85rem;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .product-info {
    padding: 0.75rem 0.6rem;
  }
  .product-title {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }
  .product-desc {
    display: none;
  }
  .product-price {
    font-size: 0.95rem;
  }
  .product-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    margin-top: 0.5rem;
  }
  .product-footer .product-price {
    text-align: left;
  }
  .product-footer .btn-add-cart {
    width: 100%;
    justify-content: center;
    font-size: 0.72rem;
    padding: 0.45rem 0.6rem;
  }
}

/* ==========================================================================
   ORDER TRACKING PAGE STYLES (THEO DÕI ĐƠN HÀNG)
   ========================================================================== */
.track-card {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin-bottom: 2rem;
}
.track-search-card {
  max-width: 600px;
  margin: 4rem auto;
  text-align: center;
}
.track-search-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1rem;
}
.track-search-desc {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}
.track-search-form {
  display: flex;
  gap: 0.5rem;
}
.track-search-form input {
  flex-grow: 1;
  font-size: 1rem;
}
.track-search-form button {
  background-color: var(--primary);
  color: white;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  padding: 0 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.track-search-form button:hover {
  background-color: var(--primary-hover);
}
.track-header-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}
.track-title-info h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
}
.track-date-info {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.track-status-badge {
  padding: 0.5rem 1rem;
  font-weight: 700;
  border-radius: 50px;
  font-size: 0.85rem;
}
.track-status-badge.delivered {
  background-color: #dcfce7;
  color: #166534;
}
.track-status-badge.in_transit {
  background-color: #e0f2fe;
  color: #0369a1;
}
.track-status-badge.out_for_delivery {
  background-color: #fef9c3;
  color: #854d0e;
}
.track-status-badge.preparing {
  background-color: #f3e8ff;
  color: #6b21a8;
}

/* Horizontal Timeline Progress */
.track-progress-wrapper {
  position: relative;
  margin: 3rem 0;
  padding: 0;
}
.track-progress-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  width: 100%;
}
.track-progress-bar {
  position: absolute;
  top: 22px;
  left: 22px;
  right: 22px;
  height: 4px;
  z-index: 1;
}
.track-progress-line {
  width: 100%;
  height: 100%;
  background-color: #f1f5f9;
  border-radius: 2px;
}
.track-progress-line-active {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background-color: var(--primary);
  z-index: 2;
  transition: width 0.5s ease;
  border-radius: 2px;
}
.track-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 3;
  flex: 1;
}
.track-step-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: white;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.track-step.active .track-step-icon {
  border-color: var(--primary);
  color: var(--primary);
  background-color: #fff0f6;
}
.track-step.completed .track-step-icon {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}
.track-step-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}
.track-step.active .track-step-label,
.track-step.completed .track-step-label {
  color: var(--text-main);
  font-weight: 600;
}

/* Vertical History Timeline */
.track-timeline {
  position: relative;
  margin-top: 3rem;
  padding-left: 0;
  list-style: none;
}
.track-item {
  display: flex;
  margin-bottom: 2rem;
  position: relative;
}
.track-time-col {
  width: 100px;
  text-align: right;
  padding-right: 20px;
  flex-shrink: 0;
}
.track-time {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}
.track-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.track-indicator {
  width: 42px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  flex-shrink: 0;
}
.track-indicator::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background-color: #f1f5f9;
  z-index: 1;
  transform: translateX(-50%);
}
.track-item:first-child .track-indicator::after {
  top: 10px;
}
.track-item:last-child .track-indicator::after {
  bottom: auto;
  height: 10px;
}
.track-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #cbd5e1;
  border: 2px solid white;
  margin-top: 5px;
  box-shadow: 0 0 0 2px #cbd5e1;
  position: relative;
  z-index: 2;
}
.track-item.latest .track-dot {
  width: 18px;
  height: 18px;
  background-color: #22c55e;
  border: 2px solid white;
  box-shadow: 0 0 0 2px #bbf7d0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.track-item.latest .track-dot::after {
  content: "✓";
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
}
.track-info-col {
  padding-left: 10px;
  flex-grow: 1;
}
.track-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.track-item.latest .track-desc {
  color: var(--text-main);
  font-weight: 600;
}
.track-loc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .track-time-col {
    width: 75px;
    padding-right: 12px;
  }
  .track-indicator {
    width: 34px;
  }
  .track-progress-bar {
    top: 17px;
    left: 17px;
    right: 17px;
  }
  .track-step-icon {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
  }
  .track-step-label {
    font-size: 0.75rem;
  }
  .track-card {
    padding: 1.25rem;
  }
  .track-search-form {
    flex-direction: column;
    gap: 0.75rem;
  }
  .track-search-form button {
    padding: 0.75rem;
    width: 100%;
  }
}

/* Responsive Admin Table (Cards layout on Mobile) */
@media (max-width: 768px) {
  .table-responsive {
    overflow-x: visible; /* No need to scroll horizontally when stacked */
  }

  table.admin-table thead {
    display: none; /* Hide header columns */
  }

  table.admin-table tbody tr {
    display: block;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition:
      transform 0.2s,
      box-shadow 0.2s;
  }

  table.admin-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    background-color: #fff0f6 !important;
  }

  table.admin-table tbody td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.75rem 0;
    border-bottom: 1px dashed #f1f5f9;
    font-size: 0.9rem;
    width: 100% !important;
    box-sizing: border-box;
  }

  table.admin-table tbody td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  table.admin-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  /* Adjust specific layouts in card view */
  table.admin-table tbody td select {
    width: 100% !important;
  }

  table.admin-table tbody td form {
    width: 100%;
  }

  table.admin-table tbody td div {
    max-width: 100% !important;
  }
}

/* ==========================================================================
   PAGINATION STYLING
   ========================================================================== */
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  min-width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background-color: white;
  color: var(--text-main);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.page-link:hover {
  background-color: #fff0f6;
  border-color: var(--primary-light);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.page-link.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow:
    0 10px 15px -3px rgba(244, 63, 94, 0.3),
    0 4px 6px -2px rgba(244, 63, 94, 0.05);
}

/* ==========================================================================
   COMPACT MOBILE SCALE (site-wide)
   ========================================================================== */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  body {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .container,
  main.container {
    padding-left: 0.9rem !important;
    padding-right: 0.9rem !important;
  }

  main.container {
    padding-top: 1rem !important;
  }

  .header-container {
    padding: 0.65rem 0.9rem !important;
    gap: 0.45rem !important;
  }

  .logo {
    font-size: 1.15rem !important;
    gap: 0.35rem !important;
  }

  .cart-btn {
    padding: 0.45rem 0.7rem !important;
    font-size: 0.8rem !important;
    border-radius: 10px !important;
  }

  .cart-count {
    min-width: 17px !important;
    height: 17px !important;
    font-size: 0.68rem !important;
  }

  .menu-toggle {
    font-size: 1.35rem !important;
    padding: 0.1rem !important;
  }

  .header-search-container {
    margin-top: 0.45rem !important;
  }

  #header-search-input,
  .form-control,
  input,
  textarea,
  select {
    font-size: 0.88rem !important;
  }

  #header-search-input {
    padding: 0.5rem 2.2rem 0.5rem 0.8rem !important;
    border-radius: 11px !important;
  }

  .section-title {
    font-size: 1.35rem !important;
    margin-bottom: 1rem !important;
  }

  .section-title::after {
    width: 48px !important;
    height: 3px !important;
  }

  .hero {
    padding: 1.25rem 0 0.8rem !important;
  }

  .hero h1,
  main.container h1:not(.product-detail-title) {
    font-size: 1.35rem !important;
    line-height: 1.22 !important;
  }

  .hero p,
  main.container p {
    font-size: 0.86rem !important;
  }

  .filter-btn {
    padding: 0.35rem 0.72rem !important;
    font-size: 0.76rem !important;
    border-radius: 9px !important;
  }

  .product-grid {
    gap: 0.8rem !important;
    margin-bottom: 1.75rem !important;
  }

  .product-info {
    padding: 0.75rem !important;
  }

  .product-category {
    font-size: 0.68rem !important;
    padding: 0.22rem 0.45rem !important;
  }

  .product-title {
    font-size: 0.9rem !important;
    line-height: 1.25 !important;
  }

  .product-price {
    font-size: 0.95rem !important;
  }

  .btn,
  .btn-add-cart,
  .btn-buy-now,
  .btn-shopee,
  .btn-checkout,
  .btn-outline-primary,
  button[type="submit"] {
    font-size: 0.86rem !important;
    border-radius: 11px !important;
  }

  .btn-add-cart,
  .btn-buy-now,
  .btn-shopee,
  .btn-checkout {
    padding: 0.7rem 0.8rem !important;
  }

  .cart-drawer {
    max-width: 88vw !important;
  }

  .cart-header {
    padding: 1rem !important;
  }

  .cart-header h2 {
    font-size: 1.1rem !important;
  }

  .cart-items-container,
  .cart-footer {
    padding: 1rem !important;
  }

  .cart-item {
    gap: 0.75rem !important;
    padding: 0.85rem 0 !important;
  }

  .cart-item-img {
    width: 58px !important;
    height: 58px !important;
  }

  .cart-item-title,
  .cart-item-price {
    font-size: 0.86rem !important;
  }

  .cart-summary {
    font-size: 1rem !important;
    margin-bottom: 1rem !important;
  }

  .checkout-wrapper {
    gap: 1rem !important;
    margin: 1rem 0 !important;
  }

  .checkout-card,
  .track-card,
  .payment-details,
  .seo-section {
    padding: 1rem !important;
    border-radius: 14px !important;
  }

  .checkout-card h2,
  .track-card h1,
  .payment-details h3 {
    font-size: 1.05rem !important;
    line-height: 1.25 !important;
  }

  .form-group {
    margin-bottom: 0.85rem !important;
  }

  .form-group label {
    font-size: 0.84rem !important;
    margin-bottom: 0.35rem !important;
  }

  .checkout-summary-item {
    font-size: 0.86rem !important;
    gap: 0.6rem !important;
  }

  .checkout-summary-item.total {
    font-size: 1rem !important;
  }

  .payment-container {
    margin: 1rem auto !important;
    padding: 0 0.25rem !important;
  }

  .payment-row {
    font-size: 0.84rem !important;
    gap: 0.5rem !important;
  }

  .copy-btn {
    font-size: 0.7rem !important;
    padding: 0.18rem 0.45rem !important;
  }

  #qr-payment-modal > div {
    width: min(100%, 360px) !important;
    padding: 1rem !important;
  }

  #qr-payment-modal h2 {
    font-size: 1.1rem !important;
  }

  #qr-payment-modal p {
    font-size: 0.82rem !important;
  }

  #vietqr-img {
    width: min(100%, 230px) !important;
  }

  .track-search-form {
    gap: 0.6rem !important;
  }

  .track-search-form input,
  .track-search-form button {
    font-size: 0.86rem !important;
    padding: 0.65rem 0.8rem !important;
  }

  .track-header-panel {
    gap: 0.75rem !important;
  }

  .track-title-info h2 {
    font-size: 1.1rem !important;
  }

  .track-date-info,
  .track-status-badge,
  .track-desc {
    font-size: 0.82rem !important;
  }

  .track-step-icon {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.82rem !important;
  }

  .track-step-label,
  .track-time,
  .track-loc {
    font-size: 0.74rem !important;
  }

  .track-date {
    font-size: 0.68rem !important;
  }

  .page-link {
    min-width: 2rem !important;
    height: 2rem !important;
    padding: 0.35rem 0.65rem !important;
    font-size: 0.78rem !important;
    border-radius: 10px !important;
  }

  footer {
    padding: 2rem 0 1rem !important;
    margin-top: 2rem !important;
  }

  .footer-logo {
    font-size: 1.1rem !important;
  }

  .footer-title {
    font-size: 0.95rem !important;
    margin-bottom: 0.7rem !important;
  }

  .footer-links,
  footer p {
    font-size: 0.82rem !important;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 13.5px;
  }

  .container,
  main.container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .logo {
    font-size: 1.05rem !important;
  }

  .mobile-actions {
    gap: 0.45rem !important;
  }

  .cart-btn {
    padding: 0.4rem 0.6rem !important;
  }

  .section-title,
  .hero h1,
  main.container h1:not(.product-detail-title) {
    font-size: 1.2rem !important;
  }

  .product-grid {
    gap: 0.65rem !important;
  }

  .checkout-card,
  .track-card,
  .payment-details,
  .seo-section {
    padding: 0.85rem !important;
  }
}

/* ==========================================================================
   UI/UX POLISH LAYER (Dễ thương gọn)
   ========================================================================== */
:root {
  --primary: #ec5fa8;
  --primary-hover: #d94b95;
  --primary-light: #fff0f7;
  --secondary: #8b5cf6;
  --background: #fbfbfe;
  --card-bg: #ffffff;
  --text-main: #172033;
  --text-muted: #667085;
  --border: #e7e9f0;
  --ring: rgba(236, 95, 168, 0.22);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 10px 24px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 18px 44px rgba(16, 24, 40, 0.13);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

body {
  background:
    linear-gradient(180deg, rgba(255, 240, 247, 0.75), rgba(251, 251, 254, 0) 300px),
    var(--background);
  color: var(--text-main);
  text-rendering: optimizeLegibility;
}

a:hover {
  color: var(--primary);
}

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

header {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 0 rgba(231, 233, 240, 0.8);
}

.header-container {
  gap: 1.1rem;
}

.logo,
.footer-logo,
.admin-logo {
  letter-spacing: 0;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.92rem;
}

.nav-links a:hover {
  color: var(--primary);
}

#header-search-input,
.form-control {
  border: 1px solid var(--border) !important;
  background: #fff !important;
  box-shadow: var(--shadow-sm);
}

#header-search-input:focus,
.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px var(--ring) !important;
}

.btn,
.btn-primary,
.btn-secondary,
.btn-add-cart,
.btn-buy-now,
.btn-shopee,
.btn-outline-primary,
.btn-checkout,
.track-search-form button,
button[type="submit"] {
  min-height: 40px;
  border-radius: var(--radius-md);
  font-weight: 800;
  letter-spacing: 0;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn-primary,
.btn-add-cart,
.btn-buy-now,
.btn-checkout,
.track-search-form button,
button[type="submit"] {
  background: linear-gradient(135deg, var(--primary), #f47cb6);
  color: #fff;
  box-shadow: 0 10px 18px rgba(236, 95, 168, 0.18);
}

.btn-primary:hover,
.btn-add-cart:hover,
.btn-buy-now:hover,
.btn-checkout:hover,
.track-search-form button:hover,
button[type="submit"]:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(236, 95, 168, 0.22);
}

button:disabled,
.btn-add-cart:disabled,
.btn-buy-now:disabled {
  transform: none !important;
  box-shadow: none !important;
}

.section-title {
  letter-spacing: 0;
}

.section-title::after {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.product-grid {
  align-items: stretch;
}

.product-card,
.checkout-card,
.track-card,
.payment-details,
.seo-section,
.table-card,
.stat-card {
  border: 1px solid rgba(231, 233, 240, 0.92);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.product-card {
  min-width: 0;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(236, 95, 168, 0.28);
}

.product-image-container {
  background: linear-gradient(135deg, #fff7fb, #f7f7ff);
  padding-bottom: 100%;
}

.product-image-container img {
  object-fit: cover;
}

.product-category {
  color: var(--primary);
  border: 1px solid rgba(236, 95, 168, 0.16);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
}

.product-title {
  font-weight: 800;
}

.product-desc {
  line-height: 1.45;
}

.product-meta {
  color: var(--text-muted) !important;
}

.filter-btn,
.page-link {
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm);
}

.cart-overlay,
.menu-overlay {
  background-color: rgba(23, 32, 51, 0.46) !important;
}

.cart-drawer,
.menu-drawer {
  border-left: 1px solid var(--border);
}

.cart-item {
  align-items: flex-start;
}

.cart-item-img {
  border: 1px solid var(--border);
  background: #fff;
}

.cart-item-title {
  font-weight: 800 !important;
  line-height: 1.25;
}

.cart-item-gift {
  background: #effdf5 !important;
  border-color: #b8efcd !important;
}

.cart-item-remove,
.checkout-remove-btn {
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.1rem 0;
  text-decoration: none;
}

.checkout-remove-btn {
  margin-top: 0.45rem;
}

.qty-btn {
  min-height: 28px;
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.checkout-summary-item {
  align-items: flex-start;
}

.payment-row {
  gap: 1rem;
}

.payment-row .val {
  text-align: right;
  overflow-wrap: anywhere;
}

.copy-btn {
  margin-left: 0.5rem;
  padding: 0.22rem 0.56rem;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

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

#qr-payment-modal > div {
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: var(--radius-lg) !important;
}

#vietqr-img {
  background: #fff;
  padding: 0.4rem;
}

.track-progress-line {
  background-color: #eceef5;
}

.track-step-icon {
  background: #fff;
  border-color: #d8dce7;
}

.track-status-badge {
  border-radius: 999px;
  border: 1px solid transparent;
}

footer {
  background: #171827;
}

.footer-muted-link {
  color: #94a3b8;
  cursor: default;
}

.admin-sidebar {
  background: #171827;
}

.admin-menu a {
  border: 1px solid transparent;
}

.admin-menu a:hover,
.admin-menu li.active a,
.admin-menu a.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
}

.admin-main {
  background:
    linear-gradient(180deg, #fff7fb, #f5f7fb 260px),
    #f5f7fb;
}

.admin-header {
  gap: 1rem;
}

table.admin-table th {
  background-color: #fbfbfd;
  color: #667085;
}

table.admin-table tbody tr:hover {
  background-color: #fff8fc;
}

#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-message {
  min-width: 260px;
  max-width: min(360px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.24s ease, transform 0.24s ease;
  pointer-events: auto;
}

.toast-message.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 992px) {
  .admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 80;
    overflow-x: auto;
  }

  .admin-menu {
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }
}

@media (max-width: 768px) {
  header {
    position: sticky;
  }

  .header-container {
    align-items: center;
  }

  .mobile-actions {
    margin-left: auto;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .product-title {
    height: auto;
    min-height: 2.5em;
    -webkit-line-clamp: 2;
  }

  .product-image-container {
    border-radius: 0;
  }

  .cart-drawer {
    max-width: min(92vw, 420px) !important;
  }

  .checkout-wrapper {
    grid-template-columns: 1fr;
  }

  .payment-row {
    align-items: flex-start;
  }

  .payment-row .label {
    min-width: 7.5rem;
  }

  .payment-row .val {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .admin-layout {
    display: block;
  }

  .admin-sidebar {
    padding: 1rem;
  }

  .admin-logo {
    min-width: max-content;
  }

  .admin-main {
    padding: 1rem;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 1.25rem;
  }

  .admin-title {
    font-size: 1.35rem;
  }

  table.admin-table tbody td::before {
    display: block;
  }
}

@media (max-width: 480px) {
  #toast-container {
    top: 12px;
    left: 12px;
    right: 12px;
  }

  .toast-message {
    width: 100%;
    min-width: 0;
  }

  .product-info {
    padding: 0.7rem !important;
  }

  .product-category {
    top: 8px;
    left: 8px;
  }

  .product-card:hover {
    transform: none;
  }

  .payment-row {
    flex-direction: column;
    gap: 0.25rem;
  }

  .payment-row .val {
    text-align: left;
    justify-content: flex-start;
  }
}

/* ==========================================================================
   ADMIN SIDEBAR SYNC
   ========================================================================== */
.admin-sidebar {
  transition: width 0.2s ease, padding 0.2s ease;
}

.admin-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.admin-sidebar-head .admin-logo {
  margin-bottom: 0;
  font-size: 1.1rem;
  line-height: 1.35;
}

.admin-menu a {
  font-size: 0.86rem;
  line-height: 1.35;
}

.admin-menu a span,
.admin-logo span {
  white-space: nowrap;
}

.admin-logout-item {
  margin-top: auto;
}

.sidebar-toggle {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  background: #1e293b;
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
}

.sidebar-toggle:hover {
  color: #fff;
  background: #334155;
}

body.admin-sidebar-collapsed .sidebar-toggle {
  transform: rotate(180deg);
}

@media (min-width: 993px) {
  .admin-layout {
    display: block;
  }

  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    min-height: 100vh;
    overflow-y: auto;
    z-index: 1000;
  }

  .admin-main {
    margin-left: 250px;
    min-height: 100vh;
    transition: margin-left 0.2s ease;
  }

  body.admin-sidebar-collapsed .admin-sidebar {
    width: 76px;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  body.admin-sidebar-collapsed .admin-main {
    margin-left: 76px;
  }

  body.admin-sidebar-collapsed .admin-logo span,
  body.admin-sidebar-collapsed .admin-menu a span {
    display: none;
  }

  body.admin-sidebar-collapsed .admin-logo,
  body.admin-sidebar-collapsed .admin-menu a {
    justify-content: center;
  }

  body.admin-sidebar-collapsed .admin-sidebar-head {
    justify-content: center;
  }

  body.admin-sidebar-collapsed .admin-sidebar-head .admin-logo {
    display: none;
  }
}

@media (max-width: 992px) {
  .admin-layout {
    display: block;
  }

  .admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 0;
    padding: 0.85rem 1rem;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .admin-sidebar-head {
    margin-bottom: 0.75rem;
  }

  .sidebar-toggle {
    display: none;
  }

  .admin-menu {
    flex-direction: row;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .admin-menu li {
    flex: 0 0 auto;
  }

  .admin-logout-item {
    margin-top: 0;
  }

  .admin-main {
    margin-left: 0;
  }
}

/* ==========================================================================
   HEADER DESKTOP STABILITY
   ========================================================================== */
header .header-container {
  max-width: 1200px;
  height: 70px;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 1rem;
}

header .logo {
  flex: 0 0 auto;
  min-width: max-content;
  white-space: nowrap;
  font-size: 1.5rem;
  line-height: 1.05;
}

header .logo span {
  display: inline;
  white-space: nowrap;
}

.header-search-container {
  flex: 0 0 260px !important;
  width: 260px !important;
  min-width: 220px !important;
  max-width: 260px !important;
  margin: 0 0.75rem !important;
}

.desktop-nav {
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
}

.nav-links {
  justify-content: flex-end;
  gap: 0.9rem;
  flex-wrap: nowrap;
  min-width: 0;
}

.nav-links li {
  flex: 0 0 auto;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  white-space: nowrap;
  line-height: 1.2;
  font-size: 0.9rem;
}

header .cart-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0.6rem 0.95rem;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  min-height: 40px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
  padding: 0;
}

.nav-dropdown-toggle:hover {
  color: var(--primary);
}

.nav-dropdown-toggle::after {
  content: "▾";
  margin-left: 0.3rem;
  font-size: 0.72rem;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  min-width: 210px;
  list-style: none;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 300;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: flex;
  min-height: 0;
  width: 100%;
  padding: 0.62rem 0.75rem;
  border-radius: 8px;
  white-space: normal;
  line-height: 1.25;
}

.nav-dropdown-menu a:hover {
  background: var(--primary-light);
}

@media (max-width: 1240px) {
  .desktop-nav {
    display: none !important;
  }

  .mobile-actions {
    display: flex !important;
    margin-left: auto;
  }

  header .header-container {
    height: auto;
    flex-wrap: wrap;
  }

  .header-search-container {
    order: 3;
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0.5rem 0 0 !important;
  }
}
