/**
 * BabyWarm Custom Styles
 * PROSTY CSS - pozwala WooCommerce działać normalnie
 *
 * @package BabyWarm
 * @since 1.0.0
 */

/* Material Icons */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined' !important;
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'liga';
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Lazy Loading */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Products Grid */
ul.products {
    list-style: none !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    gap: 2rem !important;
}

.related.products ul.products {
    grid-template-columns: repeat(4, 1fr) !important;
}

@media (max-width: 1023px) {
    .related.products ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 639px) {
    .related.products ul.products {
        grid-template-columns: 1fr !important;
    }
}

/* WooCommerce Gallery - MINIMALNE style */
.woocommerce-product-gallery {
    max-width: 32rem;
    margin: 0 auto;
}

/* *** KRYTYCZNE - overflow na .flex-viewport *** */
.woocommerce-product-gallery .flex-viewport {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden !important; /* To ukrywa przewijanie! */
    border: none !important;
}

/* Ukryj lupę zoom */
.woocommerce-product-gallery__trigger {
    display: none !important;
}

/* Ukryj badge SALE */
.woocommerce-product-gallery .onsale {
    display: none !important;
}

/* Ukryj nawigację FlexSlider (strzałki) */
.flex-direction-nav {
    display: none !important;
}

/* WooCommerce Tabs - style zgodne z motywem */
.woocommerce-tabs {
    margin-top: 3rem !important;
}

.woocommerce-tabs .tabs {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 2rem 0 !important;
    display: flex !important;
    gap: 2rem !important;
    border-bottom: 2px solid #e5e7eb !important;
}

.woocommerce-tabs .tabs li {
    margin: 0 !important;
    padding: 0 0 1rem 0 !important;
}

.woocommerce-tabs .tabs li a {
    font-weight: 600 !important;
    color: #6B6B6B !important;
    text-decoration: none !important;
    padding-bottom: 1rem !important;
    display: block !important;
    transition: color 0.2s !important;
}

.woocommerce-tabs .tabs li.active a {
    color: #BF6060 !important;
    border-bottom: 2px solid #BF6060 !important;
}

.woocommerce-tabs .tabs li a:hover {
    color: #BF6060 !important;
}

.woocommerce-tabs .panel {
    padding: 2rem !important;
    background-color: white !important;
    border-radius: 0.5rem !important;
    border: 1px solid #e5e7eb !important;
}

.woocommerce-tabs .panel h2 {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
}

/* Formularz recenzji */
#review_form_wrapper {
    margin-top: 2rem !important;
}

#commentform {
    max-width: none !important;
}

#commentform p {
    margin-bottom: 1rem !important;
}

#commentform label {
    display: block !important;
    margin-bottom: 0.5rem !important;
    font-weight: 600 !important;
}

#commentform input[type="text"],
#commentform input[type="email"],
#commentform textarea {
    width: 100% !important;
    padding: 0.75rem !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.5rem !important;
    font-family: 'Poppins', sans-serif !important;
}

#commentform input:focus,
#commentform textarea:focus {
    outline: none !important;
    border-color: #BF6060 !important;
    box-shadow: 0 0 0 3px rgba(191, 96, 96, 0.1) !important;
}

/* Gwiazdki recenzji - PROSTE rozwiązanie */
.comment-form-rating {
    margin-bottom: 1.5rem !important;
}

.comment-form-rating label {
    display: block !important;
    margin-bottom: 0.5rem !important;
    font-weight: 600 !important;
}

/* Kontener gwiazdek */
.stars {
    display: flex !important;
    gap: 0.25rem !important;
    margin: 0.5rem 0 !important;
}

/* Linki gwiazdek */
.stars a {
    font-size: 0 !important; /* Ukryj tekst */
    width: 2rem !important;
    height: 2rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    position: relative !important;
}

/* Gwiazdka jako ::before z unicode */
.stars a::before {
    content: "★" !important;
    font-size: 2rem !important;
    color: #d1d5db !important; /* Szara domyślnie */
    display: block !important;
    line-height: 1 !important;
    font-family: Arial, sans-serif !important;
}

/* Złota gwiazdka przy hover/active */
.stars a:hover::before,
.stars a.active::before {
    color: #fbbf24 !important;
}

/* Wypełnij wszystkie gwiazdki do klikniętej */
.stars a.star-1.active ~ a::before,
.stars a.star-2.active ~ a::before,
.stars a.star-3.active ~ a::before,
.stars a.star-4.active ~ a::before,
.stars a.star-5.active ~ a::before {
    color: #d1d5db !important;
}

/* Wypełnij przy hover */
.stars a:hover::before,
.stars a:hover ~ a::before {
    color: #d1d5db !important;
}

.stars:hover a:hover::before {
    color: #fbbf24 !important;
}

.stars:hover a:hover ~ a::before {
    color: #d1d5db !important;
}

