﻿/* Equal-height cards in product grids */
.product-wrapper.row {
    align-items: stretch;
}

.product-wrapper.row > * {
    display: flex;
    flex-direction: column;
}

/* Mahartist — unified storefront product cards */
.product-wrapper .ma-product-card,
.owl-carousel .ma-product-card,
.ma-product-card {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-wrapper .ma-product-card .product,
.owl-carousel .ma-product-card .product,
.ma-product-card .product {
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--brand-primary) 12%, #ececec);
    background: #fff;
    box-shadow: 0 6px 22px rgba(101, 67, 33, 0.06);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    padding: 0;
}

.product-wrapper .ma-product-card:hover .product,
.owl-carousel .ma-product-card:hover .product,
.ma-product-card:hover .product {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(101, 67, 33, 0.12);
    border-color: color-mix(in srgb, var(--brand-primary) 28%, #ececec);
}

.product-wrapper .ma-product-card.is-unavailable:hover .product,
.owl-carousel .ma-product-card.is-unavailable:hover .product,
.ma-product-card.is-unavailable:hover .product {
    transform: none;
    box-shadow: 0 6px 22px rgba(101, 67, 33, 0.06);
}

.product-wrapper .ma-product-card .product-media,
.owl-carousel .ma-product-card .product-media,
.ma-product-card .product-media {
    position: relative;
    margin-bottom: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8f5f3;
}

.product-wrapper .ma-product-card .ma-product-media-link,
.owl-carousel .ma-product-card .ma-product-media-link,
.ma-product-card .ma-product-media-link {
    display: block;
    width: 100%;
    height: 100%;
}

.product-wrapper .ma-product-card .product-media img,
.owl-carousel .ma-product-card .product-media img,
.ma-product-card .product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.product-wrapper .ma-product-card:hover .product-media img,
.owl-carousel .ma-product-card:hover .product-media img,
.ma-product-card:hover .product-media img {
    transform: scale(1.03);
}

.product-wrapper .ma-product-card.is-unavailable .product-media img,
.owl-carousel .ma-product-card.is-unavailable .product-media img,
.ma-product-card.is-unavailable .product-media img {
    opacity: 0.72;
    filter: grayscale(0.15);
}

.product-wrapper .ma-product-card.is-unavailable:hover .product-media img,
.owl-carousel .ma-product-card.is-unavailable:hover .product-media img,
.ma-product-card.is-unavailable:hover .product-media img {
    transform: none;
}

.product-wrapper .ma-product-card .product-details,
.owl-carousel .ma-product-card .product-details,
.ma-product-card .product-details {
    padding: 0.85rem 0.9rem 1rem;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-wrapper .ma-product-card .product-cat,
.owl-carousel .ma-product-card .product-cat,
.ma-product-card .product-cat {
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #888;
}

.product-wrapper .ma-product-card .product-cat a,
.owl-carousel .ma-product-card .product-cat a,
.ma-product-card .product-cat a {
    color: #888;
    text-decoration: none;
}

.product-wrapper .ma-product-card .product-cat a:hover,
.owl-carousel .ma-product-card .product-cat a:hover,
.ma-product-card .product-cat a:hover {
    color: var(--brand-primary);
}

.product-wrapper .ma-product-card .product-name,
.owl-carousel .ma-product-card .product-name,
.ma-product-card .product-name {
    margin: 0 0 0.55rem;
    font-size: 1.6rem !important;
    font-weight: 600 !important;
    line-height: 1.45;
    letter-spacing: -0.01em;
    min-height: calc(1.6rem * 1.45 * 3);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-wrapper .ma-product-card .product-name a,
.owl-carousel .ma-product-card .product-name a,
.ma-product-card .product-name a {
    display: inline;
    color: #222;
    text-decoration: none;
}

.product-wrapper .ma-product-card .product-name a:hover,
.owl-carousel .ma-product-card .product-name a:hover,
.ma-product-card .product-name a:hover {
    color: var(--brand-primary);
}

.product-wrapper .ma-product-card .product-price,
.owl-carousel .ma-product-card .product-price,
.ma-product-card .product-price {
    margin-top: auto;
    padding-top: 0.25rem;
}

.product-wrapper .ma-product-card .product-price .price,
.owl-carousel .ma-product-card .product-price .price,
.ma-product-card .product-price .price {
    display: inline-block;
    font-size: 1.72rem;
    font-weight: 800;
    color: var(--brand-primary);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.ma-product-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1.05rem;
    border-radius: 999px;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.3;
}

.ma-product-status-badge--instock {
    background: color-mix(in srgb, #16a34a 12%, #fff);
    color: #15803d;
    border: 1px solid color-mix(in srgb, #16a34a 22%, #dce8de);
}

.ma-product-status-badge--outofstock {
    background: #ececec;
    color: #555;
}

.ma-product-status-badge--comingsoon {
    background: color-mix(in srgb, #d97706 14%, #fff);
    color: #b45309;
}

/* Override legacy product-wrap border from style.css */
.product-wrapper .product-wrap.ma-product-card,
.owl-carousel .product-wrap.ma-product-card,
.product-wrap.ma-product-card {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
}

/* Product detail page availability */
.ma-product-detail-stock {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.35rem 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.ma-product-detail-stock .ma-product-status-badge {
    font-size: 0.95rem;
}

.ma-product-detail-stock.is-unavailable {
    color: #777;
}

/* Add to cart loading state */
.ma-add-to-cart-btn.is-loading,
.btn.ma-add-to-cart-btn.is-loading {
    opacity: 0.72;
    pointer-events: none;
}

@media (max-width: 575px) {
    .product-wrapper .ma-product-card .product-name,
    .owl-carousel .ma-product-card .product-name,
    .ma-product-card .product-name {
        font-size: 1.35rem !important;
        min-height: calc(1.35rem * 1.45 * 3);
    }

    .product-wrapper .ma-product-card .product-price .price,
    .owl-carousel .ma-product-card .product-price .price,
    .ma-product-card .product-price .price {
        font-size: 1.55rem;
    }

    .ma-product-status-badge {
        font-size: 1rem;
        padding: 0.4rem 0.9rem;
    }
}
