:root {
  --bg: #faf5ef;
  --bg-alt: #ffffff;
  --primary: #c97a20;
  --primary-soft: #f6e1c7;
  --primary-dark: #8a4b10;
  --text: #2a2a2a;
  --muted: #6f6f6f;
  --border: #e5ddd1;
  --danger: #d64545;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top left, #ffe8c7, #faf5ef 45%, #fff);
  color: var(--text);
}

a {
  color: var(--primary-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: linear-gradient(
    to bottom,
    rgba(250, 245, 239, 0.9),
    rgba(250, 245, 239, 0.7)
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  gap: 24px;
}

.header-left {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-mark {
  font-size: 24px;
}

.logo-text {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 15px;
}

.logo-sub {
  font-size: 12px;
  color: var(--muted);
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
}

.lang-switcher a {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.lang-switcher a.active {
  background: var(--primary);
  color: #fff;
}

.lang-switcher a:not(.active):hover {
  background: rgba(0, 0, 0, 0.04);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.main-nav a {
  text-decoration: none;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.main-nav a:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

/* User Dropdown Menu */
.user-menu-dropdown {
  position: relative;
  display: inline-block;
}

.user-name-clickable {
  cursor: pointer;
  padding: 6px 12px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-radius: 999px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.user-name-clickable:hover {
  background: #f0d8b8;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: var(--bg-alt);
  min-width: 180px;
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-md);
  padding: 8px 0;
  z-index: 100;
  border: 1px solid var(--border);
  margin-top: 8px;
}

.dropdown-content a, .logout-button {
  color: var(--text);
  padding: 10px 16px;
  text-decoration: none;
  display: block;
  font-size: 14px;
  transition: background 0.2s ease;
  text-align: left;
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
}

.dropdown-content a:hover, .logout-button:hover {
  background-color: var(--primary-soft);
  color: var(--primary-dark);
  text-decoration: none;
}

.dropdown-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.user-menu-dropdown:hover .dropdown-content {
  display: block;
}

.logout-button {
  color: var(--danger);
}

.link-button {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--primary-dark);
  cursor: pointer;
}

.link-button.danger {
  color: var(--danger);
}

.inline-form {
  display: inline;
}

.site-main {
  padding: 28px 0 40px;
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.6);
  padding: 16px 0 22px;
  font-size: 13px;
  color: var(--muted);
}

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

.footer-contacts {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 40px;
}

/* Alerts & Notifications */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

.alert-success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

/* Form improvements */
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
}

.form-group input, 
.form-group textarea, 
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-alt);
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus, 
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(201, 122, 32, 0.1);
  outline: none;
}

/* Tooltip/Hint */
.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* Catalog Filters & Search */
.catalog-filters {
  margin-bottom: 30px;
}

.search-form {
  max-width: 600px;
  margin: 0 auto;
}

.search-input-group {
  display: flex;
  gap: 0;
  box-shadow: var(--shadow-soft);
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid var(--border);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 10px 25px rgba(201, 122, 32, 0.15);
}

.search-input {
  flex: 1;
  padding: 12px 24px;
  border: none;
  outline: none;
  font-size: 16px;
  background: var(--bg-alt);
}

.btn-search {
  background: var(--bg-alt);
  border: none;
  padding: 0 20px;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s ease;
}

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

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  animation: fadeInUp 0.4s ease-out backwards;
}

/* Stagger animation for product cards */
.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.product-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn, .btn-small, .btn-ghost {
  transition: transform 0.1s active, background 0.2s ease;
}

.btn:active, .btn-small:active {
  transform: scale(0.96);
}

/* Empty search state */
.empty-results {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  grid-column: 1 / -1;
}

.empty-results p {
  color: var(--muted);
  font-size: 18px;
}

.page-header h1 {
  margin: 0 0 4px;
  font-size: 28px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 460px;
  line-height: 1.5;
}

.highlight-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.8);
  max-width: 320px;
}

