/* ===== Dark theme (default) ===== */
:root, [data-theme="dark"] {
  --bg: #0c0e12;
  --bg2: #151820;
  --bg3: #1e222d;
  --text: #eef0f4;
  --muted: #9aa0a6;
  --accent: #ff6b1a;
  --accent2: #ff8c38;
  --green: #2ecc71;
  --red: #e74c3c;
  --border: #2a2f3a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,.45);
  --shadow-sm: 0 2px 12px rgba(0,0,0,.3);
  --accent-glow: 0 0 24px rgba(255, 107, 26, 0.25);
  --hero-grad: linear-gradient(135deg, #151820 0%, #2a1a0f 50%, #151820 100%);
  --card-hover-border: rgba(255, 107, 26, 0.5);
  --input-bg: #1e222d;
  --success-bg: rgba(46, 204, 113, 0.12);
  --error-bg: rgba(231, 76, 60, 0.12);
  --overlay: rgba(0, 0, 0, 0.7);
}

/* ===== Light theme ===== */
[data-theme="light"] {
  --bg: #f4f5f7;
  --bg2: #ffffff;
  --bg3: #eef0f4;
  --text: #1a1d24;
  --muted: #5f6368;
  --accent: #e85d04;
  --accent2: #d35400;
  --green: #27ae60;
  --red: #c0392b;
  --border: #dde1e6;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 30px rgba(0,0,0,.08);
  --shadow-sm: 0 2px 12px rgba(0,0,0,.06);
  --accent-glow: 0 0 20px rgba(232, 93, 4, 0.15);
  --hero-grad: linear-gradient(135deg, #fff8f0 0%, #ffe8d0 50%, #fff8f0 100%);
  --card-hover-border: rgba(232, 93, 4, 0.4);
  --input-bg: #eef0f4;
  --success-bg: rgba(39, 174, 96, 0.1);
  --error-bg: rgba(192, 57, 43, 0.1);
  --overlay: rgba(0, 0, 0, 0.5);
}

/* Respect system preference when no explicit theme is set */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e12;
    --bg2: #151820;
    --bg3: #1e222d;
    --text: #eef0f4;
    --muted: #9aa0a6;
    --accent: #ff6b1a;
    --accent2: #ff8c38;
    --green: #2ecc71;
    --red: #e74c3c;
    --border: #2a2f3a;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0,0,0,.45);
    --shadow-sm: 0 2px 12px rgba(0,0,0,.3);
    --accent-glow: 0 0 24px rgba(255, 107, 26, 0.25);
    --hero-grad: linear-gradient(135deg, #151820 0%, #2a1a0f 50%, #151820 100%);
    --card-hover-border: rgba(255, 107, 26, 0.5);
    --input-bg: #1e222d;
    --success-bg: rgba(46, 204, 113, 0.12);
    --error-bg: rgba(231, 76, 60, 0.12);
    --overlay: rgba(0, 0, 0, 0.7);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  transition: background .2s, color .2s;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { color: var(--accent); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Header */
.header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 12px;
  flex-wrap: wrap;
}
.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo span { color: var(--accent); }
.nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.nav a, .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: .15s;
}
.nav a { color: var(--muted); background: transparent; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--bg3); }
.nav-user {
  color: var(--accent2);
  font-size: 0.9rem;
  padding: 0 6px;
  font-weight: 600;
}
.btn {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  justify-content: center;
  text-align: center;
}
.btn:hover { background: var(--accent2); color: #fff; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 10px; font-size: 0.85rem; }
.btn-green { background: var(--green); }
.btn-red { background: var(--red); }
.cart-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 4px;
}

/* Theme & language controls */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}
.lang-switch {
  display: flex;
  gap: 2px;
  background: var(--bg3);
  border-radius: 8px;
  padding: 2px;
}
.lang-btn {
  padding: 5px 10px !important;
  font-size: 0.75rem !important;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 6px !important;
  color: var(--muted) !important;
  background: transparent !important;
}
.lang-btn:hover { color: var(--text) !important; }
.lang-btn.active {
  background: var(--accent) !important;
  color: #fff !important;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  cursor: pointer;
  font-size: 1.1rem;
  transition: .15s;
}
.theme-toggle:hover { border-color: var(--accent); }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-light { display: inline; }
[data-theme="dark"] .theme-icon-dark { display: inline; }

