* {
    box-sizing: border-box;
}

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}

b {
    font-weight: 600;
}

article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}

body {
	line-height: 1.2;
    font-family: 'Inter', sans-serif;
    color: #222;
}

ol, ul {
	list-style: none;
}

blockquote, q {
	quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}

a {
    text-decoration: none;
    color: #222;
}

table {
	border-collapse: collapse;
	border-spacing: 0;
}

select {
  /* 1. Отключаем системный виджет macOS */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  /* 2. Сбрасываем системные фоны и рамки */
  border-radius: 0;
  background-color: #fff;
  
  /* 3. Обязательно задаем кастомную стрелку, 
     так как сброс appearance уберет нативную стрелку macOS */
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='5' viewBox='0 0 10 5'%3E%3Cpath fill='%23333' d='M0 0l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  
  /* 4. Правый padding, чтобы текст не налезал на новую стрелку */
  padding-right: 30px;
  color: #222222;
}

.container {
    width: 1330px;
    margin: 0 auto;
}

.header {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: #fff;
    height: 118px;
}

.header-menu {
    float: left;
    padding-top: 50px;
}

.header-menu a {
    color: #000;
    font-size: 14px;
    margin-right: 26px;
    font-weight: 500;
}

.header-icons {
    float: right;
    padding-top: 48px;
}

.logo {
    width: 97px;
    height: 22px;
    float: left;
    margin-left: 320px;
    margin-top: 48px;
    background: url('/static/img/logo.svg');
}

.start {
    margin-top: 160px;
}

.g-h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 34px;
}

.catalog {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.catalog-item {
    width: calc(25% - 22.5px);
    margin-bottom: 40px;
}

.catalog-item-img {
    border-radius: 15px;
    height: 400px;
    background: #ccc;
    width: 100%;
    transition: 0.3s;
}

.catalog-item-img:hover {
    transition: 0.3s;
    transform: translateY(-5px);
}

.catalog-item-title {
    font-size: 14px;
    width: 100%;
    font-weight: 500;
    color: #222;
    margin-top: 6px;
    line-height: 1.5;
}

.catalog-item-price {
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
}

.about-logo {
    width: 97px;
    height: 22px;
    background: url('/static/img/logo.svg');
    margin: 0 auto;
    margin-bottom: 40px;
}

.cookies {
    background: #f9f7f2;
    border-radius: 15px;
    padding: 30px;
    width: 100%;
    margin-bottom: 60px;
    font-size: 14px;
    line-height: 1.4;
}

.item-container {
    width: 1080px;
    display: flex;
    margin: 0 auto;
    gap: 50px;
}

.item-image {
    width: 100%;
    height: 545px;
    border-radius: 15px;
}

.item-container > div {
    width: calc(50% - 25px);
}

.item-title {
    font-size: 22px;
    line-height: 1.4;
    font-weight: 500;
}

.item-full-desc {
    font-size: 14px;
    margin-top: 30px;
    line-height: 1.5;
}

.item-full-desc p {
    margin-bottom: 18px;
}

.item-price {
    font-size: 18px;
    font-weight: 500;
    margin-top: 30px;
}

.to-cart-button {
    border-radius: 10px;
    height: 48px;
    background: #e9cda9;
    transition: 0.3s;
    color: #fff;
    font-weight: 600;
    border: none;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 30px;
    padding-left: 30px;
    padding-right: 30px;
    margin-top: 30px;
}

.to-cart-count {
    border-radius: 10px;
    height: 48px;
    border: 1px solid #eee;
    text-align: center;
    width: 48px;
    margin-right: 10px;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    /* display: none; <- Crashes Chrome on hover */
    -webkit-appearance: none;
    appearance: none;
    margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}

.profile-place {
    max-width: 60%;
    line-height: 1.4;
    font-size: 14px;
    margin-bottom: 60px;
}

.profile-button {
    border-radius: 10px;
    height: 48px;
    background: #e9cda9;
    transition: 0.3s;
    color: #fff;
    font-weight: 600;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding-left: 26px;
    padding-right: 26px;
    display: inline-block;
    padding-top: 14px;
    margin-right: 10px;
    margin-top: 30px;
}

.mobile-footer-links {
    margin-bottom: 30px;
}

.mobile-footer-links a {
    display: block;
    margin-bottom: 10px;
}

.cart-item {
    background: #f9f7f2;
    display: flex;
    gap: 20px;
    padding: 30px;
    border-bottom: 1px solid #efeadd;
}

.remove-in-cart {
    background: none;
    outline: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #743737;
}

.price-in-cart {
    font-size: 14px;
    margin-top: 12px;
    margin-bottom: 8px;
}

.item-name-in-cart {
    font-weight: 500;
}

.cart-place {
    width: 100%;
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.cart-items-list {
    width: 995px;
    border-radius: 15px;
    overflow: hidden;
}

.cart-items-order {
    width: 305px;
    border-radius: 15px;
    background: #f9f7f2;
    padding: 30px;
}

.cart-items-order p {
    margin-bottom: 15px;
    font-size: 14px;
}

.in-cart-delivery-info {
    width: 305px;
    background: #f9f7f2;
    border-radius: 15px;
    padding: 28px 30px;
    font-size: 13px;
    margin-top: 30px;
    line-height: 1.4;
}

.order-button {
    border-radius: 10px;
    height: 48px;
    width: 100%;
    background: #e9cda9;
    transition: 0.3s;
    color: #fff;
    font-weight: 600;
    border: none;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 30px;
    display: inline-block;
    margin-top: 30px;
    text-align: center;
    padding-top: 16px;
}

.bottom-place {
    width: 100%;
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    margin-top: 60px;
}

.about {
    width: 100%;
    background: #f9f7f2;
    border-radius: 15px;
    text-align: center;
    padding: 60px 60px;
    font-size: 14px;
    line-height: 1.4;
    width: 995px;
}

.bottom-inst-block {
    width: 305px;
    background: #f9f7f2;
    border-radius: 15px;
}

.bottom-inst-block img {
    margin: 55px auto 20px auto;
    display: block;
}

.bottom-inst-block p {
    width: 100%;
    text-align: center;
    padding: 0 30px;
    font-size: 14px;
    line-height: 1.4;
}

.bottom-inst-block a {
    border-bottom: 1px dotted #222;
}

.policy p {
    font-size: 14px;
    margin-bottom: 20px;
}

.policy h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.kaspi-message {
    background: #f9f7f2;
    border-radius: 10px;
    padding: 16px 20px;
}

.sold-out {
    margin-top: 30px;
    background: #f9f7f2;
    border-radius: 10px;
    padding: 20px 22px;
}

/* Контейнер галереи */
.product-gallery {
    display: grid;
    /* 1-я колонка (миниатюры): 80px, 2-я колонка (главное фото): 425px */
    grid-template-columns: 80px 425px;
    gap: 12px;
    height: 545px; /* Устанавливаем целевую высоту */
}

/* Если у товара всего 1 фотка и миниатюр нет */
.product-gallery:not(:has(.thumbs-slider)) {
    grid-template-columns: 80px 425px; 
}

/* Слайдер миниатюр */
.thumbs-slider {
    width: 100%;
    height: 100%;
    margin: 0;
    grid-column: 1;
}

/* Главный слайдер */
.main-slider {
    width: 425px;  /* Фиксируем точную ширину */
    height: 545px; /* Фиксируем точную высоту */
    border-radius: 8px;
    overflow: hidden;
    grid-column: 2;
}

.thumbs-slider .swiper-slide {
    width: 100%;
    height: 80px;
    opacity: 0.3;
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    transition: opacity 0.2s, border-color 0.2s;
}

.thumbs-slider .swiper-slide-thumb-active {
    opacity: 1;
    border-color: none;
}

.thumbs-slider img,
.main-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Картинка заполнит весь блок 425x545 без искажения пропорций */
}

.item-rating-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 26px 0 16px 0;
}

