/* ======================================= */
/*   ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ catalog.html  */
/*   (НЕ влияют на главную страницу)       */
/* ======================================= */

/* ---- Блок с деталями на карточках категорий ---- */
.category-card .card-details {
    position: absolute;
    bottom: 70px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    padding: 8px 5px;
    font-family: 'GillSansLightC', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    border-radius: 6px;
    margin: 0 10px;
    width: calc(100% - 20px);
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    z-index: 5;
    pointer-events: none;
}

.category-card .card-details span {
    display: inline-block;
    white-space: nowrap;
}

.category-card .card-details .price {
    font-weight: 500;
    color: #939D7F;
}

.category-card .card-details .stock,
.category-card .card-details .size {
    font-weight: 300;
    color: #666;
}

.category-card .category-img i+.card-details {
    bottom: 70px;
}

/* ---- Заголовки для блоков подкатегорий ---- */
.catalog-subcategories {
    padding-top: 20px !important;
    padding-bottom: 40px !important;
    background-color: #fff;
}

.subcategory-heading {
    font-family: 'GillSansLightC', sans-serif;
    font-size: 28px;
    font-weight: 300;
    text-transform: uppercase;
    color: #939D7F;
    margin-bottom: 30px;
    text-align: center;
    letter-spacing: 1px;
}

/* ========================================= */
/*    КОРЗИНА (ПЛАВАЮЩАЯ ИКОНКА + МОДАЛКА)   */
/* ========================================= */
.cart-float {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 100;
}

.cart-float-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: #939D7F;
    color: white;
    border-radius: 50%;
    font-size: 28px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    border: none;
    cursor: pointer;
}

.cart-float-btn:hover {
    background-color: #7a8368;
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #FBBBB5;
    color: white;
    font-size: 14px;
    font-weight: 600;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
}

.cart-modal .modal {
    max-width: 700px;
    width: 95%;
}

.cart-items {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 5px;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    font-family: 'GillSansLightC', sans-serif;
}

.cart-item-info {
    flex: 2;
}

.cart-item-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 15px;
    color: #939D7F;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.cart-item-quantity .quantity-btn {
    width: 30px;
    height: 30px;
    font-size: 18px;
}

.cart-item-quantity .quantity-input {
    width: 40px;
    height: 30px;
    font-size: 16px;
}

.cart-item-total {
    flex: 0.8;
    text-align: right;
    font-weight: 600;
    color: #333;
}

.cart-item-remove {
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    transition: color 0.2s;
}

.cart-item-remove:hover {
    color: #FBBBB5;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    font-size: 20px;
    font-weight: 600;
    font-family: 'GillSansLightC', sans-serif;
    border-top: 2px solid #e0e0e0;
}

.cart-total-price {
    color: #939D7F;
    font-size: 24px;
}

.checkout-btn {
    background-color: #939D7F;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 14px 30px;
    font-size: 18px;
    font-weight: 500;
    font-family: 'GillSansLightC', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    width: 100%;
}

.checkout-btn:hover {
    background-color: #7a8368;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(147, 157, 127, 0.3);
}

/* ========== КАРТОЧКИ ТОВАРОВ (АБСОЛЮТНОЕ ПОЗИЦИОНИРОВАНИЕ) ========== */
.category-card.product-card {
    position: relative;
    width: 370px;
    height: 500px;
    background: #fff;
    border: 1px solid #FBBBB5;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.category-card.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.category-card.product-card .category-img {
    position: absolute;
    top: 55px;
    left: 15px;
    width: 340px;
    height: 240px;
    overflow: visible;
}

.category-card.product-card .category-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.category-card.product-card:hover .category-img img {
    transform: scale(1.05);
}

.category-card.product-card .category-img.product-gallery {
    display: block;
    position: absolute;
    top: 15px;
    left: 15px;
    width: 340px;
    height: 240px;
}

.category-card.product-card .category-img.product-gallery .gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 1s ease;
    pointer-events: none;
}

.category-card.product-card .category-img.product-gallery .gallery-image.active {
    opacity: 1;
    z-index: 1;
}

.category-card.product-card .category-img i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    color: #939D7F;
}

.category-card.product-card .product-title {
    position: absolute;
    top: 290px;
    left: 15px;
    right: 15px;
    font-size: 20px;
    font-weight: 400;
    color: #939D7F;
    text-transform: uppercase;
    line-height: 1.2;
    margin: 0;
    padding: 0;
}

.category-card.product-card .product-price {
    position: absolute;
    top: 335px;
    left: 15px;
    font-size: 22px;
    font-weight: 500;
    color: #333;
    margin: 0;
    padding: 0;
}

