/* ============================================
   ОБЩИЕ СТИЛИ (для всех экранов)
   ============================================ */
.product-detail {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2px;
    background: #5c902c;
    box-sizing: border-box;
}

.product-detail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 5px;
    /*background: linear-gradient(180deg, #a5d772 50%, #4e831f 100%);*/
    background: linear-gradient(180deg, #7581ea 50%, #bec4f4 100%);
    border: 1px solid #000000;
    border-radius: 10px;
    box-sizing: border-box;
    width: 100%;
}

/* ============================================
   КАРТИНКА
   ============================================ */
.product-detail-image {
    flex: 1 1 40%;
    min-width: 200px;
    padding: 2px;
    box-sizing: border-box;

}

.product-detail-image img {
    width: 100%;
    height: auto;
    border: 1px solid #000000;
    border-radius: 8px;
    display: block;
    background: white;
}

/* ============================================
   ИНФОРМАЦИЯ (текстовая часть)
   ============================================ */
.product-detail-info {
    flex: 1 1 55%;
    min-width: 200px;
    padding: 2px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 100%;
    overflow: hidden; /* Обрезаем все, что выходит за пределы */
	 /*border: 2px solid #000000;*/
}

.product-detail-info h1 {
    font-size: 22px;
    margin: 0 0 5px 0;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

.product-detail-info h2 {
    font-size: 18px;
    margin: 0 0 10px 0;
    color: #555;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

.product-detail-price {
    font-size: 24px;
    font-weight: bold;
    color: #2e7d32;
    padding: 10px 15px;
    background: #e8f5e9;
    border-radius: 5px;
    border: 1px solid #c8e6c9;
    word-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.product-detail-stock {
    font-size: 16px;
    padding: 10px 15px;
    background: #fff3e0;
    border-radius: 5px;
    border: 1px solid #ffe0b2;
    word-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: -2px; /* Убираем лишний отступ между ценой и наличием */
}

.product-detail-description {
    padding: 15px;
    background: white;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 15px;
}

.product-detail-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.product-detail-actions .back-button {
    padding: 8px 20px;
    background: #4e831f;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    font-size: 16px;
    transition: background 0.3s;
}

.product-detail-actions .back-button:hover {
    background: #3a6b16;
}

/* ============================================
   АДАПТИВ ДЛЯ ЭКРАНОВ МЕНЬШЕ 1000px
   ============================================ */
@media screen and (max-width: 1000px) {
    .product-detail {
        width: 100vw;
        max-width: 100vw;
        padding: 2px;
        margin: 0;
        box-sizing: border-box;
        background: #5c902c;
    }

    .product-detail-container {
        width: calc(100% - 4px);
        margin: 0 2px;
        padding: 5px;
        gap: 2px;
        flex-direction: column;
        box-sizing: border-box;
       /* background: linear-gradient(180deg, #a5d772 50%, #4e831f 100%);*/
        background: linear-gradient(180deg, #90bc60 50%, #4e831f 100%);
        border: 1px solid #000000;
        border-radius: 10px;
    }

    /* КАРТИНКА на мобильных */
    .product-detail-image {
        flex: none;
        width: 100%;
        min-width: auto;
        padding: 2px;
        box-sizing: border-box;
    }

    .product-detail-image img {
        width: 100%;
        height: auto;
        border: 1px solid #000000;
        border-radius: 8px;
        display: block;
        background: white;
    }

    /* ИНФОРМАЦИЯ на мобильных */
    .product-detail-info {
        flex: none;
        width: 100%;
        min-width: auto;
        padding: 2px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        gap: 6px;
        max-width: 100%;
        overflow: hidden;
    }

    .product-detail-info h1 {
        font-size: 20px;
        margin: 0 0 3px 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-width: 100%;
    }

    .product-detail-info h2 {
        font-size: 16px;
        margin: 0 0 5px 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-width: 100%;
    }

    .product-detail-price {
        font-size: 22px;
        padding: 8px 12px;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0;
    }

    .product-detail-stock {
        font-size: 15px;
        padding: 8px 12px;
        max-width: 100%;
        box-sizing: border-box;
        margin-top: -2px;
    }

    .product-detail-description {
        padding: 12px;
        font-size: 14px;
        max-width: 100%;
        box-sizing: border-box;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .product-detail-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .product-detail-actions .back-button {
        padding: 6px 16px;
        font-size: 14px;
        flex: 1 1 auto;
        text-align: center;
        min-width: 80px;
    }
}

/* ============================================   ДЛЯ ОЧЕНЬ МАЛЕНЬКИХ ЭКРАНОВ (< 400px) ============================================ */

@media screen and (max-width: 400px) {
    .product-detail-info h1 {
        font-size: 17px;
    }

    .product-detail-info h2 {
        font-size: 14px;
    }

    .product-detail-price {
        font-size: 18px;
        padding: 6px 10px;
    }

    .product-detail-stock {
        font-size: 13px;
        padding: 6px 10px;
    }

    .product-detail-description {
        font-size: 13px;
        padding: 10px;
    }

    .product-detail-actions .back-button {
        padding: 5px 12px;
        font-size: 12px;
        min-width: 60px;
    }
}