:root {
  --brand-ink: #1f2937;
  --brand-muted: #667085;
  --brand-surface: #fffdf8;
  --brand-surface-2: #fff4e6;
  --brand-surface-3: #eef6f5;
  --brand-line: rgba(31, 41, 55, 0.09);
  --brand-primary: #e76f51;
  --brand-primary-deep: #cf5d41;
  --brand-secondary: #2a9d8f;
  --brand-secondary-deep: #207c71;
  --brand-accent: #f4a261;
  --brand-shadow: 0 20px 50px rgba(31, 41, 55, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  color: var(--brand-ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(244, 162, 97, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(42, 157, 143, 0.12), transparent 28%),
    linear-gradient(180deg, #fffdf8 0%, #fff7ee 52%, #ffffff 100%);
}

.loader {
  width: 48px;
  height: 48px;
  border: 5px solid #fff;
  border-bottom-color: var(--brand-primary);
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}

@keyframes rotation {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes cardGlow {
  0%, 100% { opacity: .3; transform: scale(1); }
  50% { opacity: .6; transform: scale(1.08); }
}

input[type="text"],
textarea {
  outline: none;
  border: none;
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.9);
}

.navbar {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(255, 252, 247, 0.82) !important;
  border-bottom: 1px solid rgba(231, 111, 81, 0.12);
  box-shadow: 0 10px 30px rgba(31, 41, 55, 0.05);
}

.navbar-brand,
.nav-link {
  color: var(--brand-ink) !important;
}

.navbar-brand {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.nav-link {
  position: relative;
  font-weight: 600;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.35rem;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .25s ease;
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 18px 12px 24px;
}

@media (max-width: 400px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}

.product-card {
  position: relative;
  isolation: isolate;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 249, 241, 0.98) 100%);
  border: 1px solid var(--brand-line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--brand-shadow);
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
  display: flex;
  flex-direction: column;
}

.product-card::before {
  content: "";
  position: absolute;
  inset: auto -20% 58% auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(42, 157, 143, 0.22) 0%, rgba(42, 157, 143, 0) 72%);
  animation: cardGlow 6s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 26px 52px rgba(31, 41, 55, 0.16);
  border-color: rgba(231, 111, 81, 0.24);
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: linear-gradient(135deg, var(--brand-surface-3), var(--brand-surface-2));
  display: block;
  transition: transform .45s ease;
}

.product-card:hover .product-image {
  transform: scale(1.045);
}

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

.product-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--brand-ink);
  line-height: 1.5;
  height: 3em;
  overflow: hidden;
}

.product-category {
  font-size: 0.78rem;
  color: var(--brand-muted);
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.product-price {
  font-size: 0.9rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand-secondary), var(--brand-secondary-deep)) !important;
  border-radius: 14px !important;
  padding: 0.65rem 0.75rem !important;
  box-shadow: 0 10px 18px rgba(42, 157, 143, 0.2);
}

.product-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.btn {
  border: none;
  border-radius: 999px;
  font-weight: 700;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(31, 41, 55, 0.14);
}

.btn-warning {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
}

.btn-warning:hover,
.btn-warning:focus-visible {
  color: #fff;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-secondary), var(--brand-secondary-deep));
}

.btn-danger {
  background: linear-gradient(135deg, #d15b4a, #b9382b);
}

.btn-outline-secondary {
  border: 1px solid rgba(31, 41, 55, 0.18);
  color: var(--brand-ink);
  background: rgba(255, 255, 255, 0.72);
}

.btn-add,
.btn-remove,
.product-actions .btn {
  width: 100%;
  padding: 0.55rem 0.8rem;
  min-height: 38px;
  font-size: 0.82rem;
  line-height: 1.15;
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.search-input {
  width: min(80%, 560px);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: #fff;
  box-shadow: 0 18px 34px rgba(231, 111, 81, 0.2);
}

.search-input::placeholder {
  color: #fff;
}

.filters {
  max-height: 90vh;
  position: sticky;
  top: 10px;
  z-index: 1030;
  padding: 12px;
  transition: transform .5s ease;
  gap: 12px;
  background: rgba(30, 41, 59, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 22px 38px rgba(15, 23, 42, 0.2);
  border-radius: 24px !important;
}

.filters > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filters-title {
  font-weight: 700;
}

.filter-section {
  display: block !important;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.filter-section-title {
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  text-transform: capitalize;
  cursor: pointer;
}

.category-checkbox {
  accent-color: var(--brand-accent);
}

.filters-close {
  line-height: 1;
}

.cart-wrapper {
  right: 10px;
  top: 100px;
  z-index: 33;
}

.cart-wrapper > div {
  position: relative;
  width: fit-content;
}

#productNum {
  position: absolute;
  right: -10px;
  top: -6px;
  width: 22px;
  height: 22px;
  font-size: 0.72rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ff6b57, #d63f2e) !important;
  box-shadow: 0 8px 16px rgba(214, 63, 46, 0.35);
}

.offcanvas,
footer.bg-dark {
  background: #17212f !important;
}

.offcanvas {
  color: #f9fafb;
}

.total-price {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 0.95rem 1rem;
}

#up {
  background: linear-gradient(135deg, var(--brand-ink), #344054) !important;
  border: none;
}

@media (max-width: 900px) {
  .filters {
    position: fixed;
    top: 10px;
    left: 0;
    height: 90vh;
    width: 260px;
    transform: translateX(-100%);
    display: block;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .filters.is-open {
    transform: translateX(0%);
  }

  .filters .filters-close {
    position: absolute;
    top: 8px;
    right: 8px;
  }
}

@media (max-width: 576px) {
  .products-grid {
    gap: 16px;
    padding-inline: 8px;
  }

  .product-body {
    padding: 12px;
  }

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