/* Napraw kolejność - wypełnij od lewej */
.stars a:first-child:hover ~ a::before {
    color: #d1d5db !important;
}

/* Przycisk wyślij recenzję */
#commentform #submit {
    background-color: #BF6060 !important;
    color: white !important;
    padding: 0.75rem 2rem !important;
    border-radius: 0.5rem !important;
    font-weight: 600 !important;
    border: none !important;
    cursor: pointer !important;
}

#commentform #submit:hover {
    background-color: #A14F4F !important;
}

/* Miniaturki poziomo */
.flex-control-thumbs {
    display: flex !important;
    gap: 1rem !important;
    margin-top: 1rem !important;
    padding: 0 !important;
    list-style: none !important;
    justify-content: center !important;
}

.flex-control-thumbs li {
    width: 5rem !important;
    height: 5rem !important;
    margin: 0 !important;
}

.flex-control-thumbs li img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 0.375rem !important;
    border: 2px solid #e5e7eb !important;
    padding: 0.25rem !important;
    cursor: pointer !important;
}

.flex-control-thumbs li img.flex-active,
.flex-control-thumbs li img:hover {
    border-color: #F5C6C6 !important;
}

/* Przycisk Dodaj do koszyka - zgodny z template-product.html */
.woocommerce div.product form.cart {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
}

@media (min-width: 640px) {
    .woocommerce div.product form.cart {
        flex-direction: row !important;
    }
}

.woocommerce div.product form.cart .quantity {
    display: flex !important;
    align-items: center !important;
    flex: 0 0 auto !important; /* NIE rozciągaj */
}

/* Input quantity - wąski, wycentrowany */
.woocommerce div.product form.cart .quantity input.qty {
    width: 4rem !important; /* 64px */
    height: 3.5rem !important; /* 56px */
    text-align: center !important;
    border: 1px solid #e5e7eb !important;
    border-left: 1px solid #e5e7eb !important;
    border-right: 1px solid #e5e7eb !important;
    border-radius: 0 !important;
    padding: 0 !important;
    -moz-appearance: textfield !important;
}

/* Ukryj strzałki w input number */
.woocommerce div.product form.cart .quantity input.qty::-webkit-inner-spin-button,
.woocommerce div.product form.cart .quantity input.qty::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Przyciski +/- */
.woocommerce div.product form.cart .quantity .qty-btn,
.woocommerce div.product form.cart .quantity button {
    width: 3.5rem !important; /* 56px */
    height: 3.5rem !important; /* 56px */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #e5e7eb !important;
    background-color: white !important;
    cursor: pointer !important;
    transition: background-color 0.2s !important;
}

.woocommerce div.product form.cart .quantity button:first-child {
    border-radius: 0.5rem 0 0 0.5rem !important;
}

.woocommerce div.product form.cart .quantity button:last-child {
    border-radius: 0 0.5rem 0.5rem 0 !important;
}

.woocommerce div.product form.cart .quantity button:hover {
    background-color: #f3f4f6 !important;
}

/* Animacja pulsowania */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 15px -3px rgba(191, 96, 96, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 15px 25px -3px rgba(191, 96, 96, 0.4);
    }
}

.single_add_to_cart_button {
    display: flex !important;
    flex: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    border-radius: 0.5rem !important;
    background-color: #BF6060 !important; /* NOWY KOLOR */
    padding: 1rem 2rem !important;
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    color: white !important;
    box-shadow: 0 10px 15px -3px rgba(191, 96, 96, 0.3) !important;
    transition: background-color 0.2s, transform 0.2s !important;
    border: none !important;
    cursor: pointer !important;
    animation: pulse 2s ease-in-out infinite !important; /* PULSOWANIE */
}

.single_add_to_cart_button:hover {
    background-color: #A14F4F !important; /* Ciemniejszy odcień */
    animation: none !important; /* Wyłącz pulsowanie przy hover */
    transform: scale(1.03) !important;
}

.single_add_to_cart_button:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px #BF6060, 0 0 0 4px rgba(191, 96, 96, 0.2) !important;
    animation: none !important;
}

/* Ikony w boxach cech - WYMUSZENIE jednolitej wielkości */
.material-symbols-outlined[style*="font-size: 90px"] {
    width: 90px !important;
    height: 90px !important;
    font-size: 90px !important;
    line-height: 90px !important;
    max-width: 90px !important;
    max-height: 90px !important;
    min-width: 90px !important;
    min-height: 90px !important;
    overflow: hidden !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

/* Kółka ikon - wymuszenie jednolitego rozmiaru */
div.flex.items-center.justify-center.w-32.h-32 {
    width: 128px !important;
    height: 128px !important;
    min-width: 128px !important;
    min-height: 128px !important;
    max-width: 128px !important;
    max-height: 128px !important;
    flex-shrink: 0 !important;
}