:root {
  --cream: #fbf3ea;
  --cream-soft: #f5ebdf;
  --brown-900: #4a3728;
  --brown-700: #6b4f3f;
  --brown-500: #8b6f5c;
  --tan: #c9a27e;
  --rose: #b98d6f;
  --white: #ffffff;
  --border: #e7d9c6;
  --danger: #b23b3b;
  --shadow: 0 6px 20px rgba(74, 55, 40, 0.08);
  --radius: 16px;
  --font-body: "Quicksand", system-ui, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--brown-900);
  line-height: 1.6;
}

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

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

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 40px 20px;
}

.section-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 24px;
  color: var(--brown-700);
}

.page-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2.4rem;
  margin: 0 0 8px;
  color: var(--brown-700);
}

.page-desc {
  color: var(--brown-500);
  margin: 0 0 24px;
}

.empty-state {
  color: var(--brown-500);
  background: var(--cream-soft);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 20px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--tan);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--brown-700);
}

.brand-tagline {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brown-500);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-weight: 600;
  font-size: 0.95rem;
}

.main-nav a:hover {
  color: var(--rose);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.zalo-pill {
  background: var(--cream-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.cart-link {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-count {
  background: var(--rose);
  color: var(--white);
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  padding: 0 4px;
}

/* Hero */
.hero {
  background: var(--cream-soft);
}

.hero-banner {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  margin: 0 auto;
}

/* Category grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.category-card-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
}

.category-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-card-name {
  font-weight: 600;
}

.image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream-soft);
  color: var(--tan);
  font-family: var(--font-display);
  font-style: italic;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.product-card-image {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--cream-soft);
}

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

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

.product-card-body {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-card-name {
  font-weight: 600;
}

.product-card-price {
  color: var(--rose);
  font-weight: 700;
}

.product-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 700;
  font-family: var(--font-body);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
}

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

.btn-zalo:hover {
  background: var(--brown-700);
}

.btn-outline {
  background: transparent;
  border-color: var(--tan);
  color: var(--brown-700);
}

.btn-outline:hover {
  background: var(--cream-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--brown-500);
  border-color: var(--border);
}

/* Footer */
.site-footer {
  background: var(--brown-900);
  color: var(--cream);
  margin-top: 60px;
}

.footer-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  padding: 40px 20px;
}

.footer-block ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-block a:hover {
  color: var(--tan);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 16px 20px;
  font-size: 0.85rem;
  opacity: 0.8;
  text-align: center;
}

/* Product detail */
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
}

.product-gallery-main {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
}

.product-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.product-gallery-thumbs img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
}

.product-gallery-thumbs img:hover {
  border-color: var(--tan);
}

.breadcrumb {
  color: var(--brown-500);
  font-weight: 600;
  display: inline-block;
  margin-bottom: 10px;
}

.product-price {
  font-size: 1.4rem;
  color: var(--rose);
  font-weight: 700;
}

.product-note {
  background: var(--cream-soft);
  border-radius: 12px;
  padding: 12px 16px;
}

.product-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* Contact */
.contact-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 1.05rem;
}

/* Cart page */
.cart-hint {
  color: var(--brown-500);
  margin-bottom: 20px;
}

.cart-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-item a {
  font-weight: 600;
}

.cart-item button {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-weight: 600;
}

.cart-footer {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brown-900);
  color: var(--cream);
  padding: 14px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  z-index: 100;
  max-width: 90vw;
  text-align: center;
}

/* Login */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
}

.login-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto;
}

.login-card h1 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  margin: 0;
  color: var(--brown-700);
}

.login-sub {
  color: var(--brown-500);
  margin: 0;
}

.login-card label {
  text-align: left;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Form controls */
input,
textarea,
select {
  font-family: var(--font-body);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  background: var(--white);
  color: var(--brown-900);
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--tan);
}

.form-error {
  background: #fbeaea;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
}

/* Admin */
.admin-body {
  background: var(--cream-soft);
}

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 220px;
  background: var(--brown-900);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 24px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.admin-brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.admin-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.admin-sidebar nav a {
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  opacity: 0.85;
}

.admin-sidebar nav a.active,
.admin-sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
}

.admin-main {
  flex: 1;
  min-width: 0;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.admin-topbar h1 {
  font-family: var(--font-display);
  font-style: italic;
  margin: 0;
  color: var(--brown-700);
}

.admin-content {
  padding: 32px;
}

.admin-toolbar {
  margin-bottom: 20px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.admin-table th,
.admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.admin-thumb-empty {
  background: var(--cream-soft);
}

.admin-row-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

.admin-row-actions form {
  margin: 0;
}

.link-danger {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-weight: 600;
  padding: 0;
}

.admin-form {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

.admin-form-preview {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
}

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

.admin-existing-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-existing-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-weight: 400;
  font-size: 0.8rem;
}

.admin-existing-image img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
}

.admin-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--rose);
}

.admin-quick-links {
  display: flex;
  gap: 12px;
}

@media (max-width: 720px) {
  .product-detail {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    flex-direction: column;
  }

  .admin-sidebar {
    width: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .admin-sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