.category-card.product-card .product-price span {
    font-size: 16px;
    font-weight: 300;
    color: #666;
}

.category-card.product-card .product-size {
    position: absolute;
    top: 375px;
    left: 15px;
    font-size: 15px;
    color: #666;
    margin: 0;
    padding: 0;
}

.category-card.product-card .product-stock {
    position: absolute;
    top: 405px;
    left: 15px;
    font-size: 15px;
    color: #666;
    margin: 0;
    padding: 0;
}

.category-card.product-card .product-stock strong {
    color: #939D7F;
    font-weight: 500;
}

.category-card.product-card .quantity-control {
    position: absolute;
    bottom: 17px;
    left: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 0;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    overflow: hidden;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    background-color: #F7E4DF;
    border: none;
    font-size: 20px;
    font-weight: 600;
    color: #939D7F;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background-color: #FBBBB5;
    color: white;
}

.quantity-input {
    width: 50px;
    height: 36px;
    border: none;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    text-align: center;
    font-family: 'GillSansLightC', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #333;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.add-to-cart-btn {
    background-color: #FBBBB5;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 10px 20px;
    font-family: 'GillSansLightC', sans-serif;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-left: 10px;
    flex: 1;
}

.add-to-cart-btn:hover {
    background-color: #e8a4a0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(251, 187, 181, 0.3);
}

.add-to-cart-btn i {
    font-size: 18px;
}

.add-to-cart-btn.disabled {
    background-color: #ccc;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

.rental-dates {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 15px;
}

.date-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.date-group label {
    font-size: 14px;
    font-weight: 500;
    color: #939D7F;
    font-family: 'GillSansLightC', sans-serif;
}

.date-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'GillSansLightC', sans-serif;
    font-size: 14px;
}

.date-buttons {
    display: flex;
    gap: 10px;
}

.btn-secondary,
.btn-primary {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-family: 'GillSansLightC', sans-serif;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-primary {
    background: #d4af37;
    color: white;
}

.btn-secondary:hover {
    background: #ccc;
}

.btn-primary:hover {
    background: #b8941f;
}

.selected-range {
    margin: 10px 0;
    padding: 8px 12px;
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    font-family: 'GillSansLightC', sans-serif;
    font-size: 14px;
    color: #2e7d32;
    border-radius: 4px;
    text-align: center;
}

/* ========== СТИЛИ ДЛЯ ДЕТАЛЬНОЙ СТРАНИЦЫ ТОВАРА ========== */
.product-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    position: relative;
}

.product-top {
    position: relative;
    min-height: 600px;
}

.product-main-image {
    position: absolute;
    left: -150px;
    top: 50px !important;
    width: 700px;
}

.product-main-image img {
    width: 700px;
    height: 500px;
    object-fit: contain;
    cursor: pointer;
}

.product-detail-info {
    position: absolute;
    left: 700px;
    top: 70px;
    width: 400px;
}

.product-detail-info h1 {
    font-size: 32px;
    color: #939D7F;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.product-detail-price {
    font-size: 28px;
    font-weight: bold;
    color: #d4af37;
    margin-bottom: 15px;
}

.product-detail-price span {
    font-size: 18px;
    font-weight: normal;
    color: #666;
}

.product-detail-size,
.product-detail-stock {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.product-detail-description {
    margin: 20px 0;
    line-height: 1.6;
    color: #555;
}

.detail-quantity-control {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
}

.detail-add-to-cart {
    background-color: #FBBBB5;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 30px;
    font-size: 18px;
    cursor: pointer;
}

.detail-add-to-cart:hover {
    background-color: #e8a4a0;
    transform: translateY(-2px);
}


.carousel-wrapper {
    overflow: hidden;
}

.carousel-slides {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-slide {
    display: flex;
    flex: 0 0 100%;
    gap: 10px;
    justify-content: center;
}

.related-item {
    flex: 0 0 calc(50% - 5px);
    cursor: pointer;
}

.related-item img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
}

.related-item img:hover {
    transform: scale(1.02);
}

.dot {
    width: 10px;
    height: 10px;
    background: #ccc;
    border-radius: 50%;
    cursor: pointer;
}

.dot.active {
    background: #939D7F;
}

.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s;
}

