/* === Базовая обёртка === */
:root {
  --radius: 12px;
  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
  --transition: 0.2s ease;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  background: linear-gradient(135deg, #f5faff, #e8f3ff);
  color: #1f2d3a;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* Контейнер */
.container {
  width: 100%;
  max-width: 1200px;
  padding: 1rem;
  margin: 0 auto;
}

/* === Навигация === */
.navbar {
  position: sticky;
  top: 0;
  z-index: 3000; /* выше карточек/прочих контекстов */
  background: rgba(255 255 255 / 0.85) !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background var(--transition);
}
.navbar-brand,
.navbar .nav-link {
  color: #444 !important;
  font-weight: 500;
}
.navbar .nav-link.active {
  color: #0052d4 !important;
  text-decoration: underline;
}
.dropdown-menu {
  z-index: 3050; /* ещё выше для выпадающих списков */
}

/* === Карточки и таблицы === */
.card,
.table {
  background: rgba(255 255 255 / 0.85);
  backdrop-filter: blur(12px);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Таблицы */
.table thead th {
  border-bottom: 2px solid rgba(0,0,0,0.1);
}
.table tbody tr:not(:last-child) {
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* === Кнопки === */
.btn {
  border: none !important;
  border-radius: 8px !important;
  font-weight: 500;
  transition: all var(--transition);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.btn-primary {
  background: linear-gradient(45deg, #0052d4, #4364f7, #6fb1fc);
  color: #fff;
}
.btn-danger {
  background: linear-gradient(45deg, #d32f2f, #e53935, #f44336);
  color: #fff;
}
.btn-outline-secondary {
  border: 1px solid #6c757d !important;
  color: #6c757d;
  background: transparent;
}

/* === Формы === */
.form-control,
.form-select {
  border-radius: 6px !important;
  border: 1px solid rgba(0,0,0,0.1) !important;
  background-color: rgba(255 255 255 / 0.85) !important;
  box-shadow: none !important;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.25rem rgba(0,82,212,0.25);
  border-color: #0052d4 !important;
}

/* === Пагинация === */
.pagination .page-item .page-link {
  border-radius: 50% !important;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.pagination .page-item.active .page-link {
  background-color: #0052d4;
  border-color: #0052d4;
  color: #fff;
}

/* === Футер === */
footer {
  background: rgba(255 255 255 / 0.85);
  backdrop-filter: blur(12px);
  color: #444;
  border-top: 1px solid rgba(0,0,0,0.05);
  position: relative; /* чтобы не фиксировался */
  width: 100%;
  margin-top: auto;
}
footer a {
  color: inherit;
  text-decoration: none;
}
footer .container {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* === Пагинация: круглая, читаемая, адаптивная === */
.pagination-wrapper {
  overflow-x: auto;
  padding: 0.5rem 0;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pagination .page-item {
  display: block;
}

.pagination .page-link {
  border-radius: 999px;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  color: #0052d4;
  position: relative;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s, color 0.2s;
  cursor: pointer;
}

.pagination .page-item:not(.active) .page-link:hover {
  background: rgba(0, 82, 212, 0.08);
}

.pagination .page-item.active .page-link {
  background-color: #0052d4;
  border-color: #0052d4;
  color: #fff;
  font-weight: 600;
}

.pagination .page-item.disabled .page-link {
  opacity: 0.5;
  pointer-events: none;
  background: #f0f4fa;
  border-color: rgba(0,0,0,0.04);
}

@media (max-width: 576px) {
  #cart-table thead { display: none; }
  #cart-table tbody tr {
    display: block;
    border: 1px solid rgba(0,0,0,.1);
    border-radius: .5rem;
    padding: .75rem;
    margin-bottom: .75rem;
  }
  #cart-table tbody td {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .35rem 0 !important;
    border: none !important;
  }
  #cart-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6c757d;
  }
  #cart-table .input-group.input-group-sm { width: 100%; }
  #cart-table .cart-qty { max-width: 110px; }
  #cart-card { padding: .5rem !important; }
}