/* Hero */
.hero {
  position: relative;
  margin: 0 -16px;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: heroBannerIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 32px 16px 40px;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.35) 55%, transparent 100%);
  color: #fff;
}
.hero h1 {
  font-size: 2rem;
  margin-bottom: 8px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.hero p {
  color: rgba(255,255,255,0.9);
  margin-bottom: 20px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero .btn-outline {
  border-color: rgba(255,255,255,0.7);
  color: #fff;
  background: rgba(0,0,0,0.25);
}
.hero .btn-outline:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255,255,255,0.15);
}
@keyframes heroBannerIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Categories pills — sticky under header; wrap so all are visible */
.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 4px;
  justify-content: center;
  align-items: center;
  padding: 8px 12px;
  overflow: visible;
  position: sticky;
  top: var(--header-height, 56px);
  z-index: 90;
  background: var(--bg);
  margin-left: -16px;
  margin-right: -16px;
  border-bottom: 1px solid var(--border);
}
.cats a {
  flex: 0 1 auto;
  padding: 5px 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
  font-size: clamp(0.68rem, 2.5vw, 0.82rem);
  line-height: 1.25;
  text-align: center;
}
.cats a:hover, .cats a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
@media (max-width: 699px) {
  .cats {
    gap: 4px 3px;
    padding: 6px 10px;
  }
  .cats a {
    padding: 4px 8px;
    font-size: clamp(0.62rem, 2.8vw, 0.78rem);
  }
}
@media (min-width: 700px) {
  .cats {
    gap: 6px;
    padding: 8px 16px;
    justify-content: flex-start;
  }
  .cats a {
    padding: 6px 14px;
    font-size: 0.82rem;
  }
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 16px 0 32px;
}
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: .2s;
  display: flex;
  flex-direction: column;
}
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.card-img {
  height: auto;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  object-fit: cover;
  width: 100%;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 1rem; margin-bottom: 4px; }
.card-body .desc { color: var(--muted); font-size: 0.85rem; flex: 1; margin-bottom: 10px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-weight: 700; color: var(--accent2); font-size: 1.1rem; }
.price-old {
  text-decoration: line-through;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9em;
  margin-right: 6px;
}

/* Product page — image on top, description below */
.product-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 0;
  max-width: 640px;
  margin: 0 auto;
}
.product-back {
  align-self: flex-start;
  margin-bottom: -8px;
}
.product-img {
  background: var(--bg2);
  border-radius: var(--radius);
  height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  border: 1px solid var(--border);
  overflow: hidden;
  width: 100%;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; }

/* Cart table */
.table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.table th, .table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table th { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.qty-form { display: flex; align-items: center; gap: 6px; }
.qty-form input {
  width: 50px;
  padding: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-align: center;
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--accent);
}
.form-box {
  max-width: 480px;
  margin: 32px auto;
  background: var(--bg2);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* Flash */
.flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 12px 0;
}
.flash.success { background: rgba(46,204,113,.15); color: var(--green); }
.flash.error { background: rgba(231,76,60,.15); color: var(--red); }