.highlight-card h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.highlight-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.product-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.8);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-image {
  height: 180px;
  background: radial-gradient(circle at top, #ffe2a4, #f5d0a4);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.placeholder-image {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 18px;
}

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

.product-body h3 {
  margin: 0;
  font-size: 18px;
}

.product-description {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.product-rating .stars {
  display: flex;
  align-items: center;
  gap: 2px;
}

.product-rating .star {
  color: #ddd;
  font-size: 14px;
}

.product-rating .star.filled {
  color: #ffc107;
}

.rating-text {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.product-price {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 15px;
}

.price-value {
  font-weight: 600;
}

.price-unit {
  font-size: 12px;
  color: var(--muted);
}

.add-to-cart-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

input[type='number'],
input[type='text'],
input[type='email'],
input[type='password'],
input[type='tel'],
textarea,
select {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 7px 12px;
  font: inherit;
  outline: none;
  background: #fff;
  min-width: 0;
}

textarea {
  border-radius: 14px;
  resize: vertical;
}

input[type='number'] {
  width: 64px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(201, 122, 32, 0.15);
}

.btn,
.btn-ghost,
.btn-small {
  position: relative;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  cursor: pointer;
  font: inherit;
  padding: 9px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  transition:
    transform 0.08s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    border-color 0.16s ease;
}

.btn::before,
.btn-ghost::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}

.btn {
  background: radial-gradient(circle at top left, #ffd68a, #c97a20);
  color: #fff;
  box-shadow: 0 14px 30px rgba(201, 122, 32, 0.45);
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(201, 122, 32, 0.55);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(201, 122, 32, 0.35);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.btn-ghost:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.1);
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

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

.btn-secondary {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.btn-secondary:hover {
  background: #e5ddd1;
}

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

.btn-xxs {
  padding: 4px 9px;
  font-size: 11px;
  text-transform: none;
}

.btn.full-width {
  width: 100%;
}

/* Make plain buttons look consistent even without classes */
button:not(.link-button):not(.btn):not(.btn-ghost):not(.btn-small),
input[type='submit']:not(.link-button):not(.btn):not(.btn-ghost):not(.btn-small) {
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  cursor: pointer;
  font: inherit;
  padding: 9px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  background: radial-gradient(circle at top left, #ffd68a, #c97a20);
  color: #fff;
  box-shadow: 0 14px 30px rgba(201, 122, 32, 0.45);
  transition: transform 0.08s ease, box-shadow 0.16s ease;
}

button:not(.link-button):not(.btn):not(.btn-ghost):not(.btn-small):hover,
input[type='submit']:not(.link-button):not(.btn):not(.btn-ghost):not(.btn-small):hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(201, 122, 32, 0.55);
}

.card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-lg);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.form-card {
  max-width: 480px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
}

.field-hint {
  font-size: 12px;
  color: var(--muted);
}

.form-footer {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.form-row {
  display: flex;
  gap: 10px;
}

.form-row .form-group {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.checkbox,
.radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.alert {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 14px;
}

.alert-error {
  background: #ffe5e5;
  color: #a12424;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 8px 6px;
  border-bottom: 1px solid #f0e6d8;
  text-align: left;
}

.table th {
  font-weight: 500;
  color: var(--muted);
}

.table-sm th,
.table-sm td {
  padding: 6px 4px;
}

.table-actions {
  white-space: nowrap;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  gap: 10px;
}

.cart-total {
  font-size: 16px;
}

.cart-actions {
  display: flex;
  gap: 8px;
}

.order-summary {
  min-width: 260px;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.9fr);
  gap: 18px;
  align-items: flex-start;
}

.delivery-map {
  width: 100%;
  height: 260px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}

.order-items {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}

.order-item-name {
  font-weight: 500;
}

.order-item-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 10px;
}

.order-item-sum {
  white-space: nowrap;
  font-weight: 500;
}

.order-total {
  margin-top: 14px;
  font-size: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  background: #f0e6d8;
  color: var(--text);
}

.badge-success {
  background: #e6f5d7;
  color: #406a1f;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 18px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-header h2 {
  margin: 0;
  font-size: 18px;
}

.actions {
  margin-top: 16px;
}

@media (max-width: 800px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-header {
    flex-direction: column;
  }

  .highlight-card {
    max-width: 100%;
  }

  .admin-grid,
  .checkout-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Mobile phones */
@media (max-width: 480px) {
  .container {
    width: calc(100% - 20px);
    padding: 0 10px;
  }

  .site-header {
    padding: 12px 0;
  }

  .header-left {
    width: 100%;
  }

  .logo {
    font-size: 16px;
  }

  .logo-sub {
    display: none;
  }

  .main-nav {
    flex-wrap: wrap;
    gap: 8px;
  }

  .main-nav a {
    font-size: 14px;
    padding: 4px 8px;
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .product-card {
    padding: 16px;
  }

  .product-image {
    height: 180px;
  }

  .product-footer {
    flex-direction: column;
    gap: 12px;
  }

  .add-to-cart-form {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .add-to-cart-form input {
    flex: 1;
  }

  .table {
    font-size: 14px;
  }

  .table th,
  .table td {
    padding: 8px 4px;
  }

  .cart-summary {
    flex-direction: column;
    gap: 12px;
  }

  .cart-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .delivery-map {
    height: 250px;
  }

  .order-summary {
    margin-top: 20px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .page-header .subtitle {
    font-size: 16px;
  }
}

