/* ═══════════════════════════════════════════════════════════
   autoShop Деталька — Design System
   Палітра: нейтральний білий фон, акцент #1976D2 (синій),
   успіх #388E3C, попередження #F57C00, небезпека #D32F2F
   Статистично найкраще сприймається для e-commerce:
   чистий білий фон, синій акцент, сірий текст.
   ═══════════════════════════════════════════════════════════ */

/* ── CSS змінні ─────────────────────────────────────────── */
:root {
  --primary:        #1976D2;
  --primary-dark:   #1565C0;
  --primary-light:  #E3F2FD;
  --accent:         #FF6F00;
  --success:        #388E3C;
  --danger:         #D32F2F;
  --warning:        #F57C00;
  --text-main:      #212121;
  --text-secondary: #616161;
  --text-hint:      #9E9E9E;
  --bg-page:        #F5F5F5;
  --bg-card:        #FFFFFF;
  --border:         #E0E0E0;
  --shadow-sm:      0 1px 4px rgba(0,0,0,.08);
  --shadow-md:      0 4px 16px rgba(0,0,0,.12);
  --radius:         10px;
  --radius-lg:      16px;
}

/* ── Reset / Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  background-color: var(--bg-page);
  height: -webkit-fill-available;
  overscroll-behavior: none;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  color: var(--text-main);
  background-color: var(--bg-page);
  background-image: none;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  overscroll-behavior-y: none;
}

body::after {
  content: '';
  display: block;
  height: env(safe-area-inset-bottom, 0px);
}

main { flex: 1; }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  background: var(--primary) !important;
  box-shadow: 0 2px 8px rgba(25,118,210,.3);
  padding: 10px 0;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.4rem;
  color: #fff !important;
  letter-spacing: -.3px;
}

.navbar-brand img {
  height: 38px;
  width: auto;
  margin-right: 10px;
  border-radius: 8px;
  transition: transform .25s;
}
.navbar-brand img:hover { transform: scale(1.08); }

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255,255,255,.88);
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  transition: background .2s, color .2s;
}
.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.15);
}

.navbar .form-control {
  border-radius: 20px 0 0 20px;
  border: none;
  background: rgba(255,255,255,.15);
  color: #fff;
  padding: 6px 16px;
}
.navbar .form-control::placeholder { color: rgba(255,255,255,.65); }
.navbar .form-control:focus {
  background: rgba(255,255,255,.25);
  box-shadow: none;
  color: #fff;
}

/* ── Кнопки ─────────────────────────────────────────────── */
.btn {
  font-weight: 500;
  border-radius: 8px;
  transition: all .2s;
  letter-spacing: .01em;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}
.btn-primary:hover {
  background: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
}

.btn-outline-primary {
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}
.btn-outline-primary:hover {
  background: var(--primary) !important;
  color: #fff !important;
}

.btn-success  { background: var(--success) !important; border-color: var(--success) !important; }
.btn-danger   { background: var(--danger)  !important; border-color: var(--danger)  !important; }
.btn-warning  { background: var(--warning) !important; border-color: var(--warning) !important; color:#fff!important; }

/* ── Картки (загальні) ───────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  animation: fadeIn .4s ease-out both;
}

/* ── Product cards ───────────────────────────────────────── */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: box-shadow .25s, transform .25s;
  position: relative;
  border: 1px solid var(--border);
}
.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.product-img-wrap {
  display: block;
  overflow: hidden;
  aspect-ratio: 1/1;
  background: #FAFAFA;
  position: relative;
}
.product-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.product-card:hover .product-img-wrap img { transform: scale(1.05); }

