/* === Header Styles === */
.header {
  background: #fff;
  border-bottom: 1px solid #d1d5db;
  padding: 15px 0;
  position: relative;
  z-index: 100;
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 5%;
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.header-center {
  flex: 1;
  max-width: 800px;
  min-width: 0;
}

.header-right {
  flex-shrink: 0;
}

/* Logo */
.logo {
  font-size: 0;
}

.logo a,
.site-title {
  font-size: 24px;
  font-weight: 700;
  color: #8b4513;
  text-decoration: none;
  letter-spacing: 1px;
  white-space: nowrap;
  font-family: 'Georgia', serif;
}

.logo img {
  height: 80px !important;
  width: auto !important;
  max-width: 100% !important;
}

/* Search Form */
.search-form {
  width: 100%;
}

.search-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.search-main-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.search-field {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

.catalog-select {
  min-width: 150px;
  max-width: 200px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  box-sizing: border-box;
}

.search-submit {
  padding: 12px 24px;
  background: #8b4513;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
  font-size: 16px;
  width: auto;
  align-self: flex-start;
  font-family: 'Georgia', serif;
}

.search-submit:hover {
  background: #6b3410;
}

.search-filters-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

.filter-input {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  flex: 1;
  min-width: 80px;
  max-width: calc(20% - 5px);
  box-sizing: border-box;
}

.filter-input::placeholder {
  font-size: 12px;
}

.year-input {
  max-width: 90px;
}

.country-input {
  max-width: 110px;
}

.group-input {
  max-width: 100px;
}

.number-input {
  max-width: 130px;
}

/* Top Contacts */
.top-contacts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.contact-phone {
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
  text-decoration: none;
  transition: color 0.3s;
  white-space: nowrap;
}

.contact-phone:hover {
  color: #8b4513;
}

.contact-email {
  font-size: 18px;
  font-weight: 600;
  color: #4a5568;
  text-decoration: none;
  transition: color 0.3s;
  white-space: nowrap;
}

.contact-email:hover {
  color: #8b4513;
}

/* Navigation */
.nav {
  background: #fff;
  border-bottom: 1px solid #d1d5db;
  position: relative;
  z-index: 99;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 5%;
}

.primary-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.primary-menu::-webkit-scrollbar {
  display: none;
}

.primary-menu li {
  margin: 0;
  flex-shrink: 0;
}

.primary-menu a {
  display: block;
  padding: 12px 0;
  color: #2c3e50;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  white-space: nowrap;
  font-size: 15px;
  font-family: 'Georgia', serif;
}

.primary-menu a:hover {
  color: #8b4513;
}

/* Счетчик корзины в хедере */
.cart-link {
    position: relative;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.3s ease;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
}

.cart-link:hover {
    background: #edf2f7;
    text-decoration: none;
}

.cart-link i {
    font-size: 18px;
    margin-right: 8px;
    color: #4a5568;
}

.cart-count {
    background: #c0392b;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    position: absolute;
    top: -5px;
    right: -5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Mobile Menu */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  gap: 4px;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: #2c3e50;
  transition: 0.3s;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 300px;
  height: 100vh;
  background: #fff;
  z-index: 1001;
  transition: right 0.3s ease;
  box-shadow: -2px 0 10px rgba(0,0,0,0.1);
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: none;
}

.mobile-menu-overlay.active {
  display: block;
}

.mobile-menu-header {
  padding: 15px;
  border-bottom: 1px solid #d1d5db;
  display: flex;
  justify-content: flex-end;
}

.mobile-menu-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #2c3e50;
}

.mobile-menu-content {
  padding: 20px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.mobile-primary-menu {
  list-style: none;
  margin: 0 0 30px 0;
  padding: 0;
}

.mobile-primary-menu li {
  margin-bottom: 0;
}

.mobile-primary-menu a {
  display: block;
  padding: 15px 0;
  color: #2c3e50;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid #d1d5db;
  font-size: 16px;
  font-family: 'Georgia', serif;
}

.mobile-contacts {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-top: 20px;
  border-top: 1px solid #d1d5db;
}

.mobile-contacts .contact-phone {
  font-size: 20px;
  text-align: center;
}

.mobile-contacts .contact-email {
  font-size: 16px;
  text-align: center;
}

/* === Feedback Button Styles === */
.feedback-btn {
    background-color: #8b4513;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    
    font-weight: 600;
}

.feedback-btn:hover {
    background-color: #6b3410;
}

/* === Modal Window Styles === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: modalAppear 0.3s ease;
    border: 1px solid #d1d5db;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #d1d5db;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
    font-family: 'Playfair Display', 'Georgia', serif;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #2c3e50;
}

.feedback-form {
    padding: 20px;
}

.form-group2 {
    margin-bottom: 20px;
}

.form-group2 label {
    display: block;
    margin-bottom: 5px;
    color: #2c3e50;
    font-weight: 600;
    
}

.form-group2 input[type="text"],
.form-group2 input[type="email"],
.form-group2 input[type="tel"] {
    width: 97%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 16px;
    
    transition: border-color 0.3s ease;
}

.form-group2 input:focus {
    outline: none;
    border-color: #8b4513;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.checkbox-group input[type="checkbox"] {
    padding: 0px;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    border-radius: 0;
    border: 2px solid #6b7280;
    appearance: none;
    -webkit-appearance: none;
    background: white;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.checkbox-group input[type="checkbox"]:checked {
    background: #8b4513;
    border-color: #8b4513;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.checkbox-group label {
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    cursor: pointer;
    color: #4a5568;
    
}

.submit-btn {
    width: 100%;
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 12px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    
    font-weight: 600;
}

.submit-btn:hover {
    background-color: #219653;
}

.submit-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* === Active Filters Styles === */
.header-active-filters {
    background: #f8f9fa;
    border-bottom: 1px solid #d1d5db;
    padding: 10px 0;
    margin-top: 10px;
}

.active-filters-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
    font-size: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.active-filter {
    background: #8b4513;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    
}

.clear-all-filters {
    color: #c0392b;
    text-decoration: none;
    font-size: 12px;
    margin-left: auto;
    white-space: nowrap;
    
    font-weight: 600;
    transition: color 0.3s ease;
}

.clear-all-filters:hover {
    text-decoration: underline;
    color: #a33225;
}

/* Стили для выпадающего списка стран */
.country-select {
    min-width: 120px;
    max-width: 150px;
}

/* === Responsive Design for Header Elements === */

/* Tablet */
@media (max-width: 1024px) {
    .modal {
        width: 85%;
        max-width: 450px;
    }
    
    .feedback-btn {
        padding: 10px 25px;
        font-size: 15px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .modal {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .feedback-form {
        padding: 15px;
    }
    
    .form-group2 input[type="text"],
    .form-group2 input[type="email"],
    .form-group2 input[type="tel"] {
        width: 95%;
    }
    
    .active-filters-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 0 3%;
    }
    
    .clear-all-filters {
        margin-left: 0;
        margin-top: 5px;
    }
    
    .active-filter {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .country-select {
        min-width: 100px;
        max-width: 120px;
    }
    
    .feedback-btn {
        padding: 8px 20px;
        font-size: 14px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .country-select {
        min-width: 90px;
        max-width: 100px;
        font-size: 12px;
    }
    
    .modal-header h2 {
        font-size: 1.3em;
    }
    
    .form-group2 input[type="text"],
    .form-group2 input[type="email"],
    .form-group2 input[type="tel"] {
        font-size: 14px;
        padding: 10px;
    }
    
    .submit-btn {
        padding: 10px;
        font-size: 15px;
    }
}
.cart-and-swap{
  display: flex;
}
.view-toggle-btn{
  
 
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background .3s ease;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
}
/* Стили для кнопок переключения вида */
.view-toggle-container {
  display: flex;
  gap: 5px;
  margin-right: 15px;
}

.view-toggle-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-toggle-btn:hover {
  background-color: #f5f5f5;
  border-color: #999;
}

.view-toggle-btn.active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Стили для вида списком */
.view-list .products-grid {
  display: block;
}

/* ПРОСТОЙ ВАРИАНТ */
.view-list .product-card {
  display: grid;
  grid-template-areas: 
      "image title"
      "image price"
      "image actions"
      "meta meta";
  grid-template-columns: 150px 1fr;
  gap: 10px 20px;
  padding: 15px;
}

.view-list .product-image {
  grid-area: image;
  margin: 0;
}

.view-list .product-title {
  grid-area: title;
  margin: 0;
  overflow: visible;
  white-space: normal;
  -webkit-line-clamp: unset;
  min-height: auto;
}

.view-list .product-price {
  grid-area: price;
  margin: 0;
}

.view-list .product-actions {
  grid-area: actions;
  display: flex !important;
  flex-direction: row !important;
  gap: 10px;
  margin: 0 !important;
}

.view-list .product-actions > * {
  flex: 1;
  min-width: 0;
  padding: 8px 12px !important;
  text-align: center;
  margin: 0 !important;
  align-items: center;
  height: 39px;
}

.view-list .product-meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.view-list .product-meta div {
  background: #f8f9fa;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
}

/* Мобильная версия */

/* DEV-16: кнопка «Каталог» в шапке — на всех страницах */
.nav .nav-container {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-catalog-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: #8b4513;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s ease, transform .05s ease;
  flex-shrink: 0;
}
.nav-catalog-btn:hover { background: #723910; color: #fff; }
.nav-catalog-btn:active { transform: translateY(1px); }
.nav-catalog-btn .nav-catalog-ico { display: inline-flex; }
.nav-catalog-btn svg { display: block; }

@media (max-width: 767px) {
  .nav-catalog-btn { padding: 8px 14px; font-size: 14px; }
}
.mobile-catalog-btn {
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
  padding: 12px 18px;
  font-size: 16px;
}
