
:root{
  --bg: #fafafa;
  --text: #111;
  --muted: #6b7280;
  --accent: #0E2A47; /* темно-синий баннер */
  --accent-2: #1b3d5a;
  --accent-cta: #39b29b;
  --container: 1200px;
  --radius: 10px;
}

*{box-sizing:border-box}
html,body{height:100%; margin:0; font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; color:var(--text); background:var(--bg); -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;}

.container{max-width:var(--container); margin:0 auto; padding:0 20px;}

/* HEADER */
.site-header{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  background:#fff;
  box-shadow:0 2px 10px rgba(16,24,40,0.06);
  z-index:1200;
}

.header-inner{
  display:flex;
  align-items:center;
  gap:20px;
  height:60px;
  justify-content:space-between;
}

/* burger */
.burger{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:transparent;
  border:none;
  font-size:22px;
  cursor:pointer;
  width:44px;
  height:44px;
}

/* logo */
.logo{display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--text); font-weight:700}
.logo img{width:auto; height: 35px}
.logo-text{font-size:16px; letter-spacing:0.2px}

/* top nav */
.top-nav{display:flex; gap:18px; align-items:center}
.top-nav a{color:var(--muted); text-decoration:none; font-size:14px; padding:8px 6px}
.top-nav a:hover{color:var(--text)}

