/*
Theme Name: Yöresel Cepte Child
Theme URI: https://yoreselcepte.com.tr/
Description: Yöresel Cepte için Blocksy tabanlı özel child theme.
Author: Yöresel Cepte
Author URI: https://yoreselcepte.com.tr/
Template: blocksy
Version: 1.0.4
Text Domain: yoresel-cepte-child
*/

/* Shared product-card layout for managed grids and WooCommerce loops. */
body.yccs-commerce-ui .yccs-product-card .yccs-product-card__media,
body.yccs-commerce-ui ul.products li.product > figure {
    aspect-ratio: 1;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
}

body.yccs-commerce-ui .yccs-product-card .yccs-product-card__media img,
body.yccs-commerce-ui ul.products li.product > figure .ct-media-container,
body.yccs-commerce-ui ul.products li.product > figure .ct-media-container img {
    aspect-ratio: 1 !important;
    width: 100%;
    height: auto !important;
    object-fit: cover;
}

body.yccs-commerce-ui ul.products li.product > figure .ct-media-container {
    position: relative;
}

body.yccs-commerce-ui ul.products li.product > figure .ct-media-container img {
    position: absolute;
    inset: 0;
    height: 100% !important;
}

body.yccs-commerce-ui .yccs-product-card,
body.yccs-commerce-ui ul.products li.product {
    background: #fff;
    border-radius: 14px;
}

body.yccs-commerce-ui .yccs-product-card .yccs-product-card__body > h3,
body.yccs-commerce-ui ul.products li.product > .woocommerce-loop-product__title {
    min-block-size: 2.6em;
    line-height: 1.3;
}

body.yccs-commerce-ui .yccs-product-card .yccs-product-card__category,
body.yccs-commerce-ui ul.products li.product > .entry-meta .meta-categories {
    color: #456052;
    letter-spacing: .03em;
    text-transform: uppercase;
}

body.yccs-commerce-ui .yccs-product-card .yccs-product-card__body .yccs-product-card__footer:has(> .yccs-add-button) {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-top: auto !important;
    padding-top: 8px !important;
}

body.yccs-commerce-ui .yccs-product-card .yccs-product-card__footer > .yccs-product-card__price {
    width: 100% !important;
    min-width: 0;
    min-block-size: 49px;
    margin: 0 !important;
}

/* Move the loop action below the full-width price, keeping theme hooks intact. */
body.yccs-commerce-ui:is(.woocommerce, .page, .search) ul.products li.product:has(> .ct-woo-card-actions, > .button) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto auto auto minmax(34px, 1fr) auto auto !important;
    align-items: start !important;
    row-gap: 0 !important;
}

body.yccs-commerce-ui:is(.woocommerce, .page, .search) ul.products li.product:has(> .ct-woo-card-actions, > .button) > .price {
    grid-area: 6 / 1 / 7 / -1 !important;
    width: auto !important;
    margin: 0 14px 12px !important;
    align-self: start !important;
}