.badge-out, .badge-sale {
  position: absolute;
  top: 8px; left: 8px;
  font-size: .65rem;
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 700;
  z-index: 1;
  letter-spacing: .02em;
}
.badge-out  { background: var(--danger);  color: #fff; }
.badge-sale { background: var(--accent);  color: #fff; }

.product-info {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.product-name {
  font-size: .84rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  min-height: 2.25em;
  transition: color .15s;
}
.product-name:hover { color: var(--primary); }

.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.product-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}
.product-old-price {
  font-size: .75rem;
  color: var(--text-hint);
  text-decoration: line-through;
}

.btn-cart {
  width: 100%;
  padding: 8px 4px;
  font-size: .82rem;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  transition: background .2s;
  margin-top: auto;
  letter-spacing: .01em;
}
.btn-cart:hover:not(:disabled) { background: var(--primary-dark); }
.btn-cart:disabled { background: #BDBDBD; cursor: not-allowed; }

/* Вибране */
.wishlist-form { position: absolute; top: 8px; right: 8px; z-index: 2; }
.wishlist-btn {
  background: rgba(255,255,255,.92);
  border: none;
  border-radius: 50%;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  cursor: pointer;
  color: #BDBDBD;
  transition: color .2s, background .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.wishlist-btn:hover,
.wishlist-btn.active { color: var(--danger); }

/* ── Category cards ──────────────────────────────────────── */
.cat-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  transition: box-shadow .25s, transform .25s;
  height: 100%;
}
.cat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  color: inherit;
}
.cat-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--primary-light);
}
.cat-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.cat-card:hover .cat-img img { transform: scale(1.07); }
.cat-no-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
}
.cat-info { padding: 10px 12px 12px; }
.cat-name {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 3px;
}
.cat-count { font-size: .75rem; color: var(--text-hint); }

/* ── Форми ───────────────────────────────────────────────── */
.form-control, .form-select {
  border-color: var(--border);
  border-radius: 8px;
  color: var(--text-main);
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25,118,210,.15);
}
.form-label { font-weight: 500; color: var(--text-secondary); font-size: .88rem; }

