/*
 * PinkPillow – Powiązane produkty
 * Frontend CSS ładowany tylko wtedy, gdy shortcode zwraca rekomendacje.
 */

/* ==========================================================================
   1. Sekcje rekomendacji i nagłówki
   ========================================================================== */

.pinkpillow-related-products {
    box-sizing: border-box;
    clear: both;
    width: 100%;
    margin: 0px 0 28px;
}

.pinkpillow-related-products *,
.pinkpillow-related-products *::before,
.pinkpillow-related-products *::after {
    box-sizing: border-box;
}

.pinkpillow-related-products .pinkpillow-related-products__title {
    margin: 0 0 22px;
    padding: 0;
    color: var(--e-global-color-text);
    font-family: "Abhaya Libre", sans-serif;
    font-size: 22px;
    font-weight: 600;
    line-height: 30px;
    text-align: center;
    text-transform: uppercase !important;
}

/* ==========================================================================
   2. Siatka produktów i karty WooCommerce
   ========================================================================== */

.pinkpillow-related-products ul.products {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 24px 16px;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}

.pinkpillow-related-products ul.products::before,
.pinkpillow-related-products ul.products::after {
    display: none !important;
    content: none !important;
}

.pinkpillow-related-products ul.products li.product {
    float: none !important;
    clear: none !important;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center;
}

.pinkpillow-related-products ul.products li.product a img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 0 10px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.pinkpillow-related-products-other ul.products li.product .woocommerce-loop-product__title,
.pinkpillow-related-products-same ul.products li.product .woocommerce-loop-product__title {
    padding: 0;
    color: var(--e-global-color-text);
    font-family: "Abhaya Libre", sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.2;
    margin-top: 14px;
    margin-bottom: 10px;
}

.pinkpillow-related-products-full ul.products li.product .woocommerce-loop-product__title {
    padding: 0;
    color: var(--e-global-color-text);
    font-family: "Abhaya Libre", sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.2;
	margin-bottom: 0;
}

.pinkpillow-related-products ul.products li.product .price {
    color: #1d2327;
    font-family: inherit;
    font-size: inherit;
}

.pinkpillow-related-products ul.products li.product .button,
.pinkpillow-related-products ul.products li.product a.button {
    display: inline-block;
    max-width: 100%;
    margin: 0 auto !important;
    border: 0;
    border-radius: 20px;
    background: #bd8aa7;
    color: #fff;
    font-size: 16px;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    white-space: normal;
}

.pinkpillow-related-products ul.products li.product .button:hover,
.pinkpillow-related-products ul.products li.product a.button:hover {
    background: #a97593;
    color: #fff;
}

/* ==========================================================================
   3. Układ: produkty + „Zobacz więcej”
   ========================================================================== */
.pinkpillow-related-products-other .pinkpillow-related-products__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    align-items: center;
    gap: 20px;
}

.pinkpillow-related-products-other .pinkpillow-related-products__row > .woocommerce > ul.products {
    min-width: 0;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.pinkpillow-related-products .pinkpillow-related-products__more-wrap {
    display: flex;
    justify-content: center;
    margin: 24px 0 0;
}

.pinkpillow-related-products .pinkpillow-related-products__row .pinkpillow-related-products__more-wrap {
    align-items: center;
    margin: 0;
}

/* Bazowy wygląd elementu „Zobacz więcej”. */
.pinkpillow-related-products .pinkpillow-related-products__more {
    display: inline-block;
    min-width: 145px;
    padding: 10px 24px;
    border: 0;
    border-radius: 24px;
    background: #bd8aa7;
    color: #fff;
    font: inherit;
    font-size: 13px;
    line-height: 1.3;
    text-align: center;
    opacity: 1;
    cursor: default;
}

.pinkpillow-related-products .pinkpillow-related-products__more:disabled {
    opacity: 1;
}

/* Wygląd elementu w układzie obok produktów. */
.pinkpillow-related-products .pinkpillow-related-products__row .pinkpillow-related-products__more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    padding: 8px 0;
    border-radius: 0;
    background: transparent;
    color: #514d50;
    font-family: "Abhaya Libre", serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.15;
    text-decoration: none;
    cursor: pointer;
}

