/*
Theme Name: Cake Land Hurt
Description: Motyw hurtowni B2B Cake Land.
Template: twentytwentyfive
Version: 1.0.0
Text Domain: cake-land-hurt
*/

/* Cake Land Hurt — wygląd B2B */
:root {
    --cl-pink: #c65b83;
    --cl-pink-light: #fbeef3;
    --cl-text: #29242a;
    --cl-border: #eae5e8;
}

body {
    color: var(--cl-text);
}

.wp-site-blocks > header {
    border-bottom: 1px solid var(--cl-border);
}

.wp-site-blocks > header .wp-block-site-title a {
    color: var(--cl-text);
    font-weight: 750;
    text-decoration: none;
}

.wp-block-search__input {
    border: 1px solid var(--cl-border);
    border-radius: 8px;
    font-size: 15px;
}

.wp-block-search__button,
.wp-block-button__link {
    background: var(--cl-pink);
    border-radius: 8px;
    color: #fff;
}

.wp-block-search__button:hover,
.wp-block-button__link:hover {
    background: #aa456c;
}

.wp-block-navigation a:hover {
    color: var(--cl-pink);
}

.woocommerce ul.products li.product {
    border: 1px solid var(--cl-border);
    border-radius: 12px;
    padding: 12px;
}

.woocommerce ul.products li.product img {
    border-radius: 8px;
}

.woocommerce ul.products li.product .button {
    border-radius: 7px;
}

@media (max-width: 782px) {
    .wp-site-blocks > header .wp-block-columns {
        gap: 12px;
    }
}

/* Cake Land Hurt — poprawiony nagłówek */
.wp-site-blocks > header .wp-block-group.alignfull {
    padding: 14px 30px !important;
}

.wp-site-blocks > header .wp-block-columns {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 30px;
}

.wp-site-blocks > header .wp-block-column {
    min-width: 0;
}

.wp-site-blocks > header .wp-block-column:first-child {
    flex: 0 0 190px !important;
}

.wp-site-blocks > header .wp-block-column:nth-child(2) {
    flex: 1 1 auto !important;
}

.wp-site-blocks > header .wp-block-column:last-child {
    flex: 0 0 auto !important;
}

.wp-site-blocks > header .wp-block-search {
    width: 100%;
    max-width: none;
}

.wp-site-blocks > header .wp-block-search__inside-wrapper {
    width: 100%;
}

.wp-site-blocks > header .wp-block-search__input {
    flex: 1;
    min-width: 0;
}

.wp-site-blocks > header .wp-block-navigation__container {
    display: flex;
    flex-wrap: nowrap;
    gap: 22px;
}

.wp-site-blocks > header .wp-block-site-title {
    font-size: 24px;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .wp-site-blocks > header .wp-block-columns {
        flex-wrap: wrap;
        gap: 15px;
    }

    .wp-site-blocks > header .wp-block-column {
        flex: 1 1 100% !important;
    }
}

/* Nagłówek Cake Land Hurt — wersja 2 */
.wp-site-blocks > header .cl-header {
    padding: 16px 30px !important;
}

.wp-site-blocks > header .cl-header-row {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 32px;
}

.wp-site-blocks > header .cl-logo {
    flex: 0 0 210px;
    margin: 0;
    white-space: nowrap;
    font-size: 24px;
    font-weight: 750;
}

.wp-site-blocks > header .cl-search {
    flex: 1 1 500px;
    width: auto;
    max-width: 650px;
    min-width: 250px;
    margin: 0;
}

.wp-site-blocks > header .cl-search .wp-block-search__inside-wrapper {
    display: flex;
    width: 100%;
}

.wp-site-blocks > header .cl-search .wp-block-search__input {
    width: 100%;
    min-width: 0;
    flex: 1;
}

.wp-site-blocks > header .cl-menu {
    flex: 0 0 auto;
    margin: 0;
}

.wp-site-blocks > header .cl-menu .wp-block-navigation__container {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 22px;
}

@media (max-width: 950px) {
    .wp-site-blocks > header .cl-header-row {
        flex-wrap: wrap;
        gap: 14px;
    }

    .wp-site-blocks > header .cl-logo {
        flex: 1 1 100%;
    }

    .wp-site-blocks > header .cl-search {
        flex: 1 1 100%;
        max-width: none;
    }
}

/* Cake Land Hurt — układ strony głównej */

/* Ukrycie automatycznego tytułu strony głównej */
body.home .wp-block-post-title,
body.home .entry-title {
    display: none !important;
}

/* Zmniejszenie odstępów strony głównej */
body.home main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.home .cl-hero {
    margin-top: 0 !important;
    padding-top: 38px !important;
    padding-bottom: 42px !important;
    background: #fbeef3;
    border-radius: 14px;
}

body.home .cl-hero h1 {
    font-size: clamp(30px, 3vw, 44px);
    margin-bottom: 16px;
}

body.home .cl-hero p {
    margin-top: 12px;
    margin-bottom: 12px;
}

body.home .cl-hero .wp-block-buttons {
    margin-top: 24px;
}

/* Cake Land Hurt — porządkowanie strony głównej */

/* Usunięcie pustej przestrzeni nad banerem */
body.home .wp-site-blocks > main {
    margin-block-start: 0 !important;
    padding-block-start: 0 !important;
}

body.home main .wp-block-post-content {
    margin-block-start: 0 !important;
}

body.home .wp-block-post-content > .cl-hero:first-child {
    margin-block-start: 0 !important;
}

/* Ukrycie zbędnych ikon WooCommerce w nagłówku */
.wp-site-blocks > header .wc-block-mini-cart,
.wp-site-blocks > header .wc-block-customer-account {
    display: none !important;
}