/* ── Таблиці ─────────────────────────────────────────────── */
.table { font-size: .9rem; color: var(--text-main); }
.table th {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
  border-bottom: 2px solid var(--primary);
  white-space: nowrap;
}
.table-striped tbody tr:nth-of-type(odd) { background: #FAFAFA; }
.table-hover tbody tr:hover { background: var(--primary-light); }
.table-responsive { border-radius: var(--radius); border: 1px solid var(--border); }

/* ── Бейджі ──────────────────────────────────────────────── */
.badge { font-size: .78rem; padding: .4em .7em; border-radius: 20px; font-weight: 600; }

/* Статуси замовлень */
.status-new        { background: #E3F2FD; color: #1565C0; }
.status-processing { background: #FFF8E1; color: #E65100; }
.status-shipped    { background: #E8F5E9; color: #2E7D32; }
.status-delivered  { background: #E8F5E9; color: #1B5E20; }
.status-cancelled  { background: #FFEBEE; color: #B71C1C; }

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .6rem 1rem;
  font-size: .85rem;
}
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-hint); }
.breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }

/* ── Jumbotron / Hero ────────────────────────────────────── */
.jumbotron {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
  border-radius: var(--radius-lg);
  color: #fff;
  padding: 3rem 2.5rem;
  border: none;
}
.jumbotron * { background: transparent !important; color: inherit; }
.jumbotron .btn-outline-light {
  border-color: rgba(255,255,255,.7);
  color: #fff;
}
.jumbotron .btn-outline-light:hover {
  background: rgba(255,255,255,.15) !important;
}

/* ── Адмін панель ────────────────────────────────────────── */
.admin-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  min-height: 100vh;
  padding: 1.5rem 1rem;
}
.admin-card { border-left: 4px solid; border-radius: var(--radius); }
.admin-card.primary { border-color: var(--primary); }
.admin-card.success { border-color: var(--success); }
.admin-card.warning { border-color: var(--warning); }
.admin-card.info    { border-color: #0288D1; }

/* ── Пошук — підказки ────────────────────────────────────── */
#search-hints { border-radius: 0 0 10px 10px; border: 1px solid var(--border); }
.hint-item {
  padding: 10px 14px;
  font-size: .88rem;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.hint-item:last-child { border-bottom: none; }
.hint-item:hover { background: var(--primary-light) !important; }

/* ── Фільтри ─────────────────────────────────────────────── */
.filter-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  position: sticky;
  top: 16px;
}
.filter-panel .form-label { font-size: .82rem; font-weight: 600; color: var(--text-secondary); }

/* ── Алерти ──────────────────────────────────────────────── */
.alert { border-radius: 10px; border: none; font-size: .9rem; }
.alert-success { background: #E8F5E9; color: #2E7D32; }
.alert-danger  { background: #FFEBEE; color: #C62828; }
.alert-info    { background: #E3F2FD; color: #1565C0; }
.alert-warning { background: #FFF8E1; color: #E65100; }

/* ── Модальні вікна ──────────────────────────────────────── */
.modal-content {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal-header { border-bottom: 1px solid var(--border); background: var(--primary-light); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.modal-title  { color: var(--primary-dark); font-weight: 700; }

/* ── Скролбар ────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 8px; }
::-webkit-scrollbar-track { background: #F5F5F5; }
::-webkit-scrollbar-thumb { background: #BDBDBD; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9E9E9E; }

/* ── Анімації ────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animated { animation-duration: .4s; animation-fill-mode: both; }
.fadeIn   { animation-name: fadeIn; }

/* ── Мобільний bottom nav ────────────────────────────────── */
.mobile-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1050;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; align-items: center;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
}
.mob-nav-item {
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none; color: var(--text-hint);
  font-size: .6rem; gap: 2px;
  position: relative; flex: 1; padding: 2px 0;
  transition: color .2s;
}
.mob-nav-item i { font-size: 1.15rem; }
.mob-nav-item.active { color: var(--primary); }
.mob-nav-item:hover  { color: var(--primary); }
.mob-badge {
  position: absolute; top: -4px; right: calc(50% - 18px);
  background: var(--danger); color: #fff;
  font-size: .55rem; border-radius: 10px;
  padding: 1px 5px; font-weight: 700;
  min-width: 16px; text-align: center;
}

body { padding-bottom: 70px; }
@media (min-width: 768px) {
  .mobile-bottom-nav { display: none !important; }
  body { padding-bottom: 0; }
}

/* ── Кошик ───────────────────────────────────────────────── */
.cart-item { border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: none; }

/* ── Адаптивність ────────────────────────────────────────── */
@media (max-width: 576px) {
  .product-name  { font-size: .76rem; }
  .product-price { font-size: .92rem; }
  .btn-cart      { font-size: .72rem; padding: 5px 3px; }
  .jumbotron     { padding: 1.8rem 1.2rem; }
  .jumbotron h1  { font-size: 1.6rem; }
}

/* ── Друк ────────────────────────────────────────────────── */
@media print {
  .navbar, footer, .mobile-bottom-nav, .btn { display: none !important; }
  body { padding-bottom: 0; }
}

/* ── Sticky сайдбар кошика ── */
@media (min-width: 768px) {
    .cart-sticky { position: sticky; top: 80px; }
}

/* ── Промокод ── */
.promo-success { background: #E8F5E9; border-radius: 8px; }

/* ── Лічильник залишку ── */
.stock-warning { animation: pulse .8s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity:.7; } to { opacity:1; } }

/* ── Адмін-бекап кнопка ── */
.btn-backup { background: #2E7D32; color: #fff; border: none; }
.btn-backup:hover { background: #1B5E20; color: #fff; }

/* ════════════════════════════════════════════════
   Сторінка "Про нас" + Футер
   ════════════════════════════════════════════════ */

/* Герой */
.about-hero {
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 60%, #1A237E 100%);
    min-height: 260px;
}

/* Картки напрямків */
.direction-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s;
}
.direction-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

/* Іконка напрямку */
.dir-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
}

/* Картки переваг */
.benefit-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

/* Іконка контакту */
.contact-icon {
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
}

/* Статистика */
.stat-card {
    background: #EFF6FF;
    border-radius: var(--radius);
    padding: 1rem .75rem;
    text-align: center;
}
.stat-num {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}

/* CTA блок */
.cta-about {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
}

/* Футер */
footer.site-footer {
    background: #1A237E !important;
    color: rgba(255,255,255,.85);
}
.footer-heading {
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: .75rem;
}
.footer-link {
    color: rgba(255,255,255,.7);
    text-decoration: none;
    transition: color .2s;
    display: flex; align-items: center; gap: 8px;
}
.footer-link:hover { color: #fff; }
.footer-icon { width: 14px; flex-shrink: 0; text-align: center; }
.social-btn {
    width: 38px; height: 38px; border-radius: 10px;
    background: rgba(255,255,255,.12);
    display: flex; align-items: center; justify-content: center;
    color: #fff; text-decoration: none;
    transition: background .2s;
}
.social-btn:hover { background: rgba(255,255,255,.25); color: #fff; }

/* ── Статус "Під замовлення" ── */
.badge-on-order {
    position: absolute; top: 7px; left: 7px;
    background: #1565C0; color: #fff;
    font-size: .65rem; font-weight: 700;
    padding: 2px 8px; border-radius: 20px;
}