.pinkpillow-related-products .pinkpillow-related-products__more-label {
    max-width: 75px;
    text-align: center;
	font-weight: 600;
}


.pinkpillow-related-products .pinkpillow-related-products__more-arrow {
    position: relative;
    display: inline-flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    box-sizing: border-box;
    border: 2.5px solid currentColor;
    border-radius: 50%;
    margin: 8px auto 0;
    padding: 0;
    font-size: 0 !important;
    line-height: 1;
}

.pinkpillow-related-products .pinkpillow-related-products__more-arrow::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
	border-top: 2.5px solid currentColor;
	border-right: 2.5px solid currentColor;
    transform: translateY(-50%) rotate(45deg);
}


/* „Mogą Cię zainteresować” — widoczny element bez aktywnego linku. */
.pinkpillow-related-products .pinkpillow-related-products__more--disabled {
    cursor: default;
}

/* ==========================================================================
   4. Sekcja rekomendacji w koszyku
   ========================================================================== */

.pinkpillow-related-products-cart {
    margin-top: 30px;
    padding-top: 8px;
}

/* Nagłówek „Dorzuć do koszyka”. */
.pinkpillow-related-products-cart .pinkpillow-related-products__title {
    margin: 20px 0 24px;
    padding: 0;
    color: #777174 !important;
    font-family: "Abhaya Libre", serif !important;
    font-size: 25px !important;
    font-style: italic;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    text-align: center;
    text-transform: none !important;
}

/* Różowy akcent w nagłówku koszyka. */
.pinkpillow-related-products-cart .pinkpillow-title-accent {
    color: #bb8ea7 !important;
    font-weight: 600 !important;
}

/* Nagłówek promocyjny w koszyku. */
.pinkpillow-related-products-cart .pinkpillow-cart-promo-title {
    display: block;
    margin: 20px 0 24px;
    padding: 0;
    color: #514d50 !important;
    font-family: "Abhaya Libre", serif !important;
    font-size: 30px !important;
    font-style: italic !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    text-align: center;
    text-transform: none !important;
}

/* „Dorzuć” i „Zaoszczędź” — różowy krój Pacifico. */
.pinkpillow-related-products-cart .pinkpillow-promo-highlight {
    color: #bb8ea7 !important;
    font-family: "Pacifico", cursive !important;
    font-size: 0.92em;
    font-style: normal !important;
    font-weight: 400 !important;
}

/* Pozostały tekst — ciemnoszara kursywa. */
.pinkpillow-related-products-cart .pinkpillow-promo-rest {
    color: #514d50 !important;
    font-family: "Abhaya Libre", serif !important;
    font-style: italic !important;
    font-weight: 400 !important;
}

/* ==========================================================================
   5. Responsywność: tablet i telefon
   Na mniejszych ekranach CTA zajmuje slot szóstej karty.
   ========================================================================== */