/* Wyrównanie odstępów między sekcjami */
body.home .wp-block-post-content > h2 {
    margin-top: 32px;
    margin-bottom: 18px;
    font-size: 28px;
}

/* Kompaktowe przyciski */
body.home .cl-hero .wp-block-button__link {
    padding: 13px 24px;
    font-size: 15px;
}

/* CAKE LAND HURT — KATALOG B2B */

body.post-type-archive-product main,
body.tax-product_cat main,
body.single-product main {
    max-width: 1320px;
    width: calc(100% - 48px);
    margin-left: auto !important;
    margin-right: auto !important;
}

.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    padding: 0;
    margin: 24px 0 40px;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none;
}

.woocommerce ul.products li.product {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    min-width: 0;
    padding: 14px !important;
    border: 1px solid #ece7ea;
    border-radius: 12px;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: box-shadow .2s, border-color .2s;
}

.woocommerce ul.products li.product:hover {
    border-color: #e5bfd0;
    box-shadow: 0 6px 22px rgba(35, 20, 30, .07);
}

.woocommerce ul.products li.product img {
    width: 100% !important;
    aspect-ratio: 1 / 1;
    height: auto !important;
    object-fit: contain;
    margin: 0 0 12px !important;
    border-radius: 8px;
    background: #f8f8f8;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    color: #29242a;
    font-size: 15px !important;
    line-height: 1.45;
    font-weight: 600;
    min-height: 44px;
    padding: 0 !important;
}

.woocommerce ul.products li.product .price {
    color: #343034;
    font-size: 16px;
    font-weight: 700;
    margin: 10px 0;
}

.woocommerce ul.products li.product .button {
    margin-top: auto !important;
    padding: 12px 16px;
    font-size: 13px;
    text-align: center;
    background: #c65b83;
    color: #fff;
}

.woocommerce .woocommerce-result-count {
    font-size: 14px;
    color: #777;
}

.woocommerce .woocommerce-ordering select {
    padding: 10px 14px;
    border: 1px solid #e5dfe3;
    border-radius: 8px;
    background: #fff;
}

/* KARTA POJEDYNCZEGO PRODUKTU */

.woocommerce div.product {
    margin-top: 20px;
}

.woocommerce div.product .product_title {
    font-size: clamp(25px, 2.3vw, 36px);
    line-height: 1.25;
    font-weight: 650;
}

.woocommerce div.product div.images img {
    border-radius: 12px;
    background: #fafafa;
    object-fit: contain;
}

.woocommerce div.product div.images .flex-control-thumbs img {
    border-radius: 7px;
}

.woocommerce div.product .summary .price {
    color: #29242a;
    font-size: 24px;
    font-weight: 700;
}

.woocommerce div.product form.cart .qty {
    min-height: 44px;
    border: 1px solid #e5dfe3;
    border-radius: 7px;
    padding: 6px;
}

.woocommerce div.product .single_add_to_cart_button {
    min-height: 44px;
    padding: 12px 24px;
    border-radius: 8px;
    background: #c65b83;
}

.woocommerce div.product .woocommerce-tabs {
    margin-top: 35px;
}

.woocommerce div.product .woocommerce-tabs table {
    width: 100%;
}

/* RESPONSYWNOŚĆ */

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

@media (max-width: 760px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .woocommerce ul.products li.product {
        padding: 10px !important;
    }

    body.post-type-archive-product main,
    body.tax-product_cat main,
    body.single-product main {
        width: calc(100% - 24px);
    }

    .woocommerce div.product div.images,
    .woocommerce div.product div.summary {
        width: 100% !important;
        float: none !important;
    }
}

@media (max-width: 420px) {
    .woocommerce ul.products {
        gap: 8px;
    }

    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 13px !important;
    }
}

/* Cake Land Hurt — kompaktowe karty katalogowe */

.woocommerce ul.products {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    justify-content: start;
}

.woocommerce ul.products li.product {
    max-width: 300px;
}

.woocommerce ul.products li.product img {
    max-height: 260px;
    object-fit: contain;
}

.woocommerce ul.products li.product .button {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1100px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 760px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Cake Land Hurt — katalog WooCommerce: klasyczny i blokowy */

/* Cztery kolumny produktów */
body.woocommerce-shop ul.products,
body.post-type-archive-product ul.products,
body.tax-product_cat ul.products,
body.woocommerce-shop ul.wc-block-product-template,
body.post-type-archive-product ul.wc-block-product-template,
body.tax-product_cat ul.wc-block-product-template {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 18px !important;
    width: 100% !important;
    max-width: 1320px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Kompaktowe kafelki */
body.woocommerce-shop li.product,
body.post-type-archive-product li.product,
body.tax-product_cat li.product,
.wc-block-product-template > li {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border: 1px solid #eee7eb;
    border-radius: 12px;
    padding: 12px !important;
    overflow: hidden;
    background: #fff;
}

/* Zdjęcia produktów */
body.woocommerce-shop li.product img,
body.post-type-archive-product li.product img,
body.tax-product_cat li.product img,
.wc-block-product-template > li img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 240px !important;
    aspect-ratio: 1 / 1;
    object-fit: contain !important;
    border-radius: 8px;
}

/* Mniejsze ekrany */
@media (max-width: 1050px) {
    body.woocommerce-shop ul.products,
    body.post-type-archive-product ul.products,
    body.tax-product_cat ul.products,
    ul.wc-block-product-template {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 700px) {
    body.woocommerce-shop ul.products,
    body.post-type-archive-product ul.products,
    body.tax-product_cat ul.products,
    ul.wc-block-product-template {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
}
