/*
 Theme Custom Overrides
 File: assets/css/custom.css
 This stylesheet is loaded after the main theme CSS.
 Add project-specific overrides below.
*/

/* Example: tune features list spacing (can be modified/extended) */

@media (min-width: 1600px) {
    .product-item {
        -webkit-box-flex: 0;
        -ms-flex: 0 0 calc(100%/4 - 16px);
        flex: 0 0 calc(100%/4 - 16px);
        max-width: unset!important;
    }
}
@media (min-width: 1300px) {
    .product-item {
        -webkit-box-flex: 0;
        -ms-flex: 0 0 calc(100%/4 - 16px);
        flex: 0 0 calc(100%/4 - 16px);
        max-width: 212px;
    }
    .product-item__content {
        padding: 20px 20px 10px;
    }
    .product-item__bottom {
        padding: 0 25px 30px 20px;
    }
    .status-label.in-stock {
        width: fit-content;
    }
    .products__list {
        justify-content: center;
    }
}

.single-product .zoomtoo-container .zoomImg { background:#fff }
/*.product-item:hover .product-item__title {*/
/*    height: auto!important;*/
/*    display: flex!important;*/
/*    position: relative!important;*/
/*    left: 0!important;*/
/*    right: 0!important;*/
/*    top: 0!important;*/
/*}*/

.product-item {
    position: relative;
    transition: box-shadow 0.3s ease, opacity 0.3s ease;
}

.product-item.adding-to-cart {
    opacity: 0.7;
}

.product-item.item-added {
    box-shadow: 0 0 0 3px #4CAF50;
}

.product-item.item-added::after {
    content: '✔';
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #4CAF50;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    font-size: 20px;
    animation: fadeInScale 0.3s ease-in-out;
    z-index: 10;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Flying cart icon animation */
.flying-cart-icon {
    position: fixed;
    z-index: 9999;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
    transition: transform 0.7s cubic-bezier(0.29, 0.54, 0.68, 1.25), opacity 0.7s ease-out;
}

.flying-cart-icon.fly {
    transform: translate(100px, -450px) scale(0.5);
    opacity: 0;
}







/*--------------*/
.product-item {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
/*.product-item:hover {*/
/*    transform: scale(1.05);*/
/*}*/

.product-item__title {
    transition: 
        max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 38px; 
    opacity: 0.85;
    overflow: hidden;
    padding-top: 5px;
    padding-bottom: 5px;
    display: flex!important;
    position: relative!important;
    left: 0!important;
    right: 0!important;
    top: 0!important;
}

.product-item:hover .product-item__title {
    max-height: 300px; /* Достаточно для полного раскрытия */
    opacity: 1;
    padding-top: 16px;
    padding-bottom: 16px;
}

.product-item__bottom {
    display: flex;
    flex-direction: column;
    align-items: start;
}
.custom-price-inner {
    display: flex;
    justify-content: space-between;
    width: 100%;
    /*align-items: center;*/
}
.status-label.in-stock {
    border-radius: 8px;

}
.product-item__bottom .add-to-cart {
    min-width: 82px;
}
.add-to-cart {
    justify-content: center;
    display: flex;
    align-items: center;
}


.status-label.in-stock {
    border-radius: 0;
    position: absolute;
    z-index: 5;
    top: 0;
    right: 0;
    margin-top: 10px;
    margin-right: 10px;
    background: #98FB98;
    color: #282828;
}
.woocommerce div.product {
    position: relative;
}
.add-to-cart {
    min-width: 100%!important;
    background: #1e2232!important;
    color: white!important;
    border: none !important;
    height: 40px!important;
}
.add-to-cart a {
    color: white!important;
}
.s-products-simple .product-item {
    position: relative!important;
}
.product-item__bottom .add-to-cart .add_to_cart_button {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-item .woocommerce-LoopProduct-link img {
    margin-top: 10px;
}
.product-item__image {
    margin-top: 10px;
}
.products__list {
    justify-content: unset!important;
}
.woocommerce .star-rating {
    font-size: 0.8em!important;
}

@media (min-width: 1300px) {
    .header--sticky .header__main {
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        padding-top: 0;
        padding-bottom: 0;
    }
}
    /* Sticky Header Styles */
    .header {
        transition: transform 0.3s ease-in-out;
    }

    .header--sticky {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 999;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
        animation: slide-down 0.5s ease-out;
        background: #ffffffd6;
        backdrop-filter: blur(10px);
    }

    @keyframes slide-down {
        0% {
            transform: translateY(-100%);
        }
        100% {
            transform: translateY(0);
        }
    }

    .header__main {
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
    }
    .header--sticky:hover .header__main {
        max-height: 100px; /* Should be enough for header__main to show */
        opacity: 1;
        visibility: visible;
        padding-top: 13px;
        padding-bottom: 13px;
    }
    .menu-dropdown__nav ul {
        height: 600px;
        overflow-y: scroll;
        padding-right: 20px;
    }
@media (max-width: 590px) {
    .woocommerce div.product form.cart {
        display: flex;
        flex-direction: column;
        gap: 20px;
        max-width: 210px;
        margin-bottom: 15px;
    }
    .awooc-custom-order-button.button.alt.show-add-to-card {
        margin-left: 0!important;
    }
}
@media (max-width: 575px) {
    .shop-cat__image {
        width: 100% !important;
        height: 80px!important;
        background-repeat: no-repeat!important;
        background-size: 80px!important;
        background-position: left!important;
    }
}

.label-toggle h2 {
    padding-right: 50px!important;
}

.post-author-block {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.post-author-block .author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.post-author-block .author-details p {
    margin: 0;
    font-size: 16px;
    color: #555;
}

.post-author-block .author-details .author-name {
    margin-bottom: 8px;
}

.post-author-block .author-details .author-position {
    font-style: italic;
    margin-bottom: 8px;
}

.post-author-block .author-details .author-name-value {
    color: #0073aa;
    font-weight: bold;
}

/* Shortcode Products Styles */
.shortcode-products-container {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin: 30px 0;
    justify-content: center;
}

.shortcode-product-card {
    flex: 0 1 calc(33.333% - 20px);
    max-width: calc(33.333% - 20px);
    min-width: 250px;
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.shortcode-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.shortcode-product-card .product-image-link {
    display: block;
    padding: 15px;
}

.shortcode-product-card .product-image-link img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.shortcode-product-card .product-title {
    font-size: 18px;
    margin: 0 15px 10px;
    flex-grow: 1;
}

.shortcode-product-card .product-description {
    font-size: 14px;
    color: #666;
    margin: 0 15px 15px;
}

.shortcode-product-card .product-price {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0 15px 15px;
}

.shortcode-product-card .product-button {
    padding: 0 15px 20px;
}

.shortcode-product-card .product-button .button {
    width: 100%;
}

@media (max-width: 992px) {
    .shortcode-product-card {
        flex: 0 1 calc(50% - 15px);
        max-width: calc(50% - 15px);
    }
}

@media (max-width: 600px) {
    .shortcode-product-card {
        flex: 0 1 100%;
        max-width: 100%;
    }
}

/* Post Rating System Styles */
.post-rating-container {
    margin-bottom: 25px;
    padding: 15px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
}

.post-rating-container .rating-stars {
    font-size: 28px;
    color: #ccc;
    cursor: pointer;
    margin-bottom: 10px;
    position: relative;
}

.post-rating-container .rating-stars.is-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.post-rating-container .rating-stars:not(.has-rated) .star:hover,
.post-rating-container .rating-stars:not(.has-rated) .star.hover {
    color: #ffb400;
}

.post-rating-container .rating-stars .star.rated {
    color: #ffb400;
}

.post-rating-container .rating-stars.has-rated {
    cursor: not-allowed;
}

.post-rating-container .rating-info {
    font-size: 14px;
    color: #777;
}

.post-rating-container .rating-message {
    margin-top: 10px;
    font-weight: bold;
    color: #2c5a2c;
}

/* Related Posts Styles */
.related-posts-container {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.related-posts-container h2 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 30px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.related-post-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.related-post-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.related-post-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.related-post-title {
    font-size: 18px;
    margin: 0 0 10px 0;
}

.related-post-title a {
    text-decoration: none;
    color: #333;
}

.related-post-excerpt {
    font-size: 14px;
    color: #666;
    flex-grow: 1;
    margin-bottom: 15px;
}

.related-post-excerpt p {
    margin: 0;
}

.related-post-read-more {
    display: inline-block;
    background-color: #1e2232;
    color: #fff !important;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s ease;
    align-self: flex-start;
}

.related-post-read-more:hover {
    background-color: #3c4154;
}

/* Comments Section Styles */
.comments-area {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.comments-area .comments-title {
    font-size: 24px;
    margin-bottom: 20px;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.comment-list li {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.comment-list .children {
    list-style: none;
    padding-left: 40px;
}

.comment-body {
    display: grid;
    grid-template-areas: "author meta" "content content" "reply reply";
    grid-template-columns: auto 1fr;
    gap: 10px 20px;
}

.comment-author {
    grid-area: author;
    display: flex;
    align-items: center;
    gap: 15px;
}

.comment-author img {
    border-radius: 50%;
}

.comment-metadata {
    grid-area: meta;
    text-align: right;
    font-size: 13px;
    color: #888;
}

.comment-content {
    grid-area: content;
}

.reply {
    grid-area: reply;
}

/* Comment Form Styles */
.comment-form p {
    margin-bottom: 15px;
}

.comment-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.comment-form .required {
    color: red;
}

.form-submit .submit {
    background-color: #1e2232;
    color: #fff;
    padding: 12px 25px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.form-submit .submit:hover {
    background-color: #3c4154;
}
.related-products__title { 
    font-size: 28px;
}

.woocommerce-Tabs-panel--description div {
    min-height: 20px;
}

/* ----------------------------------------------------------------
   EU/Ukraine Facility co-funding badge over the product gallery
   (currently applied only for product ID 263 via PHP guard)
---------------------------------------------------------------- */
.single-product div.product {
    position: relative;
}

.eu-funding-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #ffffff;
    border: 1px solid #e3e7ef;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(20, 28, 60, 0.05);
    max-width: 180px;
}

.eu-funding-badge__flag {
    flex: 0 0 auto;
    width: 28px;
    height: auto;
    border-radius: 1px;
    display: block;
}

.eu-funding-badge__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 7px;
    line-height: 1.2;
    color: #1a2236;
}

.eu-funding-badge__line {
    display: block;
    font-weight: 500;
}

@media (max-width: 768px) {
    .eu-funding-badge {
        top: 6px;
        left: 6px;
        padding: 3px 6px;
        gap: 4px;
        max-width: 150px;
    }
    .eu-funding-badge__flag { width: 22px; }
    .eu-funding-badge__text { font-size: 6px; }
}

/* ----------------------------------------------------------------
   "Ми працюємо з:" + tender / payment items
   (rendered right after the default features list in the summary)
---------------------------------------------------------------- */
.tender-partners-block {
    margin: 18px 0 8px;
    padding: 16px 0 0;
    border-top: 1px solid #eef1f6;
}

.tender-partners-block__label {
    font-size: 14px;
    font-weight: 600;
    color: #1a2236;
    margin-bottom: 10px;
}

.tender-partners-block__logos {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.tender-partners-block__logo {
    display: block;
    width: auto;
    object-fit: contain;
}

.tender-partners-block__logo--prozorro {
    height: 36px;
}

.tender-partners-block__logo--treasury {
    height: 56px;
}

@media (max-width: 768px) {
    .tender-partners-block__logo--prozorro { height: 30px; }
    .tender-partners-block__logo--treasury { height: 46px; }
}

.tender-partners-block__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tender-partners-block__item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #1a2236;
    line-height: 1.35;
}

.tender-partners-block__icon {
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tender-partners-block__icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

.tender-partners-block__text {
    border-bottom: 1px solid transparent;
}

.tender-partners-block__item:last-child .tender-partners-block__text {
    border-bottom: 1px solid #1a2236;
    padding-bottom: 1px;
}

/* ============================================================
   Product gallery YouTube videos
   ============================================================ */

/* Main slider — video slide */
.wpgs-for .wpgs-video-slide {
    position: relative;
    width: 100%;
    height: 400px;
    background: #000;
    overflow: hidden;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.wpgs-for .wpgs-video-slide__placeholder {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.wpgs-for .wpgs-video-slide__placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}

.wpgs-for .wpgs-video-slide__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.92);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
    padding: 0;
}

.wpgs-for .wpgs-video-slide__play::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 14px 0 14px 22px;
    border-color: transparent transparent transparent #fff;
}

.wpgs-for .wpgs-video-slide__play:hover {
    transform: translate(-50%, -50%) scale(1.06);
    background: #ff0000;
}

.wpgs-for .wpgs-video-slide__iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    z-index: 2;
}

/* Nav thumbnail — video thumb */
.wpgs-nav .wpgs-video-thumb {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.wpgs-nav .wpgs-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wpgs-nav .wpgs-video-thumb__icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.92);
    pointer-events: none;
}

.wpgs-nav .wpgs-video-thumb__icon::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 5px 0 5px 8px;
    border-color: transparent transparent transparent #fff;
}

/* Match the main image max-height set by theme for videos too */
.single-product .wpgs-for .slick-slide .wpgs-video-slide {
    height: 400px;
}

@media (max-width: 768px) {
    .wpgs-for .wpgs-video-slide,
    .single-product .wpgs-for .slick-slide .wpgs-video-slide { height: 260px; }
    .wpgs-for .wpgs-video-slide__play { width: 60px; height: 60px; }
    .wpgs-for .wpgs-video-slide__play::before { border-width: 11px 0 11px 18px; }
    .wpgs-nav .wpgs-video-thumb__icon { width: 22px; height: 22px; }
    .wpgs-nav .wpgs-video-thumb__icon::before { border-width: 4px 0 4px 6px; }
}