@media (max-width: 1024px) {
    /* Sześć miejsc: 5 produktów + „Zobacz więcej”. */
    .pinkpillow-related-products-other .pinkpillow-related-products__row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
        gap: 24px 16px;
    }
	
	.pinkpillow-related-products-same ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* WooCommerce otacza listę produktów dodatkowym div.woocommerce.
       Spłaszczamy oba wrappery, aby produkty i CTA były elementami tej samej siatki. */
    .pinkpillow-related-products-other .pinkpillow-related-products__row > .woocommerce,
    .pinkpillow-related-products-other .pinkpillow-related-products__row > .woocommerce > ul.products {
        display: contents !important;
    }

	.pinkpillow-related-products-other .pinkpillow-related-products__row > .woocommerce > ul.products > li.product:nth-child(n+6) {
		display: none !important;
	}

    /* Jawne pozycje kart eliminują wpływ reguł układu Astra/WooCommerce. */
    .pinkpillow-related-products-other .pinkpillow-related-products__row > .woocommerce > ul.products > li.product:nth-child(1) { grid-column: 1; grid-row: 1; }
    .pinkpillow-related-products-other .pinkpillow-related-products__row > .woocommerce > ul.products > li.product:nth-child(2) { grid-column: 2; grid-row: 1; }
    .pinkpillow-related-products-other .pinkpillow-related-products__row > .woocommerce > ul.products > li.product:nth-child(3) { grid-column: 3; grid-row: 1; }
    .pinkpillow-related-products-other .pinkpillow-related-products__row > .woocommerce > ul.products > li.product:nth-child(4) { grid-column: 1; grid-row: 2; }
    .pinkpillow-related-products-other .pinkpillow-related-products__row > .woocommerce > ul.products > li.product:nth-child(5) { grid-column: 2; grid-row: 2; }

    .pinkpillow-related-products-other .pinkpillow-related-products__row .pinkpillow-related-products__more-wrap {
        display: flex;
        grid-column: 3;
        grid-row: 2;
        align-items: center;
        justify-content: center;
        min-width: 0;
        margin: 0;
        padding: 0;
		background: #F8F7F3;
    }

    .pinkpillow-related-products-other .pinkpillow-related-products__row .pinkpillow-related-products__more {
        display: flex;
        width: 100%;
        min-width: 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 7px;
        padding: 8px 2px;
        font-size: 18px;
        text-align: center;
    }

    .pinkpillow-related-products .pinkpillow-related-products__more-label {
        max-width: 100%;
    }

    .pinkpillow-related-products .pinkpillow-related-products__more-arrow {
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
        font-size: 21px;
    }
	
	.pinkpillow-related-products ul.products li.product .woocommerce-loop-product__title {
		font-size: 16px;
		min-height: 60px;
	}
}

@media (max-width: 767px) {
    .pinkpillow-related-products {
        margin-top: 28px;
        margin-bottom: 24px;
    }

    /* 5 produktów + CTA w szóstym slocie (3. rząd, 2. kolumna). */
    .pinkpillow-related-products-other .pinkpillow-related-products__row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px 12px;
    }
	
	.pinkpillow-related-products-same ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pinkpillow-related-products-other .pinkpillow-related-products__row .pinkpillow-related-products__more-wrap {
        grid-column: 2;
        grid-row: 3;
    }

    /* Na telefonie: 2 kolumny, pięć kart w kolejności czytania, CTA jako szósta. */
    .pinkpillow-related-products-other .pinkpillow-related-products__row > .woocommerce > ul.products > li.product:nth-child(1) { grid-column: 1; grid-row: 1; }
    .pinkpillow-related-products-other .pinkpillow-related-products__row > .woocommerce > ul.products > li.product:nth-child(2) { grid-column: 2; grid-row: 1; }
    .pinkpillow-related-products-other .pinkpillow-related-products__row > .woocommerce > ul.products > li.product:nth-child(3) { grid-column: 1; grid-row: 2; }
    .pinkpillow-related-products-other .pinkpillow-related-products__row > .woocommerce > ul.products > li.product:nth-child(4) { grid-column: 2; grid-row: 2; }
    .pinkpillow-related-products-other .pinkpillow-related-products__row > .woocommerce > ul.products > li.product:nth-child(5) { grid-column: 1; grid-row: 3; }

    .pinkpillow-related-products-other .pinkpillow-related-products__row .pinkpillow-related-products__more {
        font-size: 17px;
    }

    /* Zachowane wcześniejsze style nagłówków rekomendacji w koszyku. */
    .pinkpillow-related-products-cart .pinkpillow-related-products__title {
        margin: 16px 0 20px;
        font-size: 21px !important;
    }

    .pinkpillow-related-products-cart .pinkpillow-cart-promo-title {
        margin: 16px 0 20px;
        font-size: 25px !important;
    }
	
	.pinkpillow-related-products ul.products li.product .woocommerce-loop-product__title {
		min-height: 80px;
	}
	
	.pinkpillow-related-products ul.products li.product .price {
    font-size: 18px;
}
}


