/* ============================================
   AG Product Tiles — Shared Card Styling
   Used by both WC product loop AND homepage carousels
   ============================================ */

/* Strip default BeTheme li.product styling — the .ws-hp-card inside handles everything */
ul.products li.product {
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    padding: 0;
    position: relative;
    box-shadow: none;
    transition: none;
}

ul.products li.product:hover {
    box-shadow: none;
    transform: none;
}

/* Override BeTheme's text-align: center on product tiles */
ul.products li.product,
ul.products li.product.align-center,
ul.products li.product.align-left {
    text-align: left;
}

ul.products li.product .ws-hp-card {
    height: 100%;
}

/* Hide BeTheme's default desc, button row, image wrapper styles */
ul.products li.product > .desc,
ul.products li.product .mfn-li-product-row-button {
    display: none;
}

ul.products li.product .mfn-li-product-row-image {
    display: none;
}

/* ── The Card ── */
.ws-hp-card {
    background: #fff;
    border: 1px solid #e0e4d8;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.25s, transform 0.25s;
    display: flex;
    flex-direction: column;
}

.ws-hp-card:hover {
    box-shadow: 0 8px 28px rgba(13, 26, 11, 0.1);
    transform: translateY(-2px);
}

/* Link wrapper */
.ws-hp-card__link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Image */
.ws-hp-card__image-wrap {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 1 / 1;
    margin: 10px 10px 0;
    border-radius: 10px;
}

.ws-hp-card__image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.ws-hp-card__link:hover .ws-hp-card__image-wrap img {
    transform: scale(1.05);
}

/* Badge */
.ws-hp-card__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 10px;
    border-radius: 6px;
    z-index: 10;
}

.ws-hp-card__badge--green { background: #e4f4d8; color: #2f6120; }
.ws-hp-card__badge--dark { background: #0d1a0b; color: #74bb52; }
.ws-hp-card__badge--amber { background: #fef3c7; color: #92400e; }
.ws-hp-card__badge--red { background: #fee2e2; color: #991b1b; }
.ws-hp-card__badge--blue { background: #dbeafe; color: #1e40af; }

/* Info area — force left align, override BeTheme's center */
.ws-hp-card__info,
li.product .ws-hp-card__info,
ul.products li.product .ws-hp-card__info {
    padding: 14px 16px 8px;
    flex: 1;
    text-align: left;
}

/* Title — high specificity to override BeTheme */
.ws-hp-card__name,
li.product .ws-hp-card .ws-hp-card__name,
ul.products li.product .ws-hp-card__info .ws-hp-card__name,
ul.products li.product h3.ws-hp-card__name,
ul.products li.product h4.ws-hp-card__name {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px;
    line-height: 1.3;
    text-align: left;
    letter-spacing: 0;
    text-transform: none;
    font-style: normal;
    padding: 0;
}

.ws-hp-card__name a,
li.product .ws-hp-card__name a {
    color: inherit;
    text-decoration: none;
    font-family: inherit;
}

/* Now / Was price */
.ws-hp-card__price {
    margin-bottom: 8px;
    line-height: 1.4;
}

.ws-tile-price__now {
    font-size: 20px;
    font-weight: 800;
    color: #b91c1c;
}

.ws-tile-price__now .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.ws-tile-price__now sup {
    font-size: 12px;
    vertical-align: super;
    font-weight: 600;
}

.ws-tile-price__was {
    font-size: 14px;
    font-weight: 400;
    color: #999;
    text-decoration: line-through;
}

.ws-tile-price__was .woocommerce-Price-amount {
    font-size: inherit;
    color: inherit;
}

.ws-tile-price__was sup {
    font-size: 10px;
    vertical-align: super;
}

/* Tile description */
.ws-tile-description {
    font-size: 13px;
    line-height: 1.4;
    color: #666;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Star rating */
.ws-hp-card__rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 10px;
}

.ws-hp-card__star {
    color: #ddd;
    font-size: 15px;
}

.ws-hp-card__star.is-filled {
    color: #F5C518;
}

.ws-hp-card__review-count {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-left: 4px;
}

/* Gallery thumbs */
.ws-tile-gallery {
    display: flex;
    gap: 4px;
    padding: 0 16px;
    margin-bottom: 10px;
    overflow: hidden;
}

.ws-hp-card .ws-tile-gallery {
    padding: 0;
}

.ws-tile-gallery img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid #e5e5e0;
    flex-shrink: 0;
    cursor: pointer;
    transition: border-color 150ms ease;
}

.ws-tile-gallery img:hover {
    border-color: #2f6120;
}

/* Two-button footer */
.ws-hp-card__footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 0 16px 16px;
}

.ws-tile-btn {
    display: block;
    text-align: center;
    padding: 10px 8px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 150ms ease;
    white-space: nowrap;
}

.ws-tile-btn--view {
    background: #d4a843;
    color: #fff;
    border: 2px solid #d4a843;
}

.ws-tile-btn--view:hover {
    background: #b8922e;
    border-color: #b8922e;
    color: #fff;
}

/* ── Sale badge ── */
ul.products li.product .onsale {
    display: none;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .ws-hp-card__footer {
        grid-template-columns: 1fr;
    }

    .ws-tile-gallery img {
        width: 30px;
        height: 30px;
    }
}