/* Admin */
.admin-layout { display: flex; min-height: calc(100vh - 60px); }
.admin-sidebar {
  width: 220px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  flex-shrink: 0;
}
.admin-sidebar a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--muted);
  margin-bottom: 4px;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: var(--bg3);
  color: var(--text);
}
.admin-content { flex: 1; padding: 24px; overflow-x: auto; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-card .num { font-size: 1.8rem; font-weight: 700; color: var(--accent2); }
.stat-card .label { color: var(--muted); font-size: 0.85rem; }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-new { background: rgba(232,93,4,.2); color: var(--accent2); }
.badge-done { background: rgba(46,204,113,.2); color: var(--green); }
.badge-rejected { background: rgba(231,76,60,.2); color: var(--red); }

/* Footer */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 18px 0;
  margin-top: 40px;
  text-align: center;
  color: var(--muted);
}
.footer a { color: var(--accent2); }
.footer-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: normal;
  font-size: 0.95rem;
  padding: 4px 0;
  text-align: center;
}
.footer-payments {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 14px;
  padding-top: 4px;
}
.footer-payments-img {
  height: 32px;
  width: auto;
  opacity: 0.9;
  display: block;
}
.footer-privacy-link {
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--muted);
}
.footer-privacy-link:hover {
  color: var(--accent);
}

/* Privacy policy page */
.privacy-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 0 48px;
}
.privacy-content {
  line-height: 1.65;
  color: var(--text);
}
.privacy-content h2 {
  margin: 28px 0 12px;
  font-size: 1.15rem;
  color: var(--text);
}
.privacy-content p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}
.privacy-content strong {
  color: var(--text);
}
.footer-brand {
  color: var(--text);
  font-size: 0.95rem;
}
.footer-sep {
  color: var(--muted);
  opacity: 0.6;
  flex-shrink: 0;
}
.footer-phones {
  margin: 0;
  font-size: 0.95rem;
  white-space: nowrap;
}
.footer-phones a {
  color: var(--accent);
  font-weight: 600;
  margin: 0 2px;
}
.bot-block {
  background: var(--bg3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  margin: 0;
  white-space: nowrap;
  font-size: 0.9rem;
  color: var(--text);
  flex-shrink: 0;
}
.bot-block a {
  color: var(--accent2);
  font-weight: 600;
}
.footer-contacts-link,
.footer-mobile-link {
  white-space: nowrap;
  flex-shrink: 0;
}
.footer-mobile-link {
  color: var(--accent2);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-mobile-link:hover {
  color: var(--accent);
}

/* Forced mobile version (from footer toggle) */
html.force-mobile body {
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 0 40px rgba(0,0,0,.25);
}
html.force-mobile .container {
  max-width: 100%;
}
html.force-mobile .header-inner {
  flex-wrap: wrap;
}
html.force-mobile .nav {
  width: 100%;
  justify-content: center;
}
html.force-mobile .hero {
  min-height: 220px;
}
html.force-mobile .grid {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
html.force-mobile .footer-line {
  justify-content: center;
  font-size: 0.85rem;
  flex-wrap: wrap;
  white-space: normal;
}
html.force-mobile .cats {
  top: var(--header-height, 96px);
}

/* Payment card */
.card-number {
  font-family: monospace;
  font-size: 1.2rem;
  background: var(--bg3);
  padding: 12px 16px;
  border-radius: 8px;
  letter-spacing: 2px;
  display: inline-block;
  cursor: pointer;
  border: 1px dashed var(--border);
}
.card-number:hover { border-color: var(--accent); }

.section-title {
  font-size: 1.4rem;
  margin: 24px 0 12px;
}

.empty { text-align: center; padding: 48px; color: var(--muted); }

/* Contacts page */
.contacts-page { padding: 16px 0 40px; }
.contacts-intro { color: var(--muted); margin-bottom: 24px; }
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.contact-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.contact-card-wide {
  grid-column: 1 / -1;
}
@media (min-width: 700px) {
  .contact-card-wide {
    grid-column: span 2;
  }
}
.address-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.address-list li:last-child {
  border-bottom: none;
}
.contact-icon { font-size: 1.8rem; margin-bottom: 8px; }
.contact-card h2 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}
.contact-card .sub-title {
  font-size: 0.95rem;
  margin: 16px 0 8px;
  color: var(--muted);
}
.phone-list, .info-list {
  list-style: none;
  padding: 0;
}
.phone-list li { margin-bottom: 8px; }
.phone-list a {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent2);
}
.phone-list a:hover { color: var(--accent); }
.info-list li {
  margin-bottom: 6px;
  color: var(--text);
}
.muted-note {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}
@media (max-width: 600px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; flex-wrap: wrap; gap: 4px; }
  .admin-sidebar a { flex: 1; text-align: center; min-width: 100px; }
  .nav-controls {
    border-left: none;
    padding-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
  .hero {
    min-height: 220px;
  }
  .hero h1 { font-size: 1.5rem; }
  .cats {
    top: var(--header-height, 96px);
  }
  .footer-line {
    font-size: 0.85rem;
    gap: 8px;
    justify-content: center;
    padding: 4px 8px;
    flex-wrap: wrap;
    white-space: normal;
  }
  .bot-block {
    padding: 5px 10px;
    font-size: 0.8rem;
  }
}

/* Telegram login glow text */
.telegram-glow-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: #2AABEE;
  text-shadow:
    0 0 5px rgba(42, 171, 238, 0.8),
    0 0 10px rgba(42, 171, 238, 0.6),
    0 0 20px rgba(42, 171, 238, 0.4),
    0 0 30px rgba(42, 171, 238, 0.3);
  animation: telegram-glow-pulse 2s ease-in-out infinite alternate;
}

