/* ===== БАЗОВЫЕ НАСТРОЙКИ ===== */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    font-family: 'Montserrat', 'Arial', sans-serif; 
    background: #FAF8F5; 
    color: #4A4A4A;
    line-height: 1.6;
}

/* Заголовки */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    color: #2C2C2C;
}

/* Шапка */
.header { 
    background: linear-gradient(135deg, #8B7355 0%, #e8d5c4 100%) !important;
    color: #2C2C2C !important;
    padding: 1.2rem 3rem; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    cursor: default !important;
}

/* Логотип */
.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.logo-link { /* ← ← ← Ссылка на главную (добавь в base.html) */
    text-decoration: none !important;
    color: inherit !important;
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
}

.logo-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    user-select: none;
}

.logo-main {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #2C2C2C !important;
    line-height: 1.2;
    text-align: center;
    user-select: none;
}

.logo-sub {
    font-size: 0.85rem;
    letter-spacing: 4px;
    text-transform: lowercase;
    color: #4A4A4A !important;
    margin-top: 3px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    text-align: center;
    user-select: none;
}

/* Навигация */
.nav { 
    display: flex; 
    gap: 2rem; 
    align-items: center;
}

.nav a { 
    color: #2C2C2C !important;
    text-decoration: none; 
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.nav a:hover { 
    background: rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.cart-info {
    background: rgba(0,0,0,0.1) !important;
    color: #2C2C2C !important;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-weight: 500;
}

/* Языки */
.lang-switch { 
    display: flex; 
    gap: 0.5rem;
    align-items: center;
}

.lang-switch a { 
    color: #2C2C2C !important;
    text-decoration: none; 
    font-size: 0.85rem;
    padding: 0.4rem 0.7rem;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.lang-switch a:hover {
    background: rgba(0,0,0,0.1);
}

.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-current {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.2);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    color: #2C2C2C;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
}

.lang-current:hover {
    background: rgba(0,0,0,0.1);
}

.lang-options {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    min-width: 140px;
    z-index: 100;
    overflow: hidden;
}

.lang-option {
    display: block;
    padding: 0.7rem 1rem;
    color: #2C2C2C;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s ease;
    cursor: pointer;
}

.lang-option:hover {
    background: #f5f5f5;
}

/* Соцсети */
.social-wrapper {
    position: fixed;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.social-toggle {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: #8B7355;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 1001;
    user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.social-toggle i {
    font-weight: 900 !important;
    font-size: 1.4rem;
    display: block;
}

.social-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.social-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease backwards;
}

.social-btn:nth-child(1) { animation-delay: 0.05s; }
.social-btn:nth-child(2) { animation-delay: 0.1s; }
.social-btn:nth-child(3) { animation-delay: 0.15s; }
.social-btn:nth-child(4) { animation-delay: 0.2s; }

.social-btn:hover {
    transform: scale(1.15) translateX(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.social-btn.whatsapp { background: linear-gradient(135deg, #25D366 0%, #128C7E 100%); }
.social-btn.instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.social-btn.email { background: linear-gradient(135deg, #8E44AD 0%, #9B59B6 100%); }
.social-btn.telegram { background: linear-gradient(135deg, #0088cc 0%, #006699 100%); }

/* Контейнер */
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 2.5rem; 
}

/* Flash сообщения */
.flash-messages { margin-bottom: 1.5rem; }

.flash { 
    padding: 1rem 1.5rem; 
    border-radius: 8px; 
    margin-bottom: 0.75rem;
    font-weight: 500;
    border-left: 4px solid;
}

.flash.success { background: #E8F5E9; color: #2E7D32; border-left-color: #4CAF50; }
.flash.error { background: #FFEBEE; color: #C62828; border-left-color: #F44336; }
.flash.info { background: #E3F2FD; color: #1565C0; border-left-color: #2196F3; }

/* Footer */
.footer { 
    background: linear-gradient(135deg, #8B7355 0%, #e8d5c4 100%) !important;
    color: #2C2C2C !important;
    text-align: center; 
    padding: 2rem; 
    margin-top: 3rem;
}

/* Кнопки */
.btn { 
    display: inline-block; 
    padding: 0.9rem 2rem; 
    border: none; 
    border-radius: 30px; 
    cursor: pointer; 
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.btn-primary { 
    background: linear-gradient(135deg, #8B7355 0%, #A08060 100%); 
    color: white;
    box-shadow: 0 4px 15px rgba(139, 115, 85, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(139, 115, 85, 0.4);
}

.btn-white {
    background: white;
    color: #8B7355;
}

.btn-white:hover {
    background: #FAF8F5;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Сетка товаров (каталог) */
.products-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ (ЕДИНЫЙ БЛОК) ===== */
@media (max-width: 768px) {
  /* --- Глобально --- */
  html { font-size: 14px; }
  body { padding: 0 10px !important; overflow-x: hidden !important; }
  .container { padding: 1rem 0 !important; max-width: 100% !important; }

  /* --- Шапка: узкая, логотип-ссылка, меню в ряд --- */
  .header {
    padding: 6px 10px !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    min-height: auto !important;
  }
  .logo-link, .logo {
    gap: 0.3rem !important;
    align-items: center !important;
  }
  .logo-image { height: 28px !important; width: auto !important; }
  .logo-main { font-size: 0.85rem !important; line-height: 1 !important; }
  .logo-sub { display: none !important; }
  
  .nav {
    order: 2;
    width: 100%;
    justify-content: center;
    gap: 3px !important;
    margin-top: 4px !important;
  }
  .nav a {
    font-size: 0.7rem !important;
    padding: 4px 6px !important;
    white-space: nowrap !important;
  }
  .cart-info {
    font-size: 0.7rem !important;
    padding: 4px 8px !important;
  }
  .lang-switch {
    order: 1;
    margin-left: auto !important;
  }
  .lang-current {
    font-size: 0.7rem !important;
    padding: 3px 6px !important;
  }
  /* Показываем соцсети на мобильном, но делаем компактнее */
.social-wrapper {
    right: 10px !important;
    top: auto !important;
    bottom: 20px !important;
    transform: none !important;
    flex-direction: row !important;
    gap: 8px !important;
    z-index: 1000 !important;
}

.social-toggle,
.social-btn {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.2rem !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
}

.social-buttons {
    flex-direction: row !important;
    gap: 8px !important;
    align-items: flex-end !important;
}

  /* --- Страница товара: 2 колонки, но компактнее (КАК ТЫ ХОТЕЛ) --- */
  .product-detail { padding: 0.5rem !important; }
  .product-detail > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr 1fr !important; /* ← ← ← 2 колонки сохраняются! */
    gap: 0.75rem !important;
  }
  #mainImage { height: 200px !important; }
  .thumbnail { width: 50px !important; height: 50px !important; }
  .product-info h1 { font-size: 1.2rem !important; margin-bottom: 0.3rem !important; }
  .product-info span[style*="font-size: 2rem"] { font-size: 1rem !important; }
  .product-info > div[style*="background: #FAF8F5"] {
    padding: 0.5rem !important;
    margin-bottom: 0.5rem !important;
  }
  .product-info select,
  .product-info input[type="number"] {
    padding: 0.4rem !important;
    font-size: 0.85rem !important;
    margin-bottom: 0.5rem !important;
  }
  .product-info input[type="number"][name="quantity"] { width: 100% !important; }
  .product-info button[type="submit"] {
    padding: 0.6rem !important;
    font-size: 0.9rem !important;
    border-radius: 6px !important;
  }
  .product-detail nav { font-size: 0.7rem !important; margin-bottom: 0.5rem !important; }

  /* --- Каталог: сайдбар сверху, сетка 1 колонка --- */
  div[style*="display: flex"][style*="gap: 2rem"] {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  aside[style*="width: 250px"] { width: 100% !important; }
  main[style*="flex: 1"] { width: 100% !important; }
  .products-grid {
    grid-template-columns: 1fr !important; /* ← ← ← Товары в 1 колонку (стандарт) */
    gap: 0.75rem !important;
  }
  .product-card img,
  .product-card > div[style*="height: 250px"] {
    height: 180px !important;
  }
  .product-card h3 { font-size: 1rem !important; margin-bottom: 0.3rem !important; }
  .product-card p[style*="font-size: 1.2rem"] { font-size: 0.95rem !important; }
  aside a {
    display: block !important;
    padding: 6px 10px !important;
    border-radius: 4px !important;
  }

  /* --- Footer --- */
  .footer { padding: 1rem !important; font-size: 0.8rem !important; }
}