/* header actions */
.header-actions{display:flex; gap:12px; align-items:center}
.search{padding:8px 12px; border-radius:8px; border:1px solid #e6e6e6; min-width:220px}
.user{font-size:18px; text-decoration:none}
.cart-icon{background:transparent; border:none; font-size:18px; cursor:pointer}

/* Sidebar */
.sidebar{position:fixed; top:0; left:0; width:320px; max-width:85vw; height:100%; background:var(--accent); color:#fff; transform:translateX(-110%); transition:transform .28s cubic-bezier(.4,0,.2,1); z-index:1300; padding-top:80px}
.sidebar.active{transform:translateX(0)}
.close-sidebar{position:absolute; top:14px; right:14px; background:transparent; border:none; color:#fff; font-size:18px; cursor:pointer}
.sidebar-inner{padding:18px}
.sidebar-list{list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:6px}
.sidebar-list a{color:#ecf2f6; text-decoration:none; padding:12px 14px; display:block; border-radius:8px}
.sidebar-list a:hover{background:rgba(255,255,255,0.06)}

/* Overlay */
.sidebar-overlay{display:none}
.sidebar-overlay.active{display:block; position:fixed; inset:0; background:rgba(0,0,0,0.45); z-index:1250}

/* MAIN spacing */
.main{padding-top:92px; padding-bottom:60px}

/* HERO */
.hero{
  display:grid;
  grid-template-columns: 1fr 540px;
  /*gap:40px;
  align-items:center;*/
  margin:36px 0;
  background:linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 6px 30px rgba(14,42,71,0.06);
  height:420px;
}

.hero-left{padding:56px 60px 56px 60px; background:var(--accent); color:#fff; display:flex; flex-direction:column; justify-content:center; gap:18px}
.hero-pretitle{opacity:0.9; font-weight:400; font-size:14px}
.hero-title{font-size:42px; margin:0; line-height:1.02; font-weight:700}
.hero-desc{color:rgba(255,255,255,0.9); margin:0; max-width:420px}
.hero-cta .btn-primary{background:var(--accent-cta); color:#fff; border:none; padding:12px 24px; border-radius:8px; display:inline-block; font-weight:600; text-decoration:none}
.hero-cta .btn-primary:hover{opacity:0.95}

.hero-right{display:flex; align-items:center; justify-content:center; background:linear-gradient(90deg, rgba(255,255,255,1) 0%, rgba(245,248,250,1) 100%)}
.hero-image{width:100%; height:100%; object-fit:cover; display:block;}

/* CATEGORIES */
.categories{margin:44px 0}
.categories-grid{
  display:grid;
grid-template-columns: repeat(3, 1fr);
  gap:22px;
}
.category-card{display:block; text-decoration:none; color:var(--text); border-radius:12px; overflow:hidden; background:#fff; box-shadow:0 4px 18px rgba(16,24,40,0.04); transition:transform .18s, box-shadow .18s}
.category-card:hover{transform:translateY(-6px); box-shadow:0 10px 30px rgba(16,24,40,0.08)}
.category-card-media{height:140px; overflow:hidden}
.category-card-media img{width:100%; height:100%; object-fit:cover; display:block}
.category-card-title{padding:12px 14px; font-weight:600; text-align:center; text-transform:uppercase; letter-spacing:0.6px; font-size:14px}

/* SECTION */
.section{margin:40px 0}
.section-title{font-size:20px; text-align:center; margin:0 0 22px 0; color:var(--accent-2); font-weight:600}

/* PRODUCTS GRID */
.products-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:22px;
}
.products-grid--compact{grid-template-columns: repeat(4, 1fr);}

.product-card{
  background:#fff;
  border-radius:12px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  box-shadow:0 6px 18px rgba(16,24,40,0.04);
  transition:transform .16s, box-shadow .16s;
}
.product-card:hover{transform:translateY(-6px); box-shadow:0 12px 28px rgba(16,24,40,0.08)}
.product-card-link{display:block; color:inherit; text-decoration:none; height:100%}

.product-media{width:100%; padding-top:80%; position:relative; overflow:hidden; background:#fbfbfb}
.product-media img{position:absolute; inset:0; width:100%; height:100%; object-fit:cover}

.product-body{padding:14px 14px 18px 14px; display:flex; flex-direction:column; gap:8px; min-height:150px}
.product-title{font-size:15px; margin:0; font-weight:600}
.product-desc{font-size:13px; color:var(--muted); margin:0; flex:1; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical}
.product-footer{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:8px}
.price{font-weight:600; color:var(--accent-2)}
.btn{display:inline-flex; align-items:center; justify-content:center; padding:8px 14px; border-radius:8px; cursor:pointer; font-weight:600; border:1px solid transparent}
.btn-outline{background:transparent; border:1px solid #e6e6e6}
.add-btn{font-size:13px}

/* NO PRODUCTS */
.no-products{color:var(--muted); text-align:center; padding:30px 0}

/* CART POPUP (placeholder styles, cart.js рендерит содержимое) */
.cart-popup{position:fixed; right:20px; bottom:20px; z-index:1400}

/* RESPONSIVE */
@media (max-width: 1100px){
  .products-grid{grid-template-columns: repeat(3, 1fr)}
  .products-grid--compact{grid-template-columns: repeat(3, 1fr)}
  .hero{grid-template-columns:1fr 420px}
}
@media (max-width: 820px){
  .top-nav{display:none}
  .search{min-width:120px; max-width: 120px;}
  .hero{grid-template-columns:1fr; height:auto}
  .hero-left{padding:28px}
  .hero-right{padding:18px}
  .hero-image{max-height:320px; object-position:center 10%}
  .categories-grid{grid-template-columns: repeat(2, 1fr)}
  .products-grid{grid-template-columns: repeat(2, 1fr)}
  .products-grid--compact{grid-template-columns: repeat(2, 1fr)}
}
@media (max-width: 480px){
  .header-inner{height:64px}
  .container{padding:0 14px}
  .logo img{height:30px}
  .hero-left{padding:20px}
  .hero-title{font-size:28px}
  .categories-grid{grid-template-columns: 1fr}
  .products-grid{grid-template-columns: 1fr}
  .products-grid--compact{grid-template-columns: 1fr}
  .product-media{padding-top:66%}
  /*.search{display:none}*/
  .cart-icon{font-size:16px}
  .top-nav{display:none}
  .sidebar{width:100%; max-width:100vw}
  .hero{border-radius:0}
}

/* small utility */
.text-center{text-align:center}


/* ---------- PRODUCT PAGE ---------- */
.product-page {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin: 40px 0;
}

.product-gallery {
  flex: 1 1 45%;
  text-align: center;
}

.product-gallery .main-image {
  width: 100%;
  max-width: 500px;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  aspect-ratio: 1/1;
  object-fit: cover;
}

.variant-thumbs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.variant-thumbs img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.variant-thumbs img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 6px rgba(0,0,0,0.2);
}

.product-info {
  flex: 1 1 45%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 26px;
  font-weight: 600;
}

.price-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.price {
  font-size: 24px;
  /*font-weight: bold;*/
  color: #0E2A47;
}

.old-price {
  font-size: 18px;
  text-decoration: line-through;
  color: #999;
}

.discount {
  font-size: 16px;
  color: #d9534f;
}

.select-input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 12px;
  font-size: 16px;
  width: 100%;
}

.btn-primary {
  background: #0E2A47;
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s;
}

.btn-primary:hover {
  background: #153b63;
}

.product-description h3 {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 600;
  color: #0E2A47;
}

.product-description p {
  color: #444;
  line-height: 1.6;
}

/* ---------- SIMILAR ITEMS ---------- */
.similar-items {
  margin-top: 60px;
}

.similar-items h2 {
  font-size: 24px;
  font-weight: 600;
  color: #0E2A47;
  margin-bottom: 25px;
}

/* Чтобы курсор на кнопке был pointer, а не как у ссылки */
.add-btn {
    cursor: pointer;
    position: relative;
    z-index: 10;
}

/* Блокируем переход на кнопке */
.add-btn:active {
    pointer-events: auto;
}

/* Анимация для кнопки */
.btn-outline.add-btn {
    transition: all 0.3s ease;
}

.btn-outline.add-btn.btn-added {
    background-color: #4caf50;
    color: white;
    border-color: #4caf50;
}

/* Анимация корзины */
.cart-icon {
    position: relative;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.cart-icon.cart-bump {
    transform: scale(1.2);
}

/* Счетчик товаров в корзине */
.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff4444;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}


/* Анимация для летящего элемента */
@keyframes flyToCart {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(0.5);
        opacity: 0.8;
    }
    100% {
        transform: scale(0.1);
        opacity: 0;
    }
}

/* Стили для счетчика корзины */
.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: #ff4444;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-family: Arial, sans-serif;
}

/* Стили для кнопок изменения количества */
.cart-quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 10px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background-color: #f5f5f5;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.2s ease;
}

.qty-btn:hover {
  background-color: #e0e0e0;
  border-color: #ccc;
}

.qty-value {
  min-width: 30px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}

/* Обновленные стили для cart-item */
.cart-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #eee;
  gap: 12px;
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-info {
  flex: 1;
}

.cart-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.cart-size {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.cart-price {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background-color: #ff4444;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.remove-btn:hover {
  background-color: #cc0000;
  transform: scale(1.05);
}

/* Модальное окно выбора вариантов */
.variant-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.variant-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.variant-modal-content {
    position: relative;
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.variant-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.variant-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.variant-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.variant-modal-close:hover {
    color: #333;
}

.variant-modal-body {
    padding: 20px;
    text-align: center;
}

.modal-product-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.variant-modal-body h4 {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #333;
}

.variant-options {
    text-align: left;
    margin-bottom: 15px;
}

.variant-options label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.variant-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.variant-stock-info {
    margin-top: 15px;
    font-size: 14px;
}

.in-stock {
    color: #4caf50;
    font-weight: 600;
}

.out-of-stock {
    color: #ff4444;
    font-weight: 600;
}

.variant-price {
    display: block;
    margin-top: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.variant-modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
}

.variant-modal-footer .btn {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
}

.btn-secondary {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    color: #666;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

/* Уведомления */
.notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
}

.notification {
    background-color: #4caf50;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    font-size: 14px;
    min-width: 250px;
}

.notification.show {
    transform: translateX(0);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 25px;
}

.product-card {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  background: #fff;
  transition: transform 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
}

.product-card img {
  width: 100%;
  height: 230px;
  object-fit: cover;
}

.card-body {
  padding: 15px;
}

.card-body h3 {
  font-size: 18px;
  font-weight: 500;
  color: #0E2A47;
  margin-bottom: 8px;
}

.btn-outline {
  display: inline-block;
  margin-top: 10px;
  border: 1px solid #0E2A47;
  padding: 10px 18px;
  border-radius: 10px;
  color: #0E2A47;
  text-decoration: none;
  transition: all 0.3s;
}

.btn-outline:hover {
  background: #0E2A47;
  color: #fff;
}

/* ---------- ADAPTIVE ---------- */
@media (max-width: 900px) {
  .product-page {
    flex-direction: column;
  }

  .product-gallery, .product-info {
    flex: 1 1 100%;
  }

  .main-image {
    max-width: 100%;
  }

  .product-title {
    font-size: 22px;
  }

  .price {
    font-size: 22px;
  }
}

/* ---------- CART POPUP ---------- */
.cart-overlay {
  position: fixed;
  top: 0; right: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cart-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.cart-box {
  background: #fff;
  width: 380px;
  max-width: 90%;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 12px 0 0 12px;
  box-shadow: -2px 0 15px rgba(0,0,0,0.1);
  overflow: hidden;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.cart-header {
  padding: 16px;
  background: #0E2A47;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.cart-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

.cart-content.empty {
  display: flex;
  justify-content: center;
  align-items: center;
  color: #777;
  font-size: 16px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #eee;
  padding: 10px 0;
}

.cart-item img {
  width: 70px;
  height: 70px;
  border-radius: 10px;
  object-fit: cover;
}

.cart-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cart-name {
  font-weight: 500;
  color: #0E2A47;
}

.cart-size {
  color: #777;
  font-size: 14px;
}

.cart-price {
  font-weight: bold;
  color: #111;
}

.remove-btn {
  background: #d33;
  border: none;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.cart-footer {
  padding: 15px;
  border-top: 1px solid #ddd;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-total {
  font-size: 18px;
  font-weight: 500;
  color: #0E2A47;
}

.checkout-btn {
  background: #0E2A47;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.checkout-btn:hover {
  background: #153b63;
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.contact-icon {
    background: var(--accent);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    font-family: 'Montserrat';
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.map-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(16,24,40,0.04);
    height: 400px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.2s;
}

.faq-item:hover {
    transform: translateY(-2px);
}

/* Активный пункт в меню */
.sidebar-list a.active {
    background: rgba(255,255,255,0.1);
    font-weight: 600;
}

/* Mobile-friendly */
@media (max-width: 600px) {
  .cart-box {
    width: 100%;
    border-radius: 0;
  }
}