@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Основные цвета */
  --primary-light: #F4F1EC;
  --primary-gray: #DCDAD6;
  --primary-dark: #3A3A3A;
  
  /* Акценты */
  --accent-olive: #8E9277;
  --accent-sand: #C7B79A;
  
  /* Контраст */
  --deep-walnut: #5E4B3B;
  
  /* Фоновые */
  --background-soft: #FAF9F7;
  --divider-light: #E6E3DF;
  --site-dots-duration: 18s;
}

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

html {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--primary-dark);
  background-color: var(--background-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

@keyframes dot-shimmer-wave {
  0% {
    -webkit-mask-position: 0% 0%;
    mask-position: 0% 0%;
  }
  100% {
    -webkit-mask-position: 100% 100%;
    mask-position: 100% 100%;
  }
}

body.site-bg-dots::before,
body.site-bg-dots::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(94, 75, 59, 0.22) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
}

body.site-bg-dots::before {
  opacity: 0.35;
}

body.site-bg-dots::after {
  -webkit-mask-image: linear-gradient(
    135deg,
    transparent 0%,
    transparent 36%,
    rgba(0, 0, 0, 0.45) 44%,
    #000 50%,
    rgba(0, 0, 0, 0.45) 56%,
    transparent 64%,
    transparent 100%
  );
  mask-image: linear-gradient(
    135deg,
    transparent 0%,
    transparent 36%,
    rgba(0, 0, 0, 0.45) 44%,
    #000 50%,
    rgba(0, 0, 0, 0.45) 56%,
    transparent 64%,
    transparent 100%
  );
  -webkit-mask-size: 280% 280%;
  mask-size: 280% 280%;
  animation: dot-shimmer-wave var(--site-dots-duration) linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  body.site-bg-dots::after {
    animation: none;
    -webkit-mask-image: none;
    mask-image: none;
    opacity: 0.65;
  }
}

body.site-bg-dots main,
body.site-bg-dots footer {
  position: relative;
  z-index: 1;
}

body.site-bg-dots header {
  /* Не опускати header під контент — інакше мобільне меню ховається */
  position: sticky;
  z-index: 10000;
}

/* Внутренние страницы — без отдельной подложки, виден общий фон */
.page-shell {
  min-height: calc(100vh - 5rem);
  padding: 1.25rem 0 3.5rem;
  background: transparent;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
}

h1 {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.3;
}

h3 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.4;
}

h4 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
}

h5 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.5;
}

h6 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
}

p {
  font-size: 1rem;
  line-height: 1.6;
}

/* Form elements */
input, textarea, select, button {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
}

input, textarea {
  line-height: 1.6;
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  h3 {
    font-size: 1.5rem;
  }
}

/* Utility classes */
.shadow-soft {
  box-shadow: 0 4px 16px rgba(94, 75, 59, 0.08);
}

.shadow-soft-hover {
  box-shadow: 0 6px 24px rgba(94, 75, 59, 0.12);
}

.rounded-soft {
  border-radius: 16px;
}

.rounded-soft-lg {
  border-radius: 24px;
}

.rounded-soft-sm {
  border-radius: 12px;
}

/* Links */
a {
  color: var(--accent-olive);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--deep-walnut);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 16px;
  font-weight: 500;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--accent-olive);
  color: white;
}

.btn-primary:hover {
  background-color: var(--deep-walnut);
  color: white;
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-dark);
  border: 2px solid var(--primary-dark);
}

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

/* Компактні контролі: кількість, іконки — завжди з читабельним контрастом */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1.5px solid rgba(94, 75, 59, 0.35);
  background: #fff;
  color: var(--deep-walnut);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s;
  flex-shrink: 0;
}

.qty-btn svg {
  stroke: currentColor;
  stroke-width: 2.5;
}

.qty-btn:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--deep-walnut);
  color: var(--primary-dark);
}

.qty-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f3f1ec;
  border-color: rgba(94, 75, 59, 0.18);
  color: rgba(94, 75, 59, 0.45);
}

.qty-value {
  min-width: 2rem;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary-dark);
  line-height: 1;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1.5px solid rgba(94, 75, 59, 0.28);
  background: #fff;
  color: var(--deep-walnut);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.icon-btn svg {
  stroke: currentColor;
}

.icon-btn:hover {
  background: var(--primary-light);
  border-color: var(--deep-walnut);
  color: var(--primary-dark);
}