a.telegram-login-label {
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
a.telegram-login-label:hover {
  transform: scale(1.03);
  opacity: 0.95;
}
a.telegram-login-label:hover .telegram-glow-text {
  text-shadow:
    0 0 8px rgba(42, 171, 238, 1),
    0 0 16px rgba(42, 171, 238, 0.8),
    0 0 28px rgba(42, 171, 238, 0.5);
}

@keyframes telegram-glow-pulse {
  from {
    text-shadow:
      0 0 5px rgba(42, 171, 238, 0.7),
      0 0 10px rgba(42, 171, 238, 0.5),
      0 0 15px rgba(42, 171, 238, 0.3);
  }
  to {
    text-shadow:
      0 0 8px rgba(42, 171, 238, 1),
      0 0 16px rgba(42, 171, 238, 0.8),
      0 0 24px rgba(42, 171, 238, 0.5),
      0 0 32px rgba(42, 171, 238, 0.3);
  }
}

/* Instagram login glow text */
.instagram-glow-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: #E1306C;
  text-shadow:
    0 0 5px rgba(225, 48, 108, 0.8),
    0 0 10px rgba(225, 48, 108, 0.6),
    0 0 20px rgba(225, 48, 108, 0.4),
    0 0 30px rgba(225, 48, 108, 0.3);
  animation: instagram-glow-pulse 2s ease-in-out infinite alternate;
}