.rating-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    font-weight: 600;
}

/* Стили при наличии оценок (Золотые звезда и цифры) */
.rating-badge.active i,
.rating-badge.active .rating-value {
    color: #ffb800;
}

/* Стили при отсутствии оценок (Серые звезда и 0.0) */
.rating-badge.empty i,
.rating-badge.empty .rating-value {
    color: #9ca3af;
}

/* Ссылка «Оценить / Оценить первым» */
.rate-link {
    font-size: 14px;
    color: #4b5563;
    text-decoration: underline;
    transition: color 0.2s;
}

.rate-link:hover {
    color: #111827;
}

.catalog-item-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 26px;
    margin-bottom: 4px;
}

/* Активный рейтинг (золотой) */
.catalog-item-rating.active i,
.catalog-item-rating.active span {
    color: #ffb800;
}

/* Пустой рейтинг (серый) */
.catalog-item-rating.empty i,
.catalog-item-rating.empty span {
    color: #9ca3af;
}

/* Адаптив под мобилки */
@media (max-width: 576px) {
    .product-gallery {
        display: flex;
        flex-direction: column-reverse;
        width: 100%;
        height: auto;
    }

    .main-slider {
        width: 100%;
        height: 450px; /* На мобилке высотой подгоняем пропорции */
    }

    .thumbs-slider {
        width: 100%;
        height: 70px;
    }

    .thumbs-slider .swiper-slide {
        width: 70px;
        height: 100%;
    }
}

@media (min-width: 768px) {
    .no-desktop {
        display: none;
    }
}

@media (max-width: 768px) {
    .no-mobile {
        display: none;
    }

    .container {
        width: 90%;
        margin: 0 5%;
    }

    .header-menu {
        display: none;
    }

    .logo {
        margin-left: 0;
        margin-top: 36px;
    }

    .header-icons {
        padding-top: 38px;
    }

    .bottom-place {
        display: block;
    }

    .bottom-inst-block {
        margin-left: -5%;
        width: 110%;
        border-radius: 0;
        padding-left: 20px;
        padding-right: 20px;
        padding-bottom: 30px;
        margin-top: 30px;
        padding-top: 35px;
    }

    .bottom-inst-block img {
        margin-top: 0;
    }

    .about {
        margin-left: -5%;
        width: 110%;
        border-radius: 0;
        padding-left: 20px;
        padding-right: 20px;
    }

    .cookies {
        margin-left: -5%;
        width: 110%;
        border-radius: 0;
        padding-left: 20px;
        padding-right: 20px;
        margin-bottom: 30px;
    }

    .catalog {
        gap: 20px;
    }

    .catalog-item {
        width: calc(50% - 10px);
    }

    .start {
        margin-top: 120px;
    }

    .catalog-item-img {
        height: calc(42vw * 400 / 310);
    }

    .profile-place {
        max-width: 100%;
    }

    .item-container {
        width: 100%;
        flex-wrap: wrap;
    }

    .item-container > div {
        width: 100%;
    }

    .item-image {
        width: 100%;
        height: auto;
        aspect-ratio: 425 / 545;
    }

    .cart-place {
        flex-wrap: wrap;
    }

    .cart-items-order {
        width: 100%;
    }

    .order-button {
        width: 100%;
    }

    .cart-item {
        display: block;
    }

    .cart-item img {
        margin-bottom: 20px;
    }
}