.icon-btn-danger {
  color: var(--deep-walnut);
}

.icon-btn-danger:hover {
  color: #b42318;
  border-color: #f0b4ae;
  background: #fff5f4;
}

.icon-btn-round {
  border-radius: 50%;
  border: 1.5px solid rgba(94, 75, 59, 0.22);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(58, 58, 58, 0.12);
}

.icon-btn-round:hover {
  background: #fff;
  border-color: var(--accent-olive);
  transform: scale(1.06);
}

/* Картка товару: кнопка в одному рівні + легкий lift */
.product-card {
  display: flex !important;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-3px);
}

.product-card__media {
  flex-shrink: 0;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 0.875rem;
  min-height: 0;
}

.product-card__title {
  color: var(--primary-dark);
  margin: 0 0 0.375rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.875rem;
  line-height: 1.4;
  font-weight: 600;
  min-height: calc(1.4em * 2);
}

.product-card__price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  min-height: 1.5rem;
}

.product-card__action {
  margin-top: auto;
}

.products-grid-catalog,
.grid-responsive-3,
.grid-responsive-4 {
  align-items: stretch;
}

@media (min-width: 1024px) {
  .product-card__body {
    padding: 1.25rem;
  }

  .product-card__title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .product-card__action .btn {
    padding: 0.75rem !important;
    font-size: 0.875rem !important;
  }
}

/* Cards — читабельні на світлому фоні сайту */
.card {
  background:
    linear-gradient(180deg, #ffffff 0%, #f6f3ed 100%);
  border-radius: 24px;
  border: 1.5px solid rgba(94, 75, 59, 0.18);
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 2px 4px rgba(94, 75, 59, 0.04),
    0 14px 32px rgba(94, 75, 59, 0.1);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

/* Allow dropdowns to overflow in checkout form */
.card.checkout-card {
  overflow: visible;
}

.card:hover {
  border-color: rgba(142, 146, 119, 0.45);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 1) inset,
    0 4px 8px rgba(94, 75, 59, 0.06),
    0 18px 40px rgba(94, 75, 59, 0.12);
}

/* Форми / статичні блоки — без «стрибка» при hover */
.card.card-static:hover,
.checkout-card:hover,
.cart-summary-card:hover,
.contact-form-block:hover,
.filters-sidebar > .card:hover {
  transform: none;
}

/* Акцентний блок (підсумок, фільтри) */
.card-accent {
  border-color: rgba(142, 146, 119, 0.42);
  background:
    linear-gradient(165deg, #ffffff 0%, #f3f1e9 48%, #ebe8df 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 0 0 1px rgba(142, 146, 119, 0.08),
    0 4px 10px rgba(94, 75, 59, 0.05),
    0 18px 40px rgba(94, 75, 59, 0.12);
}

.card-accent:hover {
  border-color: rgba(142, 146, 119, 0.55);
  transform: none;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* Grid */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .grid-cols-sm-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .grid-cols-lg-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  
  .grid-cols-lg-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Flex */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

/* Spacing */
.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.mb-12 {
  margin-bottom: 3rem;
}

.p-4 {
  padding: 1rem;
}

.p-5 {
  padding: 1.25rem;
}

.p-6 {
  padding: 1.5rem;
}

.py-8 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.py-12 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.py-16 {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

/* Text */
.text-center {
  text-align: center;
}

.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

/* Colors */
.text-primary-dark {
  color: var(--primary-dark);
}

.text-deep-walnut {
  color: var(--deep-walnut);
}

.text-accent-olive {
  color: var(--accent-olive);
}

.text-gray {
  color: var(--primary-gray);
}

/* Image */
img {
  max-width: 100%;
  height: auto;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
}

.badge-new {
  background-color: var(--accent-olive);
  color: white;
}

.badge-sale {
  background-color: var(--accent-sand);
  color: white;
}

/* Aspect ratio */
.aspect-square {
  aspect-ratio: 1 / 1;
}

.aspect-4-3 {
  aspect-ratio: 4 / 3;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 10000;
  background-color: var(--background-soft);
  border-bottom: 1px solid var(--divider-light);
}

.mobile-menu {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  max-height: min(70vh, calc(100dvh - 5rem));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 10001;
  background-color: #fff;
  box-shadow: 0 12px 28px rgba(58, 58, 58, 0.12);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
}

