/**
 * Product cards — homepage slider + shop (/magaza/) + categories (/urun-kategori/*)
 * One shared card style: .meck-product-card.ui-style-homepage
 */

/* ── Catalog page shell ──────────────────────────────────── */
.meck-catalog-banner {
    position: relative;
    min-height: 200px;
    height: auto;
    margin-top: 110px;
    background-color: var(--color1, #f1b500);
    background-image: url('../images/banner/section-bg.png');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.meck-catalog-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.meck-catalog-banner .banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 3.5rem 1rem 2.5rem;
}

.meck-catalog-banner .banner-content > h1 {
    padding-top: 0 !important;
    margin: 0;
    color: #fff !important;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    line-height: 1.15;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.meck-catalog-intro {
    max-width: 720px;
    margin: 0.75rem auto 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 15px;
    line-height: 1.5;
}

.meck-catalog-intro p {
    margin: 0;
}

body.admin-bar .meck-catalog-banner {
    margin-top: 142px;
}

.meck-catalog-page.urunler {
    padding-top: 2rem;
    padding-bottom: 3rem;
    background: #f1f1f1;
}

/* ── Toolbar: full width, above product grid ─────────────── */
.meck-catalog-controls {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 1.75rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.meck-catalog-count {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color2, #282828) !important;
}

.meck-catalog-sort {
    margin-left: auto;
}

.meck-catalog-sort .woocommerce-ordering {
    margin: 0 !important;
    float: none !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.meck-catalog-sort .woocommerce-ordering select {
    min-width: 220px;
    padding: 0.55rem 2rem 0.55rem 0.85rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    color: var(--color2, #282828) !important;
    background-color: #fff;
}

/* Product grid — full width below controls */
.meck-catalog-products {
    width: 100%;
    clear: both;
}

.meck-catalog-grid,
.meck-catalog-products > ul.products {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
    width: 100%;
    align-items: stretch;
}

.meck-catalog-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--color2, #282828);
}

ul.products li.meck-wc-product-col {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    float: none !important;
    clear: none !important;
    overflow: visible !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column;
    align-self: stretch;
}

ul.products li.meck-wc-product-col::before,
ul.products li.meck-wc-product-col::after {
    display: none !important;
}

/* ── Shared product card (same as homepage) ───────────────── */
.meck-product-card.ui-style-homepage {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: 100%;
    min-height: 100%;
    width: 100%;
    padding: 1rem 1rem 1.125rem !important;
    margin-bottom: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06) !important;
    text-shadow: none !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.meck-catalog-grid > .meck-product-card.ui-style-homepage {
    height: 100%;
}

.meck-catalog-page .meck-product-card.ui-style-homepage:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1) !important;
}

.meck-product-card.ui-style-homepage .meck-product-card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.meck-product-card.ui-style-homepage .product-item-img-link {
    display: block;
    text-decoration: none;
    margin-bottom: 0;
    flex-shrink: 0;
}

.meck-product-card.ui-style-homepage .product-item-img {
    overflow: hidden;
    border-radius: 12px;
    background: #fafafa;
}

.meck-product-card.ui-style-homepage .product-item-img img {
    display: block;
    width: 100%;
    height: 220px !important;
    object-fit: contain;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.meck-catalog-page .meck-product-card.ui-style-homepage:hover .product-item-img img {
    transform: scale(1.03);
}

/* Title — black readable text, spaced below image */
.meck-product-card.ui-style-homepage .product-item-title {
    flex: 1 1 auto;
    margin: 0;
    padding: 0.875rem 0 0;
}

.meck-product-card.ui-style-homepage .product-item-title h3,
.meck-product-card.ui-style-homepage .product-item-title h3 a,
.meck-product-card.ui-style-homepage a.product-item-title-link,
.meck-catalog-page .product-item-title > h3,
.meck-catalog-page .product-item-title > h3 a,
.meck-product-card.ui-style-homepage .product-item-title-link {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    text-shadow: none !important;
    font-size: 17px !important;
    line-height: 1.35 !important;
    font-weight: 600 !important;
    text-align: center;
    text-decoration: none !important;
    margin: 0;
    padding: 0 0 0.5rem;
    display: block;
    word-break: break-word;
}

.meck-product-card.ui-style-homepage a.product-item-title-link:hover {
    color: var(--color1, #f1b500) !important;
    -webkit-text-fill-color: var(--color1, #f1b500) !important;
}

/* Footer — price + Sepete Ekle pinned to card bottom */
.meck-product-card.ui-style-homepage .meck-product-card-footer {
    margin-top: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 0.75rem;
}

.meck-product-card.ui-style-homepage .meck-product-card-footer .meck-product-card-cta {
    margin-top: auto;
}

.meck-product-card.ui-style-homepage .meck-product-card-footer .price {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--color1, #f1b500) !important;
    line-height: 1.2;
}

.meck-product-card.ui-style-homepage .meck-product-card-footer .price .amount,
.meck-product-card.ui-style-homepage .meck-product-card-footer .price bdi,
.meck-product-card.ui-style-homepage .meck-product-card-footer .price ins,
.meck-product-card.ui-style-homepage .meck-product-card-footer .price span {
    color: var(--color1, #f1b500) !important;
    font-size: 18px !important;
    text-decoration: none !important;
    text-shadow: none !important;
    top: auto !important;
    right: auto !important;
}

.meck-product-card.ui-style-homepage .meck-product-card-footer .button,
.meck-product-card.ui-style-homepage .meck-product-card-footer .add_to_cart_button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin: 0 !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    box-sizing: border-box;
    background-color: var(--color1, #f1b500) !important;
    color: #fff !important;
    border: none !important;
    text-decoration: none !important;
    transition: background-color 0.2s ease;
}

.meck-product-card.ui-style-homepage .meck-product-card-footer .button:hover {
    background-color: #d9a200 !important;
    color: #fff !important;
}

/* ── Homepage swiper ─────────────────────────────────────── */
.js-swiper-products .swiper-wrapper {
    align-items: stretch;
}

.js-swiper-products .swiper-slide {
    height: auto;
    display: flex;
    align-items: stretch;
}

.js-swiper-products .swiper-slide > .meck-product-card {
    width: 100%;
    flex: 1;
}

/* ── Pagination ──────────────────────────────────────────── */
.meck-shop-archive .woocommerce-pagination,
.meck-product-pagination {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.meck-product-pagination .page-numbers {
    border-radius: 8px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1199.98px) {
    .meck-catalog-grid,
    .meck-catalog-products > ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .meck-catalog-banner {
        margin-top: 0;
    }

    body.admin-bar .meck-catalog-banner {
        margin-top: 46px;
    }
}

@media (max-width: 991.98px) {
    .meck-catalog-grid,
    .meck-catalog-products > ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .meck-catalog-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .meck-catalog-sort {
        margin-left: 0;
        width: 100%;
    }

    .meck-catalog-sort .woocommerce-ordering,
    .meck-catalog-sort .woocommerce-ordering select {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .meck-catalog-grid,
    .meck-catalog-products > ul.products {
        grid-template-columns: 1fr;
    }

    .meck-product-card.ui-style-homepage .product-item-img img {
        height: 180px !important;
    }

    .meck-catalog-banner .banner-content {
        padding: 2.75rem 1rem 2rem;
    }
}

/* Legacy shop markup (old archive-product.php still on server until redeployed) */
.row.mt-5 > [class*="col-"] {
    display: flex;
    align-items: stretch;
}

.row.mt-5 .product-item.product {
    width: 100%;
    min-height: 100%;
    height: auto !important;
    overflow: visible !important;
}

.row.mt-5 .product-item .product-item-img img {
    height: 220px !important;
    object-fit: contain;
}

.row.mt-5 .product-item .product-item-title {
    padding-top: 0.875rem;
}

.row.mt-5 .product-item .product-item-title > h3,
.row.mt-5 .product-item .product-item-link h3 {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
}

.row.mt-5 .product-item > a.button,
.row.mt-5 .product-item > .button {
    width: 100%;
    margin-top: 0.5rem !important;
}