body.yccs-commerce-ui:is(.woocommerce, .page, .search):not(.yccs-production-homepage) ul.products li.product:has(> .ct-woo-card-actions, > .button) > :is(.ct-woo-card-actions, .button) {
    grid-area: 7 / 1 / 8 / -1 !important;
    display: block !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 14px !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

body.yccs-commerce-ui .yccs-product-card .yccs-product-card__body .yccs-product-card__footer > .yccs-add-button,
body.yccs-commerce-ui:is(.woocommerce, .page, .search) ul.products li.product > .ct-woo-card-actions > .button,
body.yccs-commerce-ui:is(.woocommerce, .page, .search) ul.products li.product:has(> .button) > .button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: stretch !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 44px !important;
    padding: 8px !important;
    border-radius: 9px !important;
    box-sizing: border-box !important;
    background: #145338 !important;
    color: #fff !important;
    font-size: clamp(11px, 1.8vw, 13px) !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    white-space: normal !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

body.yccs-commerce-ui .yccs-product-card .yccs-product-card__body .yccs-product-card__footer > .yccs-add-button,
body.yccs-commerce-ui:is(.woocommerce, .page, .search) ul.products li.product > .ct-woo-card-actions > .button {
    width: 100% !important;
    margin: 0 !important;
}

body.yccs-commerce-ui :is(.yccs-product-card .yccs-add-button, ul.products li.product .button):is(:hover, :focus-visible) {
    background: #0b3825 !important;
}

body.yccs-commerce-ui .yccs-product-card .yccs-product-card__footer > .yccs-add-button.is-disabled {
    background: #e7ede9 !important;
    color: #37483f !important;
    cursor: default;
}

body.yccs-commerce-ui .yccs-product-card .yccs-card-shipping,
body.yccs-commerce-ui ul.products li.product > .yccs-card-shipping {
    border-top: 1px solid #e2ebe5;
    padding-top: 8px;
}

body.yccs-commerce-ui ul.products li.product > .yccs-card-shipping {
    grid-area: 8 / 1 / 9 / -1 !important;
}

body.yccs-commerce-ui :is(.yccs-product-card__price, ul.products li.product > .price) > :is(.yccs-card-price, .yccs-variable-price) {
    display: grid !important;
    grid-template-rows: 13px minmax(18px, auto) minmax(19px, auto);
    gap: 1px;
    justify-items: start;
    align-items: center;
    text-align: left;
}

body.yccs-commerce-ui :is(.yccs-card-price, .yccs-variable-price) .yccs-variable-price__label {
    grid-row: 1;
    color: #456052 !important;
    font-size: 10px !important;
}

body.yccs-commerce-ui :is(.yccs-card-price, .yccs-variable-price) .yccs-variable-price__meta {
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

body.yccs-commerce-ui :is(.yccs-card-price, .yccs-variable-price) .yccs-variable-price__meta del {
    opacity: 1;
    color: #526158 !important;
    font-size: 11px !important;
}

body.yccs-commerce-ui :is(.yccs-card-price, .yccs-variable-price) .yccs-variable-price__discount {
    border-radius: 4px;
    padding: 2px 4px;
    background: #145338 !important;
    color: #fff !important;
    font-size: 9px !important;
}

body.yccs-commerce-ui :is(.yccs-card-price, .yccs-variable-price) .yccs-variable-price__current {
    grid-row: 3;
    color: #145338 !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
}

body.yccs-commerce-ui .yccs-category-page article.yccs-product-card .yccs-product-card__body .yccs-product-card__footer > .yccs-add-button.add_to_cart_button,
body.yccs-commerce-ui.search-results.woocommerce-shop ul.products li.product.product-type-simple > .ct-woo-card-actions > .yccs-loop-cart-button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 44px !important;
    height: auto !important;
    padding: 8px !important;
    font-size: clamp(11px, 1.8vw, 13px) !important;
}

@media (max-width: 767px) {
    body.yccs-commerce-ui .yccs-category-page article.yccs-product-card .yccs-product-card__body {
        padding-inline: 12px !important;
    }

    body.yccs-commerce-ui .yccs-category-page article.yccs-product-card .yccs-product-card__body > .yccs-product-card__category {
        min-block-size: 16px !important;
        line-height: 16px !important;
    }

    body.yccs-commerce-ui .yccs-category-page article.yccs-product-card .yccs-product-card__body > h3 {
        margin: 0 0 6px !important;
        min-block-size: 2.6em !important;
        line-height: 1.3 !important;
    }
}

body.yccs-commerce-ui .yccs-product-grid:has(.yccs-card-quantity) .yccs-product-card .yccs-product-card__body .yccs-product-card__footer {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(52px, auto) 42px 44px;
    gap: 8px !important;
}

body.yccs-commerce-ui .yccs-product-grid:has(.yccs-card-quantity) .yccs-product-card__footer > .yccs-add-button {
    grid-row: 3;
}

body.yccs-commerce-ui:is(.woocommerce, .page, .search) ul.products li.product:is(.product-type-simple, .product-type-variable):has(> .ct-woo-card-actions) > .entry-meta {
    margin: 10px 12px 6px !important;
}

body.yccs-commerce-ui:is(.woocommerce, .page, .search) ul.products li.product:is(.product-type-simple, .product-type-variable):has(> .ct-woo-card-actions) > :is(.woocommerce-loop-product__title, .yccs-loop-net) {
    margin: 0 12px 6px !important;
}

body.yccs-commerce-ui:is(.woocommerce, .page, .search) ul.products li.product:is(.product-type-simple, .product-type-variable):has(> .ct-woo-card-actions) > .price {
    margin: 0 12px 8px !important;
}

body.yccs-commerce-ui:is(.woocommerce, .page, .search) ul.products:has(.yccs-card-quantity) li.product > .ct-woo-card-actions[data-alignment] {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 42px 44px;
    gap: 8px !important;
    margin-inline: 12px !important;
}

body.yccs-commerce-ui ul.products li.product > .ct-woo-card-actions > .yccs-card-quantity {
    grid-row: 1;
}

body.yccs-commerce-ui ul.products:has(.yccs-card-quantity) li.product > .ct-woo-card-actions > .button {
    grid-row: 2;
}

.yccs-card-quantity {
    grid-row: 2;
    display: grid;
    grid-template-columns: 1fr minmax(0, 1fr) 1fr;
    align-items: stretch;
    width: 100%;
    min-height: 42px;
    border: 1px solid #cbdcd2;
    border-radius: 9px;
    overflow: hidden;
    background: #fff;
}

.yccs-card-quantity > :is(button, input) {
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #145338;
    text-align: center;
    font: inherit;
    font-weight: 700;
    box-shadow: none;
}

.yccs-card-quantity > input {
    appearance: textfield;
    color: #14271d;
    font-size: 14px;
}

.yccs-card-quantity > input::-webkit-inner-spin-button,
.yccs-card-quantity > input::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
}

.yccs-card-quantity > button {
    min-height: 40px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.yccs-card-quantity > button:disabled {
    color: #64796d;
    cursor: default;
}

.yccs-card-quantity > button:enabled:hover {
    background: #eaf4ee;
}

.yccs-card-quantity > :is(button, input):focus-visible {
    outline: 2px solid #145338;
    outline-offset: -2px;
}