.image-modal.active {
    visibility: visible;
    opacity: 1;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

.close-image-modal {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 40px;
    color: white;
    cursor: pointer;
}

@media (max-width: 768px) {
    .product-detail-info {
        position: static;
        width: 100%;
        margin-top: 20px;
    }

    .product-top {
        min-height: auto;
    }

    .product-carousel-container {
        justify-content: center;
    }

    .product-carousel {
        margin-right: 0;
    }

    .carousel-slide {
        flex-wrap: wrap;
    }

    .related-item {
        flex: 0 0 100%;
    }
}


/* Галерея товара – фиксированные размеры */
.product-gallery {
    width: 700px;
}

.gallery-container {
    position: relative;
    overflow: hidden;
}

.gallery-slides {
    position: relative;
    width: 700px;
    height: 500px;
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    text-align: center;
}

.gallery-slide.active {
    opacity: 1;
    z-index: 1;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
}

@media (max-width: 768px) {
    .gallery-slides {
        height: 250px;
    }
}

/* Принудительное применение шрифта ко всем элементам справа */
.product-detail-info,
.product-detail-info * {
    font-family: 'GillSansLightC', sans-serif !important;
}



.carousel-dots {
    display: none;
}

/* Стрелки в модальном окне */
.image-modal .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2001;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.image-modal .nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.image-modal .prev-btn {
    left: 20px;
}

.image-modal .next-btn {
    right: 20px;
}

.image-modal .counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-family: 'GillSansLightC', sans-serif;
    z-index: 2001;
}

/* Блоки в две колонки */
.blocks-row {
    display: flex;
    gap: 30px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.blocks-row>* {
    flex: 1;
    min-width: 250px;
}

/* Общие стили для рамок */
.work-conditions,
.related-products-wrapper {
    background: #fff;
    border: 2px solid #939D7F;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Заголовки внутри рамок */
.work-conditions h3,
.related-products-wrapper h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    color: #939D7F;
    font-weight: 500;
}

/* Компактный стиль для текста условий */
.work-conditions p {
    margin-bottom: 8px;
    line-height: 1.4;
}

.work-conditions strong {
    color: #939D7F;
}

/* Убираем старую левую полосу (если была) */
.work-conditions {
    margin-top: 0;
}

.work-conditions,
.work-conditions *,
.related-products-wrapper,
.related-products-wrapper * {
    font-family: 'GillSansLightC', sans-serif !important;
}

/* ========== МОБИЛЬНЫЕ СТИЛИ (ОБЪЕДИНЕННЫЕ) ========== */
@media (max-width: 540px) {

    /* Блок деталей на карточках категорий */
    .category-card .card-details {
        bottom: 65px;
        font-size: 12px;
        padding: 5px;
    }

    .category-card .card-details span {
        white-space: normal;
    }

    /* Заголовки подкатегорий */
    .subcategory-heading {
        font-size: 22px;
        margin-bottom: 20px;
    }

    /* Форма аренды */
    .rental-dates {
        flex-direction: column;
        align-items: stretch;
    }

    .date-buttons {
        justify-content: space-between;
    }

    /* Карточки товаров (product-card) */
    .category-card.product-card {
        height: auto !important;
        width: 100% !important;
        display: flex;
        flex-direction: column;
        position: relative;
    }

    .category-card.product-card .category-img {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        height: 160px !important;
        overflow: hidden;
    }

    .category-card.product-card .category-img img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        position: static;
    }

    .category-card.product-card .product-info {
        position: static !important;
        padding: 10px;
        text-align: center;
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        /* занимает всё доступное место */
    }

    .category-card.product-card .product-title,
    .category-card.product-card .product-price,
    .category-card.product-card .product-size,
    .category-card.product-card .product-stock,
    .category-card.product-card .quantity-control {
        position: static !important;
        margin: 5px 0;
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
    }

    .category-card.product-card .quantity-control {
        display: flex;
        justify-content: space-between;
        margin-top: auto;
        /* было margin-top: 10px; – заменяем на auto */
        margin-bottom: 5px;
        /* добавить небольшой отступ снизу (по желанию) */
    }

    .category-card.product-card .add-to-cart-btn {
        font-size: 13px;
        /* чуть меньше шрифт */
        padding: 6px 12px;
        /* уменьшаем внутренние отступы */
        white-space: nowrap;
        /* текст в одну строку */
        flex: 0 0 auto;
        /* кнопка не растягивается */
        width: auto;
        /* ширина по содержимому */
        margin-left: 5px;
        /* небольшой отступ слева */
    }

    .category-card.product-card .quantity-selector {
        height: 32px;
        /* уменьшаем высоту блока */
    }

    .category-card.product-card .quantity-btn {
        width: 28px;
        /* было 36px */
        height: 28px;
        /* было 36px */
        font-size: 16px;
        /* было 20px */
    }

    .category-card.product-card .quantity-input {
        width: 36px;
        /* было 50px */
        height: 28px;
        /* было 36px */
        font-size: 14px;
        /* было 18px */
        padding: 0;
        /* убираем лишние внутренние отступы */
    }
}