/* ==========================================================================
   ShopMetro Recipes — frontend styles
   ========================================================================== */

/* ---- Single recipe page ---- */

.shopmetro-recipe__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--primary-color, #333);
    text-decoration: none;
    margin-bottom: 5px;
    width: 100%;
}

.shopmetro-recipe__back:hover {
    text-decoration: underline;
}

.shopmetro-recipe__back svg {
    width: 16px;
    height: 16px;
}

.shopmetro-recipe {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    max-width: 1300px;
    margin: 32px auto;
    padding: 0 16px;
}

.shopmetro-recipe__media {
    flex: 0 0 320px;
    max-width: 320px;
}

.shopmetro-recipe__media img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.shopmetro-recipe__media h1 {
    font-size: 22px;
    margin: 12px 0 0;
}

.shopmetro-recipe__content {
    flex: 1 1 480px;
    min-width: 280px;
}

/* Stat boxes: Prep time / Cook time / Total time / Serves */

.shopmetro-recipe__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.shopmetro-recipe__stats div {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px 6px;
    text-align: center;
}

.shopmetro-recipe__stats span {
    display: block;
    font-size: 11px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
}

.shopmetro-recipe__stats strong {
    font-size: 14px;
    font-weight: 600;
}

.shopmetro-recipe__content h2 {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
    margin: 24px 0 16px;
}

.shopmetro-recipe__content h2:first-of-type {
    margin-top: 0;
}

/* ---- Short description ---- */

.shopmetro-recipe__short-description {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin: 8px 0 0;
}

/* ---- Ingredient rows ---- */

.shopmetro-ingredient {
    margin-bottom: 14px;
}

.shopmetro-ingredient__text {
    font-size: 13px;
    margin: 0 0 6px;
    color: #222;
}

.shopmetro-ingredient__product {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 8px 10px;
}

.shopmetro-ingredient__product img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.shopmetro-ingredient__product-info {
    flex: 1;
    min-width: 0;
}

.shopmetro-ingredient__product-info a {
    display: block;
    font-size: 12px;
    color: #1e6fbf;
    text-decoration: none;
    line-height: 1.4;
}

.shopmetro-ingredient__product-info a:hover {
    text-decoration: underline;
}

.shopmetro-ingredient__product-info .price {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-top: 2px;
}

.shopmetro-ingredient--extra {
    display: none;
}

.shopmetro-see-more-ingredients {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    background: none;
    border: none;
    padding: 10px;
    font-size: 13px;
    color: var(--primary-color, #333);
    cursor: pointer;
    margin: 8px 0 20px;
}

.shopmetro-see-more-ingredients:hover {
    text-decoration: underline;
}

.shopmetro-see-more-ingredients svg {
    width: 14px;
    height: 14px;
    transition: transform 0.15s ease;
}

.shopmetro-see-more-ingredients[data-expanded="true"] svg {
    transform: rotate(180deg);
}

/* Individual Add button — no color override.
   Uses WooCommerce's own .add_to_cart_button.button classes (set in the template),
   so Flatsome's actual site-configured add-to-cart color applies automatically. */
.shopmetro-ingredient__add {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ---- Bulk add-to-cart button ---- */

.shopmetro-add-all {
    display: block;
    width: 100%;
    background: var(--primary-color, #333);
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    padding: 12px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    margin: 20px 0 28px;
    filter: brightness(1);
    transition: filter 0.15s ease;
}

.shopmetro-add-all:hover {
    filter: brightness(0.9);
}

.shopmetro-add-all:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ---- Directions ---- */

.shopmetro-directions {
    font-size: 14px;
    line-height: 1.9;
    color: #333;
    padding-left: 20px;
}

.shopmetro-directions li {
    margin-bottom: 10px;
}

/* ==========================================================================
   Recipe listing grid ([shopmetro_recipes] shortcode output)
   ========================================================================== */

.shopmetro-recipe-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin: 24px 0;
}

.shopmetro-recipe-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.shopmetro-recipe-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.shopmetro-recipe-card__image {
    aspect-ratio: 1 / 1;
    background: #f4f4f4;
    overflow: hidden;
}

.shopmetro-recipe-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shopmetro-recipe-card__body {
    padding: 12px;
}

.shopmetro-recipe-card__badge {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #eef6ee;
    color: #2e8b3d;
    padding: 3px 8px;
    border-radius: 3px;
    margin-bottom: 6px;
}

.shopmetro-recipe-card__title {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    color: #222;
}

/* ---- Pagination (paginate_links output) ---- */

.shopmetro-recipe-grid + .page-numbers,
nav.woocommerce-pagination,
ul.page-numbers {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
}

.page-numbers li a,
.page-numbers li span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    text-decoration: none;
    color: #333;
}

.page-numbers li span.current {
    background: var(--primary-color, #333);
    border-color: var(--primary-color, #333);
    color: #fff;
}

/* ==========================================================================
   Category filter ([shopmetro_recipe_categories] shortcode output)
   ========================================================================== */

.shopmetro-recipe-category-filter {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shopmetro-recipe-category-filter li {
    margin-bottom: 6px;
}

.shopmetro-recipe-category-filter a {
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
}

.shopmetro-recipe-category-filter li.is-active a {
    background: #eaf2fb;
    color: #000;
}

/* ==========================================================================
   Responsive breakpoints
   ========================================================================== */

/* ---- Tablet (≤850px) ---- */

@media (max-width: 850px) {
    .shopmetro-recipe-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }

    .shopmetro-recipe-category-filter {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .shopmetro-recipe-category-filter li {
        margin-bottom: 0;
    }

    .shopmetro-recipe-category-filter a {
        padding: 6px 12px;
        white-space: nowrap;
    }
}

/* ---- Mobile (≤550px) ---- */

@media (max-width: 550px) {
    .shopmetro-recipe-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .shopmetro-recipe {
        flex-direction: column;
    }

    .shopmetro-recipe__media {
        flex: 1 1 auto;
        max-width: none;
    }

    .shopmetro-recipe__stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .shopmetro-recipe-category-filter {
        gap: 4px;
    }

    .shopmetro-recipe-category-filter a {
        font-size: 11px;
        padding: 4px 8px;
    }
}