/* karta produktu */

.single-product .product .card .product-head {
    display: flex !important;
    position: static !important;
    text-align: left !important;
    flex-direction: column !important;
    align-items: center !important;
}

.single-product .product .card .product-head .product-image {
    display: flex !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    height: auto !important;
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
}

.single-product .product .card .product-head .product-image img {
    width: 450px !important;
    height: 450px !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    display: block !important;
    max-width: 100% !important;
} */


@media (max-width: 991px) {
    .single-product .product .card .product-head .product-image img {
        width: 350px !important;
        height: 350px !important;
    }
}

.single-product-flex {
    display: flex !important;
    flex-direction: row !important;
    gap: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.product-head {
    flex: 0 0 450px;
    max-width: 450px;
    width: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.product-row {
    flex: 1 1 0;
    min-width: 0;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.single-product-flex {
    display: flex !important;
    flex-direction: row !important;
    gap: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.product-head {
    flex: 1 1 42%;
    max-width: 42%;
    width: 42%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.product-image {
    width: 100%;
    display: flex;
	align-items: left;
}

.product-image img {
    width: 100%;
    max-width: 500px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.product-row {
    flex: 1 1 45%;
    max-width: 45%;
    width: 45%;
    display: flex;
    flex-direction: column;
    gap: 24px;
    justify-content: flex-start;
}

.main-product-price .price {
    font-size: 36px !important;
    font-weight: 700;
    color: #e94f1a;
    margin: 16px 0 8px 0;
    line-height: 1.1;
    letter-spacing: -1px;
    display: block;
}


/* Responsywność */

@media (max-width: 991px) {
    .single-product-flex {
        flex-direction: column !important;
        gap: 24px;
    }
    .product-head,
    .product-row {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        padding-left: 0 !important;
    }
    .product-image img {
        width: 350px !important;
        max-width: 100% !important;
        height: auto !important;
    }
    .purchase .single_add_to_cart_button {
        min-width: 0;
        width: 100%;
        font-size: 18px;
    }
}

.purchase {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.purchase .single_add_to_cart_button {
    white-space: nowrap;
    min-width: 220px;
    font-size: 20px;
    margin-left: 0; 
}

.custom-variants {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
}

.custom-variants a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: #fff;
    transition: box-shadow 0.2s, border-color 0.2s;
    border: 2px solid #eee;
    overflow: hidden;
}

.custom-variants a:hover {
    border-color: #feb300;
    box-shadow: 0 2px 12px rgba(254,179,0,0.15);
}

.custom-variants {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
}

.custom-variants a {
    width: 160px !important;
    height: 160px !important;
    min-width: 160px !important;
    min-height: 160px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: #fff;
    border: 2px solid #eee;
    overflow: hidden;
    padding: 0;
    margin: 0;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.custom-variants a:hover {
    border-color: #feb300;
    box-shadow: 0 2px 12px rgba(254,179,0,0.15);
}

.custom-variants img.productsiteimage {
    width: 120px !important;
    height: 120px !important;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* 4 kolumny sklepu */

#products > a.product {
    width: calc((100% - 80px * 3) / 4) !important;
    margin-bottom: 80px !important;
    text-decoration: none !important;
    text-align: center !important;
}

#products > a.product:not(:nth-of-type(4n)) {
    margin-right: 80px !important;
}

/* 3 kolumny na szerokości do 1200px */
@media (max-width: 1200px) {
    #products.products > a.product {
        width: calc((100% - 60px * 2) / 3) !important;
    }
    #products.products > a.product:not(:nth-of-type(4n)) {
        margin-right: 0 !important;
    }
    #products.products > a.product:not(:nth-of-type(3n)) {
        margin-right: 60px !important;
    }
}


/* 3 kolumny na szerokości do 991px */
@media (max-width: 991px) {
  #products,
  #products.products {
    display: block !important;
  }
  #products.products > a.product {
    width: 100% !important;
    max-width: 100% !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
    float: none !important;
  }
  /* Nadpisz WSZYSTKIE marginesy z desktopa */
  #products.products > a.product:not(:nth-of-type(4n)),
  #products.products > a.product:not(:nth-of-type(3n)),
  #products.products > a.product:not(:nth-of-type(2n)) {
    margin-right: 0 !important;
    margin-left: 0 !important;
  }
}