/* ==========================================================
   AlvóKuckó Child v1.0.9
   Stabil termékgrid + kompakt termékoldal
   ========================================================== */

/* ---------- Termékkártyák: mindenhol egységes ---------- */
.woocommerce ul.products,
ul.products.ak-home-products,
.ak-home-products {
    display: grid !important;
    grid-auto-flow: row !important;
    gap: 22px !important;
    padding: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    list-style: none !important;
    clear: both !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after,
.ak-home-products::before,
.ak-home-products::after {
    display: none !important;
    content: none !important;
}

.woocommerce ul.products li.product,
.ak-home-products li.product,
.woocommerce-page ul.products li.product {
    float: none !important;
    clear: none !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    grid-column: auto !important;
    grid-row: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-self: stretch !important;
    background: #fff !important;
    border: 1px solid var(--ak-line, #e8e1d8) !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    box-shadow: 0 8px 24px rgba(47,43,37,.035) !important;
}

.woocommerce ul.products li.product:hover,
.ak-home-products li.product:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 15px 34px rgba(47,43,37,.09) !important;
}

.woocommerce ul.products li.product .woocommerce-LoopProduct-link,
.woocommerce ul.products li.product .woocommerce-loop-product__link,
.ak-home-products li.product .woocommerce-LoopProduct-link,
.ak-home-products li.product .woocommerce-loop-product__link {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.woocommerce ul.products li.product a img,
.ak-home-products li.product a img {
    display: block !important;
    width: 100% !important;
    height: 255px !important;
    max-height: 255px !important;
    aspect-ratio: auto !important;
    object-fit: cover !important;
    margin: 0 0 14px !important;
    border-radius: 0 !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.ak-home-products li.product .woocommerce-loop-product__title {
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-size: 15px !important;
    line-height: 1.35 !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
    color: var(--ak-ink, #262521) !important;
    padding: 0 15px !important;
    margin: 0 0 10px !important;
    min-height: 61px !important;
    max-height: 61px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.woocommerce ul.products li.product .star-rating,
.ak-home-products li.product .star-rating {
    margin: 0 15px 8px !important;
    font-size: 13px !important;
}

.woocommerce ul.products li.product .price,
.ak-home-products li.product .price {
    display: block !important;
    padding: 0 15px !important;
    margin: auto 0 0 !important;
    font-family: Inter, ui-sans-serif, sans-serif !important;
    font-size: 18px !important;
    line-height: 1.25 !important;
    font-weight: 900 !important;
    color: var(--ak-green-dark, #2d4539) !important;
}

.woocommerce ul.products li.product .price del,
.ak-home-products li.product .price del {
    font-size: 12px !important;
    font-weight: 500 !important;
    opacity: .62 !important;
}

.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .added_to_cart,
.ak-home-products li.product .button,
.ak-home-products li.product .added_to_cart {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: calc(100% - 30px) !important;
    min-height: 43px !important;
    margin: 13px 15px 15px !important;
    padding: 0 14px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--ak-green, #3e5a4b) !important;
    color: #fff !important;
    font-family: Inter, ui-sans-serif, sans-serif !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    text-align: center !important;
}

/* ---------- Főoldal: ugyanaz a kártyadizájn, kompakt szélességgel ---------- */
.ak-home .ak-section > .ak-container,
.home .ak-section > .ak-container {
    max-width: 1120px !important;
}

.ak-home .ak-home-products,
.home .ak-home-products {
    width: 100% !important;
    max-width: 1100px !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

/* ---------- Üzlet / kategória: középre zárt, 3 termék soronként ---------- */
.post-type-archive-product .ak-shop-main > .ak-container,
.tax-product_cat .ak-shop-main > .ak-container,
.tax-product_tag .ak-shop-main > .ak-container {
    width: min(1050px, calc(100% - 40px)) !important;
    max-width: 1050px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.post-type-archive-product .woocommerce-products-header,
.tax-product_cat .woocommerce-products-header,
.tax-product_tag .woocommerce-products-header,
.post-type-archive-product .ak-shop-intro,
.tax-product_cat .ak-shop-intro,
.tax-product_tag .ak-shop-intro {
    width: 100% !important;
    max-width: 760px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
}

.post-type-archive-product .woocommerce-products-header .page-title,
.tax-product_cat .woocommerce-products-header .page-title,
.tax-product_tag .woocommerce-products-header .page-title,
.post-type-archive-product .page-title,
.tax-product_cat .page-title,
.tax-product_tag .page-title {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* A count/rendezés NE úsztassa körbe a product gridet. */
.post-type-archive-product .woocommerce-result-count,
.tax-product_cat .woocommerce-result-count,
.tax-product_tag .woocommerce-result-count,
.post-type-archive-product .woocommerce-ordering,
.tax-product_cat .woocommerce-ordering,
.tax-product_tag .woocommerce-ordering {
    float: none !important;
}

.post-type-archive-product .woocommerce-result-count,
.tax-product_cat .woocommerce-result-count,
.tax-product_tag .woocommerce-result-count {
    display: inline-block !important;
    margin: 8px 0 24px !important;
}

.post-type-archive-product .woocommerce-ordering,
.tax-product_cat .woocommerce-ordering,
.tax-product_tag .woocommerce-ordering {
    display: flex !important;
    justify-content: flex-end !important;
    margin: 0 0 24px !important;
}

.post-type-archive-product .woocommerce ul.products,
.tax-product_cat .woocommerce ul.products,
.tax-product_tag .woocommerce ul.products,
.post-type-archive-product ul.products,
.tax-product_cat ul.products,
.tax-product_tag ul.products {
    clear: both !important;
    width: 100% !important;
    max-width: 1000px !important;
    margin: 0 auto !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    justify-content: center !important;
    align-items: stretch !important;
}

.post-type-archive-product ul.products li.product.first,
.post-type-archive-product ul.products li.product.last,
.tax-product_cat ul.products li.product.first,
.tax-product_cat ul.products li.product.last,
.tax-product_tag ul.products li.product.first,
.tax-product_tag ul.products li.product.last {
    clear: none !important;
    margin: 0 !important;
}

/* ---------- Termékoldal: kompakt, normál folyású kép ---------- */
.single-product .ak-shop-main > .ak-container {
    width: min(1120px, calc(100% - 40px)) !important;
    max-width: 1120px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.single-product div.product {
    display: grid !important;
    grid-template-columns: minmax(0, 520px) minmax(340px, 460px) !important;
    grid-template-rows: auto auto auto !important;
    justify-content: center !important;
    align-items: start !important;
    column-gap: 42px !important;
    row-gap: 30px !important;
}

/* A galéria soha ne legyen sticky/fixed. */
.single-product div.product .woocommerce-product-gallery,
.single-product div.product div.images,
.single-product .woocommerce-product-gallery,
.single-product .images,
.single-product .woocommerce-product-gallery__wrapper {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    inset: auto !important;
    transform: none !important;
    translate: none !important;
    z-index: 1 !important;
}

.single-product div.product .woocommerce-product-gallery,
.single-product div.product div.images {
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: start !important;
    width: 100% !important;
    max-width: 520px !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
}

/* Fő kép: ne legyen több mint kb. 480px magas desktopon. */
.single-product .woocommerce-product-gallery__wrapper {
    width: 100% !important;
    height: 480px !important;
    max-height: 480px !important;
    overflow: hidden !important;
    border-radius: 20px !important;
    background: #f7f4ef !important;
}

.single-product .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image,
.single-product .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image a {
    display: block !important;
    width: 100% !important;
    height: 480px !important;
    max-height: 480px !important;
}

.single-product .woocommerce-product-gallery__wrapper img,
.single-product div.product div.images img {
    display: block !important;
    width: 100% !important;
    height: 480px !important;
    max-height: 480px !important;
    object-fit: contain !important;
    object-position: center !important;
    margin: 0 !important;
}

.single-product div.product .summary {
    grid-column: 2 !important;
    grid-row: 1 !important;
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    align-self: start !important;
    width: 100% !important;
    max-width: 460px !important;
    min-width: 0 !important;
    margin: 0 !important;
}

.single-product div.product .product_title {
    font-size: clamp(34px, 3.1vw, 48px) !important;
}

/* A tabok/related mindig KÜLÖN sorban, a galéria alatt. */
.single-product div.product .woocommerce-tabs {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    margin: 0 !important;
    padding-top: 26px !important;
    background: var(--ak-paper, #fffdfa) !important;
}

.single-product div.product .related.products,
.single-product div.product .upsells.products {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    max-width: 1000px !important;
    margin: 0 auto !important;
    background: var(--ak-paper, #fffdfa) !important;
}

.single-product .related.products ul.products,
.single-product .upsells.products ul.products {
    width: 100% !important;
    max-width: 1000px !important;
    margin: 0 auto !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    clear: both !important;
}

.single-product .related.products ul.products li.product,
.single-product .upsells.products ul.products li.product {
    clear: none !important;
    grid-column: auto !important;
    grid-row: auto !important;
}

.single-product .related.products ul.products li.product a img,
.single-product .upsells.products ul.products li.product a img {
    height: 205px !important;
    max-height: 205px !important;
}

/* Thumbnails kompakt sorban. */
.single-product div.product div.images .flex-control-thumbs {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    overflow-x: auto !important;
    margin: 10px 0 0 !important;
    padding: 0 0 4px !important;
}

.single-product div.product div.images .flex-control-thumbs li {
    flex: 0 0 76px !important;
    width: 76px !important;
    margin: 0 !important;
    float: none !important;
}

.single-product div.product div.images .flex-control-thumbs img {
    width: 76px !important;
    height: 76px !important;
    max-height: 76px !important;
    object-fit: cover !important;
    border-radius: 10px !important;
}

/* ---------- Tablet ---------- */
@media (max-width: 980px) {
    .ak-home .ak-home-products,
    .home .ak-home-products,
    .post-type-archive-product .woocommerce ul.products,
    .post-type-archive-product ul.products,
    .tax-product_cat .woocommerce ul.products,
    .tax-product_cat ul.products,
    .tax-product_tag .woocommerce ul.products,
    .tax-product_tag ul.products,
    .single-product .related.products ul.products,
    .single-product .upsells.products ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .single-product div.product {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto auto auto !important;
        gap: 24px !important;
    }

    .single-product div.product .woocommerce-product-gallery,
    .single-product div.product div.images {
        grid-column: 1 !important;
        grid-row: 1 !important;
        max-width: 620px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .single-product div.product .summary {
        grid-column: 1 !important;
        grid-row: 2 !important;
        max-width: 620px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .single-product div.product .woocommerce-tabs {
        grid-row: 3 !important;
    }

    .single-product div.product .related.products,
    .single-product div.product .upsells.products {
        grid-row: 4 !important;
    }
}

/* ---------- Mobil ---------- */
@media (max-width: 767px) {
    .post-type-archive-product .ak-shop-main > .ak-container,
    .tax-product_cat .ak-shop-main > .ak-container,
    .tax-product_tag .ak-shop-main > .ak-container,
    .single-product .ak-shop-main > .ak-container {
        width: calc(100% - 20px) !important;
    }

    .ak-home .ak-home-products,
    .home .ak-home-products,
    .post-type-archive-product .woocommerce ul.products,
    .post-type-archive-product ul.products,
    .tax-product_cat .woocommerce ul.products,
    .tax-product_cat ul.products,
    .tax-product_tag .woocommerce ul.products,
    .tax-product_tag ul.products,
    .single-product .related.products ul.products,
    .single-product .upsells.products ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .woocommerce ul.products li.product a img,
    .ak-home-products li.product a img {
        height: 175px !important;
        max-height: 175px !important;
    }

    .woocommerce ul.products li.product .woocommerce-loop-product__title,
    .ak-home-products li.product .woocommerce-loop-product__title {
        min-height: 53px !important;
        max-height: 53px !important;
        font-size: 13px !important;
        padding-left: 11px !important;
        padding-right: 11px !important;
    }

    .woocommerce ul.products li.product .price,
    .ak-home-products li.product .price {
        font-size: 16px !important;
        padding-left: 11px !important;
        padding-right: 11px !important;
    }

    .woocommerce ul.products li.product .button,
    .woocommerce ul.products li.product .added_to_cart,
    .ak-home-products li.product .button,
    .ak-home-products li.product .added_to_cart {
        width: calc(100% - 22px) !important;
        margin-left: 11px !important;
        margin-right: 11px !important;
        font-size: 11px !important;
    }

    .single-product .woocommerce-product-gallery__wrapper,
    .single-product .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image,
    .single-product .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image a,
    .single-product .woocommerce-product-gallery__wrapper img,
    .single-product div.product div.images img {
        height: 330px !important;
        max-height: 330px !important;
    }

    .single-product .woocommerce-product-gallery__wrapper img,
    .single-product div.product div.images img {
        object-fit: contain !important;
    }
}


/* v1.1.0 mobil 2 oszlopos finomhangolás */
@media (max-width: 767px) {
    .woocommerce ul.products li.product,
    .ak-home-products li.product,
    .woocommerce-page ul.products li.product {
        border-radius: 16px !important;
    }
    .woocommerce ul.products li.product a img,
    .ak-home-products li.product a img {
        height: 160px !important;
        max-height: 160px !important;
    }
    .woocommerce ul.products li.product .button,
    .woocommerce ul.products li.product .added_to_cart,
    .ak-home-products li.product .button,
    .ak-home-products li.product .added_to_cart {
        min-height: 40px !important;
        line-height: 1.15 !important;
        padding: 8px 10px !important;
    }
}