a.instagram-login-label {
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
a.instagram-login-label:hover {
  transform: scale(1.03);
  opacity: 0.95;
}
a.instagram-login-label:hover .instagram-glow-text {
  text-shadow:
    0 0 8px rgba(225, 48, 108, 1),
    0 0 16px rgba(225, 48, 108, 0.8),
    0 0 28px rgba(225, 48, 108, 0.5);
}

@keyframes instagram-glow-pulse {
  from {
    text-shadow:
      0 0 5px rgba(225, 48, 108, 0.7),
      0 0 10px rgba(225, 48, 108, 0.5),
      0 0 15px rgba(225, 48, 108, 0.3);
  }
  to {
    text-shadow:
      0 0 8px rgba(225, 48, 108, 1),
      0 0 16px rgba(225, 48, 108, 0.8),
      0 0 24px rgba(225, 48, 108, 0.5),
      0 0 32px rgba(225, 48, 108, 0.3);
  }
}

/* ===== Vote / Best employee ===== */
.vote-page {
  padding-bottom: 40px;
}
.vote-intro {
  color: var(--muted);
  margin-bottom: 28px;
  max-width: 640px;
  line-height: 1.5;
}
.vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.vote-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}
.vote-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}
.vote-card.voted {
  border-color: var(--accent, #e85d04);
  box-shadow: 0 0 0 2px rgba(232, 93, 4, 0.25);
}
.vote-photo-wrap {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-secondary, #1a1a1a);
  overflow: hidden;
}
.vote-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vote-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  opacity: 0.5;
}
.vote-info {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}
.vote-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}
.vote-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  flex: 1;
}
.vote-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.vote-count {
  font-weight: 600;
  font-size: 0.95rem;
}
.your-vote-badge {
  background: var(--accent, #e85d04);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}
.vote-form {
  margin-top: 10px;
}
.vote-btn {
  width: 100%;
  text-align: center;
  display: inline-block;
  text-decoration: none;
}
.btn-voted {
  opacity: 0.85;
  cursor: default;
}
@media (max-width: 600px) {
  .vote-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Employee rating ===== */
.rating-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px 12px;
  margin-bottom: 32px;
}
.rating-heading {
  margin: 0 0 16px;
  font-size: 1.25rem;
}
.rating-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rating-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg2, rgba(0,0,0,0.15));
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.rating-item.is-leader {
  border-color: rgba(255, 193, 7, 0.55);
  background: linear-gradient(90deg, rgba(255, 193, 7, 0.12), transparent);
}
.rating-item.is-yours {
  border-color: var(--accent, #e85d04);
}
.rating-place {
  width: 36px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}
.rating-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg3, #222);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rating-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rating-body {
  flex: 1;
  min-width: 0;
}
.rating-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.rating-name {
  font-size: 1rem;
}
.leader-badge {
  background: #ffc107;
  color: #222;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}
.rating-bar-wrap {
  height: 8px;
  background: var(--bg3, rgba(255,255,255,0.08));
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 4px;
}
.rating-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent, #e85d04), #ffb703);
  border-radius: 99px;
  min-width: 0;
  transition: width 0.35s ease;
}
.rating-meta {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}
.rating-pct {
  font-weight: 600;
  color: var(--text);
}
.rating-empty {
  color: var(--muted);
  margin: 8px 0 0;
  font-size: 0.9rem;
}

.vote-card {
  position: relative;
}
.vote-rank-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}
.vote-card.leader-card {
  border-color: rgba(255, 193, 7, 0.6);
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2);
}
@media (max-width: 600px) {
  .rating-item {
    gap: 8px;
    padding: 8px;
  }
  .rating-place {
    width: 28px;
    font-size: 1.1rem;
  }
  .rating-avatar {
    width: 36px;
    height: 36px;
  }
}

/* ===== IMPROVEMENTS 2026 ===== */

/* Logo polish */
.logo {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  transition: transform .2s;
}
.logo:hover {
  transform: scale(1.03);
}

/* Better buttons */
.btn {
  border-radius: var(--radius-sm);
  transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(232, 93, 4, 0.25);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(232, 93, 4, 0.35);
}
.btn:active {
  transform: translateY(0);
}
.btn-sm {
  border-radius: 8px;
  box-shadow: none;
}
.btn-outline {
  box-shadow: none;
}
.btn-outline:hover {
  box-shadow: none;
}

/* Card improvements */
.card {
  border-radius: var(--radius);
  transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.card-img {
  height: auto; /* overridden by aspect-ratio */
  position: relative;
  overflow: hidden;
  background: var(--bg3);
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.card:hover .card-img img {
  transform: scale(1.06);
}
.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}
.card-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}
.card .desc {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
  flex: 1;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 8px;
}
.price {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent2);
  white-space: nowrap;
}

/* Discount badge */
.discount-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #e85d04, #f48c06);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  letter-spacing: 0.02em;
}

/* Search bar */
.search-bar {
  display: flex;
  gap: 8px;
  margin: 16px 0 8px;
  max-width: 480px;
}
.search-bar input {
  flex: 1;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.15);
}
.search-bar button {
  border-radius: 999px;
  padding: 10px 18px;
}

