/**
 * Style dla sekcji masthead pojedynczego produktu
 */

/* ========================================
   Related Products Grid
   ======================================== */
.products-grid-container {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    transition: max-height 0.35s ease-in-out,
                opacity 0.3s ease-in-out,
                margin-top 0.35s ease-in-out;
}

.rounded.is-expanded .products-grid-container {
    max-height: 600px;
    opacity: 1;
    margin-top: 8px;
}

.products-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.product-item {
    flex: 0 0 auto;
}

/* Mobile Grid */
@media (max-width: 767px) {
    .products-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .product-item {
        max-width: none;
    }

    .show-more-btn {
        grid-column: 3;
        grid-row: 1;
        align-self: stretch;
    }
}

/* Desktop Grid */
@media (min-width: 768px) {
    .products-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }

    .show-more-btn {
        order: 4;
    }

}

/* ========================================
   Additional Products Animation
   ======================================== */
.additional-product {
    display: none;
    transition: all 0.3s ease-in-out;
    opacity: 0;
    transform: scale(0.95);
    max-height: 0;
    overflow: hidden;
}

.additional-product.product-visible {
    display: block;
    opacity: 1;
    transform: scale(1);
    max-height: 150px;
    animation: relatedProductReveal 0.25s ease-out;
}

@media (min-width: 768px) {
    .rounded.is-expanded .products-grid-container {
        max-height: none;
    }

    .mobile-additional-product:not(.desktop-additional-product) {
        display: block;
        opacity: 1;
        transform: none;
        max-height: none;
        overflow: visible;
    }

    .desktop-additional-product {
        display: none;
        order: 5;
    }

    .desktop-additional-product.product-visible {
        display: block;
        opacity: 1;
        transform: none;
        max-height: none;
        overflow: visible;
        animation: relatedProductReveal 0.25s ease-out;
    }
}

@keyframes relatedProductReveal {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   Show More Button
   ======================================== */
.show-more-btn {
    appearance: none;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: inherit;
    transition: all 0.2s ease-in-out;
}

.show-more-btn > div {
    height: 100%;
}

.show-more-btn:hover {
    transform: scale(1.05);
}

/* ========================================
   Product Tooltip
   ======================================== */
.product-tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                left 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                top 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 280px;
}

.product-tooltip.tooltip-position-instant {
    transition-property: opacity, transform;
}

.product-tooltip.tooltip-visible {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-content {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    word-wrap: break-word;
    text-align: center;
}

.tooltip-arrow {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(0, 0, 0, 0.9);
    bottom: -7px;
}

.product-tooltip.tooltip-bottom .tooltip-arrow {
    top: -7px;
    bottom: auto;
    border-top: none;
    border-bottom: 8px solid rgba(0, 0, 0, 0.9);
}

/* ========================================
   Tooltip Container Hover Effects
   ======================================== */
.product-tooltip-container {
    position: relative;
}

.product-tooltip-container:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease-in-out;
}

.product-tooltip-container:hover a {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ========================================
   Post Content Styling
   ======================================== */
.single-product-masthead .leading-8 * {
    font-family: 'Instrument Sans' !important;
    background-color: transparent !important;
}

@media (min-width: 640px) {
    .single-product-masthead .leading-8 * {
        font-size: 1rem !important;
    }
}

.post-leading p:not(:last-child) {
    margin-bottom: 1.5rem;
}

.post-leading iframe {
    width: 100%;
}

.post-leading a {
    color: var(--primary-claret);
    text-decoration: underline;
    text-underline-position: 2px;
    font-weight: 600;
}

.post-leading a:hover {
    color: var(--secondary-claret);
}