/* ========================================================================== 
   7. Osobna strona pełnych rekomendacji (ładowana tylko na żądanie)
   ========================================================================== */

.pinkpillow-related-products-full .pinkpillow-related-products__title {
    margin-bottom: 12px;
    font-size: 30px;
    line-height: 1.25;
}

.pinkpillow-related-products-full__intro a,
.pinkpillow-related-products-full__back a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pinkpillow-related-products-full ul.products {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px 20px;
}

.pinkpillow-related-products-full__pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 36px 0 24px;
}

.pinkpillow-related-products-full__page-number,
.pinkpillow-related-products-full__page-link {
    display: inline-flex;
    min-width: 42px;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid #d8c7d0;
    border-radius: 22px;
    color: inherit;
    text-decoration: none;
}

.pinkpillow-related-products-full__page-number[aria-current="page"] {
    border-color: #bd8aa7;
    background: #bd8aa7;
    color: #fff;
}

.pinkpillow-related-products-full__back {
    margin: 24px 0 0;
    text-align: center;
}

@media (max-width: 1024px) {
    .pinkpillow-related-products-full ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .pinkpillow-related-products-full {
        margin: 0px auto;
    }

    .pinkpillow-related-products-full .pinkpillow-related-products__title {
        font-size: 22px;
    }

    .pinkpillow-related-products-full ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px 12px;
    }
}


/* ==========================================================================
   8. Nagłówek strony pełnych rekomendacji — stylistyka PinkPillow
   ========================================================================== */
.pinkpillow-related-products-full .pp-recommendations-hero {
    width: 100%;
    padding: 18px 4% 28px;
    background: #fff;
    text-align: center;
}

.pinkpillow-related-products-full .pp-recommendations-hero__eyebrow {
    display: inline-block;
    margin: 0 0 8px;
    color: #bb8ea7;
    font-family: "Pacifico", cursive;
    font-size: 23px;
    font-weight: 400;
    line-height: 1.4;
    transform: rotate(-1.5deg);
}

.pinkpillow-related-products-full .pp-recommendations-hero__title {
    margin: 0;
    color: #292629;
    font-family: "Poppins", sans-serif;
    font-size: clamp(34px, 4.5vw, 52px);
    font-weight: 650;
    line-height: 1.12;
    letter-spacing: -1.5px;
}

.pinkpillow-related-products-full .pp-recommendations-hero__highlight {
    position: relative;
    display: inline-block;
    z-index: 1;
}

.pinkpillow-related-products-full .pp-recommendations-hero__highlight::before {
    content: "";
    position: absolute;
    left: -3%;
    right: -4%;
    bottom: 0;
    height: 30%;
    border-radius: 45% 55% 48% 52% / 55% 45% 55% 45%;
    background: #fbcbe3;
    transform: rotate(-1.5deg);
    z-index: -1;
}

.pinkpillow-related-products-full .pp-recommendations-hero__desc {
    width: 100%;
    max-width: 850px;
    margin: 18px auto 0 !important;
    color: #625e61;
    font-family: "Poppins", sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.7;
}

.pinkpillow-related-products-full .pp-recommendations-hero__desc a {
    color: #4c494b;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 768px) {
    .pinkpillow-related-products-full .pp-recommendations-hero {
        padding: 0px 8px 22px;
    }
    .pinkpillow-related-products-full .pp-recommendations-hero__eyebrow {
        font-size: 20px;
    }
    .pinkpillow-related-products-full .pp-recommendations-hero__title {
        font-size: clamp(30px, 8vw, 40px);
        letter-spacing: -1px;
    }
    .pinkpillow-related-products-full .pp-recommendations-hero__desc {
        margin-top: 14px !important;
        font-size: 14px;
        line-height: 1.65;
    }
}