/* Floating cart (mobile) */
.floating-cart {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 6px 24px rgba(232, 93, 4, 0.45);
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
}
.floating-cart:hover {
  transform: scale(1.08);
  color: #fff;
  box-shadow: 0 8px 30px rgba(232, 93, 4, 0.55);
}
.floating-cart .fc-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #fff;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
@media (max-width: 768px) {
  .floating-cart {
    display: flex;
  }
  .nav a[href*="cart"] {
    /* keep in nav too */
  }
}

/* Hero enhancements */
.hero {
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0 8px;
}
.hero h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero-content {
  animation: heroBannerIn 0.6s ease-out;
}

/* Section titles */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 28px 0 16px;
  letter-spacing: -0.01em;
  position: relative;
  padding-left: 14px;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  background: linear-gradient(to bottom, var(--accent), var(--accent2));
  border-radius: 2px;
}

/* Better empty state */
.empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
  font-size: 1.1rem;
  background: var(--bg2);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  margin: 24px 0;
}

/* Form polish */
.form-group input, .form-group textarea, .form-group select {
  border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.15);
}
.form-box {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* Flash messages polish */
.flash {
  border-radius: var(--radius-sm);
  animation: flashIn .3s ease;
}
@keyframes flashIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cart badge pulse */
.cart-badge {
  animation: badgePop .3s ease;
}
@keyframes badgePop {
  0% { transform: scale(0.5); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Product page improvements */
.product-page .product-img {
  border-radius: var(--radius);
  overflow: hidden;
}
.product-page .product-img img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

/* Admin polish */
.stat-card {
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Footer */
.footer {
  margin-top: 48px;
  padding: 28px 0;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Focus visible for a11y */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Better cats pills */
.cats a {
  transition: all .2s;
  font-weight: 500;
}
.cats a:hover, .cats a.active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(232, 93, 4, 0.3);
}

/* Grid denser on large screens */
@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
  }
}

/* Loading skeleton for future */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===== Full dark theme support ===== */

/* Form inputs use theme vars */
.form-group input,
.form-group textarea,
.form-group select,
.qty-form input {
  background: var(--input-bg);
  color: var(--text);
  border-color: var(--border);
}

/* Flash */
.flash.success { background: var(--success-bg); color: var(--green); }
.flash.error { background: var(--error-bg); color: var(--red); }

/* Tables in dark */
.table th, .table td {
  border-bottom-color: var(--border);
}
.table tr:hover td {
  background: var(--bg3);
}

/* Auth discount banner - fully theme aware */
.auth-discount-banner {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.12) 0%, rgba(46, 204, 113, 0.05) 100%);
  border: 1px solid rgba(46, 204, 113, 0.35);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(46, 204, 113, 0.08);
}
.auth-discount-banner.applied {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.12) 0%, rgba(52, 152, 219, 0.05) 100%);
  border-color: rgba(52, 152, 219, 0.35);
  box-shadow: 0 4px 20px rgba(52, 152, 219, 0.08);
}
[data-theme="light"] .auth-discount-banner {
  background: linear-gradient(135deg, #e8f8ef 0%, #d4f0e0 100%);
  border-color: #27ae60;
}
[data-theme="light"] .auth-discount-banner.applied {
  background: linear-gradient(135deg, #e8f1f8 0%, #d4e4f0 100%);
  border-color: #2980b9;
}
.auth-discount-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.auth-discount-icon {
  font-size: 2rem;
  line-height: 1;
}
.auth-discount-text {
  flex: 1;
  min-width: 200px;
}
.auth-discount-text strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 4px;
  color: var(--green);
}
.auth-discount-banner.applied .auth-discount-text strong {
  color: #3498db;
}
[data-theme="light"] .auth-discount-text strong {
  color: #27ae60;
}
[data-theme="light"] .auth-discount-banner.applied .auth-discount-text strong {
  color: #2980b9;
}
.auth-discount-text p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.auth-discount-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-accent {
  background: var(--green) !important;
  color: #fff !important;
  border: none;
  box-shadow: 0 2px 10px rgba(46, 204, 113, 0.3);
}
.btn-accent:hover {
  filter: brightness(1.1);
}

/* Modal fully theme-aware */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}
.modal-window {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow);
  animation: slideUp 0.25s ease;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.modal-close:hover {
  color: var(--text);
}

