/**
 * Shortcode [barf_product] — cartes produit (page d'accueil)
 */

.barf-product-shortcode {
    display: block;
    width: 100%;
    margin: 0 auto;
}

.barf-product-grid {
    display: grid;
    gap: 28px;
    align-items: stretch;
}

.barf-product-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.barf-product-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.barf-product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #e8ebe4;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.barf-product-card__media {
    display: block;
    background: #fff;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.barf-product-card__media img,
.barf-product-card__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.barf-product-card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 14px;
    padding: 18px 30px 30px;
    text-align: left;
}

.barf-product-card__badge {
    align-self: flex-start;
    padding: 5px 12px;
    border-radius: 999px;
    background: #e2001a;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1.2;
}

.barf-product-card__title {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    color: #1f4a3a;
}

.barf-product-card__title a {
    color: inherit;
    text-decoration: none;
}

.barf-product-card__excerpt {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: #555;
}

.barf-product-card__features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 4px 0;
    padding: 0;
    list-style: none;
}

.barf-product-card__features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 0 14px;
    border-left: 1px solid #e4e7e0;
    font-size: 12px;
}

.barf-product-card__features li:first-child {
    padding-left: 0;
    border-left: 0;
}

.barf-product-card__feature-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #eef2ea;
    color: #3f6b4f;
}

.barf-product-card__features strong {
    display: block;
    color: #1f2d27;
    font-size: 13px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.barf-product-card__features small {
    display: block;
    color: #777;
    font-size: 11px;
    line-height: 1.35;
}

.barf-product-card__price {
    margin-top: 8px;
    font-size: 30px;
    font-weight: 800;
    color: #1f4a3a;
}

.barf-product-card__price del {
    opacity: 0.55;
    font-weight: 500;
    margin-right: 6px;
}

.barf-product-card__unit {
    font-size: 14px;
    font-weight: 400;
    color: #666;
}

.barf-product-card__delivery {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: #555;
}

.barf-product-card__delivery svg {
    flex: 0 0 auto;
    color: #1f4a3a;
}

.barf-product-card__actions {
    margin-top: auto;
}

.barf-product-card__btn.button,
#top .barf-product-card__btn.button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background-color: #e2001a;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 16px 28px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    line-height: 1.2;
    transition: opacity 0.2s ease;
}

.barf-product-card__btn.button:hover,
#top .barf-product-card__btn.button:hover {
    background-color: #e2001a;
    color: #fff;
    opacity: 0.85;
}

@media only screen and (max-width: 767px) {
    .barf-product-grid--2,
    .barf-product-grid--3 {
        grid-template-columns: 1fr;
    }

    .barf-product-card__body {
        padding: 16px 18px 22px;
    }

    .barf-product-card__title {
        font-size: 24px;
    }

    .barf-product-card__features {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .barf-product-card__features li,
    .barf-product-card__features li:first-child {
        padding: 0;
        border-left: 0;
    }
}

.barf-product-card__total {
    margin: -6px 0 0;
    font-size: 14px;
    color: #444;
}

.barf-product-card__total[hidden] {
    display: none;
}

.barf-product-card.is-highlighted {
    animation: barfCardPulse 1.6s ease;
}

@keyframes barfCardPulse {
    0%, 60% { box-shadow: 0 0 0 4px rgba(97, 123, 69, 0.55); }
    100% { box-shadow: 0 0 0 0 rgba(97, 123, 69, 0); }
}

.barf-product-card__actions {
    display: flex;
    gap: 10px;
}

.barf-product-card__actions .barf-product-card__btn.button {
    flex: 1 1 0;
    width: auto;
}

.barf-product-card__actions [hidden] {
    display: none !important;
}

.barf-product-card .add_to_cart_button.is-added,
#top .barf-product-card .add_to_cart_button.is-added {
    background-color: #b9bdb6;
    cursor: not-allowed;
    opacity: 0.8;
    pointer-events: none;
}

.barf-product-card .barf-product-card__btn--checkout,
#top .barf-product-card .barf-product-card__btn--checkout {
    background-color: #1f4a3a;
}

.barf-product-card .barf-product-card__btn--checkout:hover,
#top .barf-product-card .barf-product-card__btn--checkout:hover {
    background-color: #1f4a3a;
}

.barf-product-card .added_to_cart {
    display: none !important;
}

/* ---------- [barf_categories] ---------- */

.barf-categories {
    width: 100%;
    margin: 40px auto 0;
}

.barf-categories__title {
    margin: 0 0 6px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    color: #1f4a3a;
    text-align: center;
}

.barf-categories__subtitle {
    margin: 0 0 24px;
    text-align: center;
    color: #666;
}

.barf-categories__grid {
    display: grid;
    gap: 22px;
    margin-top: 22px;
}

.barf-categories__grid--1 { grid-template-columns: 1fr; }
.barf-categories__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.barf-categories__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.barf-categories__grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.barf-categories__grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.barf-categories__grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.barf-categories__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 14px 18px;
    border: 1px solid #e8ebe4;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.barf-categories__card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.1);
}

.barf-categories__media {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: 8px;
    border-radius: 12px;
    background: #eef2ea;
    overflow: hidden;
}

.barf-categories__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.barf-categories__name {
    font-size: 16px;
    font-weight: 700;
    color: #1f4a3a;
}

.barf-categories__count {
    font-size: 12px;
    color: #777;
}

@media only screen and (max-width: 989px) {
    .barf-categories__grid--4,
    .barf-categories__grid--5,
    .barf-categories__grid--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media only screen and (max-width: 560px) {
    .barf-categories__grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Cartes compactes (ligne de 4 produits) ---------- */

.barf-product-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.barf-product-compact {
    margin-top: 40px;
}

.barf-product-compact .barf-product-card__media {
    aspect-ratio: 1 / 1;
}

.barf-product-compact .barf-product-card__media img,
.barf-product-compact .barf-product-card__img {
    object-fit: cover;
}

.barf-product-compact .barf-product-card__body {
    gap: 10px;
    padding: 14px 16px 18px;
}

.barf-product-compact .barf-product-card__badge {
    display: none;
}

.barf-product-compact .barf-product-card__title {
    font-family: inherit;
    font-size: 15px;
    line-height: 1.3;
}

.barf-product-compact .barf-product-card__price {
    margin-top: auto;
    font-size: 18px;
}

.barf-product-compact .barf-product-card__btn.button,
#top .barf-product-compact .barf-product-card__btn.button {
    padding: 11px 12px;
    font-size: 12px;
}

@media only screen and (max-width: 989px) {
    .barf-product-grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media only screen and (max-width: 767px) {
    .barf-product-grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
