/* === Общие стили === */
body {
    background: #f5f7fa;
    color: #000;
    margin: 0;
    font-family: Arial, sans-serif;
    font-size: 13px;
}
a {
    color: inherit;
    text-decoration: none;
}
a:hover {
    color: inherit;
    text-decoration: none;
}

/* === Шапка и футер === */
.header {
    background: #000;
    border-bottom: 1px solid #333;
    padding: 12px 15px;
}
.header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.logo {
    font-size: 16px;
    font-weight: bold;
    color: #e91e63;
    text-decoration: none;
}
.cart-link a {
    color: #ffffff;
    font-size: 14px;
}

.main-content {
    max-width: 960px;
    margin: 20px auto;
    padding: 0 10px;
}
@media screen and (max-width: 768px) {
    .main-content {
        max-width: 960px;
        margin: 0px;
        padding: 0px;
    }
}

.footer {
    padding: 15px;
    background: #000;
    border-top: 1px solid #222;
    text-align: center;
    color: #777;
    font-size: 12px;
}

/* === Заголовки === */
.page-title {
    text-align: left;font-size: 14px;color: #001a34;margin: 15px 0 10px;border-left: 3px solid #e91e63;padding-left: 5px;
}

/* === Сетка товаров === */
.products-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-right: 6px;
}

/* === Карточка товара === */
.product-card {
    flex: 1 1 195px;         /* Базовая ширина карточки */
    max-width: 200px;         /* Не выходить за пределы */
    /*min-width: 120px;        /* Не сжиматься меньше разумного */
    width: 200px;
    /*background: #fff;*/
    /*border: 1px solid #333;*/
    border-radius: 10px;
    padding: 8px;
    box-sizing: border-box;
    transition: transform 0.2s ease-in-out;
    overflow: hidden;
}
.product-card:hover {
    transform: scale(1.01);
}
.product-card img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

/* === Информация о товаре === */
.product-title {
    font-size: 13px;
    color: #070707;
    margin: 6px 0 4px;
    min-height: 32px;
    line-height: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.8em;
    width: 100%;
}
.product-price {
    color: #e91e63;
    font-size: 14px;
    margin-bottom: 5px;
    margin-top: 5px;
    font-weight: bold;
}

/* === Кнопка "В корзину" === */
.button-add {
    background: #e91e63;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    text-align: center;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
.button-add:hover {
    background: #ff4081;
}

/* === Макет страницы === */
.page-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    background-color: #fff;
    border-radius: 24px;
    box-sizing: border-box;
    overflow: hidden;
}
@media screen and (max-width: 768px) {
    .page-container {
        display: flex;
        flex-direction: row;
        gap: 20px;
        background-color: #fff;
        border-radius: 0px;
        box-sizing: border-box;
        overflow: hidden;
    }
}
.sidebar {
    max-width: 200px;
    /*background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;*/
    padding: 10px;
    font-size: 14px;
    height: fit-content;
}

.sidebar .cat {
    margin-bottom: 10px;
}
.sidebar .cat-title {
    color: #e91e63;
    cursor: pointer;
    font-weight: bold;
    padding: 4px 0;
}
.sidebar .subcats {
    margin-top: 5px;
    margin-left: 10px;
    display: block;
}
.sidebar .subcats a {
    display: block;
    color: #000;
    text-decoration: none;
    padding: 3px 0;
    font-size: 13px;
}
.sidebar .subcats a:hover {
    color: #e91e63;
    text-decoration: none;
}
.content {
    flex: 1;
}

/* === Кнопка для моб. меню === */
.toggle-sidebar {
    display: none;
    background: #222;
    color: #fff;
    border: 1px solid #444;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: pointer;
}

/* === Адаптив для телефонов === */
@media screen and (max-width: 768px) {
    .page-container {
        flex-direction: column;
    }

    .sidebar {
        width: 90%;
        margin-bottom: 15px;
        display: none;
    }

    .sidebar.visible {
        display: block;
    }

    .toggle-sidebar {
        display: inline-block;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .cart-link a {
        font-size: 16px;
    }
}
.header-right {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 70%;
}
.toggle-sidebar {
    background: #222;
    color: #fff;
    border: 1px solid #444;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.toggle-sidebar:hover {
    background: #333;
}


/* product */
.product-page {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: flex-start;
}
.product-image-block {
    flex: 1 1 40%;
    max-width: 400px;
    padding-left: 5px;
}
.product-head-article {
    padding-top: 10px;
    padding-bottom: 5px;
    display: block;
}
@media screen and (max-width: 768px) {
    
    .product-page {
        flex-direction: column;
        flex-wrap: wrap; /* ← мобильный: можно перенос */
    }

    .product-image-block {
        max-width: 100%;
        flex: 1 1 100%;
        padding-left: 0px;
    }

    .product-info-block {
        max-width: 100%;
        flex: 1 1 100%;
        padding-left: 5px;
        padding-right: 5px;
    }

    .product-head-article {
        display: none;
    }

}


.product-info-block {
    flex: 1 1 50%;
    color: #000000;
}
.button-add {
    background: #222;
    padding: 10px 20px;
    display: block;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    font-weight: bold;
    box-sizing: border-box;
    width: 100%;
    margin: 0 auto;
}
.button-add:hover {
    background: #333;
}
/*card*/
.product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4; /* делает высоту 4/3 от ширины */
    overflow: hidden;
    border-radius: 6px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.product-card-title {
    margin-top: 0;
    display: block;
    font-size: 22px;
    color: #000;
}
.product-card-price {
    font-size: 24px;
    color: #e91e63;
    margin-bottom: 5px;
    margin-top: 5px;
    font-weight: bold;
}
.switch-block {
    color: #181818;
    padding-top: 5px;
}

/* Бейджи */
.badge-overlay {
    position: absolute;
    top: 268px;
    left: 1px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    z-index: 2;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 10px;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.badge-sale    { background: #e91e63; color: #fff; }
.badge-stock    { background: #e91e63; color: #fff; }
.badge-premium { background: #0070f3; color: #fff; }
.badge-titan   { background: #9c27b0; color: #fff; }

/* slider photo */
.product-slider {
  position: relative;
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  border-radius: 8px;
}
@media screen and (max-width: 768px) {
    .product-slider {
      position: relative;
      width: 100%;
      max-width: 900px;
      overflow: hidden;
      border-radius: 0px;
    }
}
.slider-wrapper {
  display: flex;
  transition: transform 0.4s ease;
}

.slider-image {
  min-width: 100%;
  object-fit: contain;
  display: none;
  border-radius: 8px;
}
@media screen and (max-width: 768px) {
    .slider-image {
      min-width: 100%;
      object-fit: contain;
      display: none;
      border-radius: 0px;
    }
}
.slider-image.active {
  display: block;
}

.slider-prev,
.slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 18px;
  z-index: 10;
  border-radius: 4px;
}

.slider-prev { left: 10px; }
.slider-next { right: 10px; }