/* Card number copy */
.card-number {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  background: var(--bg3);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: border-color .2s, background .2s;
  color: var(--text);
}
.card-number:hover {
  border-color: var(--accent);
  background: var(--bg2);
}

/* Admin tables and content */
.admin-content table {
  width: 100%;
  border-collapse: collapse;
}
.admin-content th,
.admin-content td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.admin-content th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
}
.admin-content tr:hover td {
  background: var(--bg3);
}

/* Scrollbar for dark theme */
[data-theme="dark"] ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--bg);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--bg3);
  border-radius: 5px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* Selection */
::selection {
  background: rgba(255, 107, 26, 0.35);
  color: #fff;
}
[data-theme="light"] ::selection {
  background: rgba(232, 93, 4, 0.25);
  color: #000;
}

/* Ensure images don't break dark feel */
img {
  max-width: 100%;
}

/* Force mobile class compatibility */
.force-mobile .container {
  max-width: 100%;
}

/* ============================================================
   MOBILE OPTIMIZATION (phones & small tablets)
   ============================================================ */

/* Base mobile tweaks */
@media (max-width: 768px) {
  .container {
    padding: 0 12px;
  }

  /* Header: more compact */
  .header-inner {
    padding: 10px 0;
    gap: 8px;
  }
  .logo {
    font-size: 1.25rem;
  }
  .nav {
    gap: 4px;
  }
  .nav a, .btn {
    padding: 7px 10px;
    font-size: 0.82rem;
  }
  .nav-controls {
    gap: 6px;
  }
  .lang-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
  }
  .theme-toggle {
    width: 36px;
    height: 36px;
  }

  /* Hero */
  .hero {
    min-height: 200px;
    margin: 12px 0 6px;
    border-radius: 12px;
  }
  .hero h1 {
    font-size: clamp(1.35rem, 6vw, 1.8rem);
    margin-bottom: 6px;
  }
  .hero p {
    font-size: 0.9rem;
    margin-bottom: 14px;
  }
  .hero-actions {
    gap: 8px;
  }
  .hero-actions .btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  /* Categories */
  .cats {
    padding: 6px 8px;
    gap: 4px;
    margin-left: -12px;
    margin-right: -12px;
    top: var(--header-height, 52px);
  }
  .cats a {
    padding: 5px 9px;
    font-size: 0.72rem;
  }

  /* Product grid — 2 columns on phones */
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 12px 0 28px;
  }
  .card {
    border-radius: 12px;
  }
  .card-img {
    height: auto;
  }
  .card-body {
    padding: 10px 10px 12px;
    gap: 4px;
  }
  .card-body h3 {
    font-size: 0.9rem;
    line-height: 1.25;
  }
  .card .desc {
    font-size: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .card-footer {
    flex-wrap: wrap;
    gap: 6px;
  }
  .price {
    font-size: 0.95rem;
  }
  .btn-sm {
    padding: 5px 8px;
    font-size: 0.78rem;
    width: 100%;
  }
  .discount-badge {
    top: 6px;
    left: 6px;
    font-size: 0.68rem;
    padding: 3px 7px;
  }

  /* Search */
  .search-bar {
    margin: 12px 0 6px;
    max-width: 100%;
  }
  .search-bar input {
    padding: 9px 14px;
    font-size: 0.9rem;
  }
  .search-bar button {
    padding: 9px 14px;
  }

  /* Section titles */
  .section-title {
    font-size: 1.2rem;
    margin: 18px 0 12px;
    padding-left: 12px;
  }

  /* Product page */
  .product-page {
    margin: 12px 0 32px !important;
    gap: 16px !important;
  }
  .product-page h1 {
    font-size: 1.4rem !important;
  }
  .product-page .price {
    font-size: 1.35rem !important;
  }
  .product-page .btn {
    width: 100%;
    padding: 12px 16px;
  }

  /* Cart & forms */
  .table {
    font-size: 0.85rem;
  }
  .table th, .table td {
    padding: 8px 6px;
  }
  .form-box {
    margin: 20px auto;
    padding: 18px 14px;
  }
  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 11px 12px;
    font-size: 16px; /* prevents iOS zoom on focus */
  }

  /* Checkout grid → single column */
  div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Footer */
  .footer {
    padding: 20px 0;
    margin-top: 32px;
  }
  .footer-line {
    font-size: 0.85rem;
    gap: 6px;
  }

  /* Floating cart position */
  .floating-cart {
    bottom: 18px;
    right: 16px;
    width: 56px;
    height: 56px;
    font-size: 1.35rem;
  }

  /* Empty state */
  .empty {
    padding: 40px 16px;
    font-size: 1rem;
  }

  /* Admin on mobile */
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .admin-sidebar a {
    flex: 1 1 auto;
    text-align: center;
    min-width: 90px;
    padding: 8px 6px;
    font-size: 0.8rem;
    margin-bottom: 0;
  }
  .admin-content {
    padding: 16px 12px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .stat-card {
    padding: 12px 8px;
  }
  .stat-card .num {
    font-size: 1.4rem;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .card-img {
    height: auto;
  }
  .nav a, .btn {
    padding: 6px 8px;
    font-size: 0.78rem;
  }
  .logo {
    font-size: 1.15rem;
  }
  .cats a {
    font-size: 0.68rem;
    padding: 4px 7px;
  }
}

/* Landscape phones */
@media (max-width: 900px) and (orientation: landscape) {
  .hero {
    min-height: 160px;
  }
  .hero h1 {
    font-size: 1.4rem;
  }
  .floating-cart {
    bottom: 12px;
    right: 12px;
    width: 48px;
    height: 48px;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .nav a, .btn, .cats a {
    min-height: 40px;
  }
  .card:hover {
    transform: none; /* disable hover lift on touch */
  }
  .card:active {
    transform: scale(0.98);
  }
  .btn:hover {
    transform: none;
  }
  .btn:active {
    transform: scale(0.97);
  }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
  .header {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
  .floating-cart {
    bottom: max(18px, env(safe-area-inset-bottom) + 12px);
    right: max(16px, env(safe-area-inset-right) + 8px);
  }
  .footer {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}

/* ============================================================
   RESPONSIVE IMAGES
   ============================================================ */

/* Global image defaults */
img {
  max-width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}

/* Prevent layout shift & make images fluid */
img[loading="lazy"] {
  background: var(--bg3);
}

/* Card images — fixed aspect ratio for consistent grid */
.card-img {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto !important;          /* override fixed height */
  min-height: 0;
  overflow: hidden;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
}
.card:hover .card-img img {
  transform: scale(1.06);
}

/* Hero banner */
.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Product detail page */
.product-page .product-img,
.product-img {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 480px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg3);
}
.product-page .product-img img,
.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Employee / avatar images */
.rating-avatar,
.admin-content img[style*="object-fit"],
img[style*="border-radius"] {
  object-fit: cover;
  object-position: center;
}

/* Logo / banner fallbacks */
.logo img,
.footer-payments-img {
  width: auto;
  height: auto;
  max-height: 36px;
  object-fit: contain;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .card-img {
    aspect-ratio: 1 / 1;            /* square on mobile for denser grid */
  }
  .product-page .product-img,
  .product-img {
    aspect-ratio: 4 / 3;
    max-height: 320px;
  }
}

@media (max-width: 380px) {
  .card-img {
    aspect-ratio: 4 / 3;
  }
}

/* High-DPI / retina support helper (for future srcset) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .card-img img,
  .product-img img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Prevent images from overflowing containers */
.card,
.product-page,
.hero,
.admin-content {
  overflow: hidden;
}
