/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition), transform 120ms ease;
  white-space: nowrap;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--gold);
  color: var(--white);
  border: 1.5px solid var(--gold);
}
.btn-primary:hover {
  background: var(--gold-hover);
  border-color: var(--gold-hover);
  box-shadow: 0 4px 16px rgba(196,146,42,0.3);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline:hover {
  background: var(--gold-pale);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.5);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.8);
}

.btn-sm { padding: 0.45rem 1.1rem; font-size: 0.78rem; }
.btn-lg { padding: 0.9rem 2.25rem; font-size: 0.95rem; }
.btn-block { width: 100%; }

/* ===== Product Card ===== */
.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: box-shadow var(--transition), transform var(--transition);
}
.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.product-card-link { display: block; }
.product-card-img-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--cream-dark);
}
.product-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}
.product-card:hover .product-card-img { transform: scale(1.05); }
.product-card-body { padding: 1.1rem; }
.product-card-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.35rem;
}
.product-card-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 0.35rem;
}
.product-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.product-card-price {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gold);
}

/* ===== Products Grid ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--brown);
  margin-bottom: 0.4rem;
}
.required { color: var(--gold); }
.form-input {
  display: block;
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196,146,42,0.12);
}
.form-input.error { border-color: #e53e3e; }
.form-textarea { resize: vertical; min-height: 130px; }
.form-error { display: block; font-size: 0.78rem; color: #e53e3e; margin-top: 0.3rem; min-height: 1em; }

/* ===== Alerts ===== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.alert-error { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.alert svg { flex-shrink: 0; margin-top: 1px; }

/* ===== Qty Selector ===== */
.qty-selector {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.qty-btn {
  width: 38px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--brown);
  background: var(--cream-dark);
  transition: background var(--transition);
}
.qty-btn:hover { background: var(--gold-light); }
.qty-input {
  width: 52px;
  text-align: center;
  border: none;
  border-left: 1.5px solid var(--border);
  border-right: 1.5px solid var(--border);
  height: 42px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--brown);
  background: var(--white);
  outline: none;
}
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ===== Badges ===== */
.in-stock-badge { color: #166534; font-size: 0.85rem; font-weight: 500; }
.out-of-stock-badge { color: #991b1b; font-size: 0.85rem; font-weight: 500; }
.product-category-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold-light);
  background: var(--gold-pale);
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  margin-bottom: 0.75rem;
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ===== Nav — Logged-in user pill (loaded on every page) ===== */
.nav-user-item  { position: relative; list-style: none; }
.nav-user-menu  { position: relative; }

.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 4px 10px 4px 4px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--gold-pale);
  color: var(--brown);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.nav-user-btn:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(196,146,42,0.18);
}

.nav-user-img {
  display: block;
  width: 32px;
  height: 32px;
  min-width: 32px;
  max-width: 32px;
  min-height: 32px;
  max-height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-light);
  flex-shrink: 0;
  overflow: hidden;
}

.nav-user-name {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--brown);
}

.nav-chevron {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition);
}
.nav-user-btn[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }

/* Dropdown */
.nav-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(42,20,8,0.14);
  overflow: hidden;
  z-index: 999;
}
.nav-user-dropdown.open { display: block; animation: navDropIn 0.15s ease; }

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

.nav-dropdown-profile {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  background: var(--gold-pale);
  border-bottom: 1px solid var(--border-light);
}

.nav-dropdown-img {
  display: block;
  width: 38px;
  height: 38px;
  min-width: 38px;
  max-width: 38px;
  min-height: 38px;
  max-height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-light);
  flex-shrink: 0;
  overflow: hidden;
}

.nav-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.nav-dropdown-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brown);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-dropdown-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-dropdown-divider { height: 1px; background: var(--border-light); }

.nav-logout-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #b91c1c;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background var(--transition);
}
.nav-logout-btn:hover { background: #fef2f2; }
.nav-logout-btn svg   { flex-shrink: 0; }

/* Nav auth buttons (guest) */
.nav-auth-item { list-style: none; }

@media (max-width: 768px) {
  .nav-user-item,
  .nav-auth-item  { width: 100%; }
  .nav-user-btn   { width: 100%; border-radius: var(--radius); justify-content: flex-start; }
  .nav-user-dropdown {
    position: static;
    width: 100%;
    box-shadow: none;
    border-radius: var(--radius);
    margin-top: 0.4rem;
    animation: none;
  }
  .nav-signup-btn { width: 100%; border-radius: var(--radius); justify-content: center; }
}
