/* ══════════════════════════════════════════════════════
   Allfresh Premium Theme — Custom Styles
   Enterprise-grade styling for Allfresh Food Products
   ══════════════════════════════════════════════════════ */

/* ── Global ── */
:root {
    --allfresh-gold: #BD9331;
    --allfresh-gold-dark: #9A7728;
    --allfresh-dark: #1D1C1C;
    --allfresh-cream: #F4F1E3;
    --allfresh-body: #545454;
    --allfresh-green: #2E7D32;
    --allfresh-border: #E0DCD0;
    --allfresh-radius: 8px;
    --allfresh-shadow: 0 4px 24px rgba(0,0,0,0.08);
    --allfresh-shadow-hover: 0 8px 40px rgba(0,0,0,0.12);
    --allfresh-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Hero Section ── */
.allfresh-hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.allfresh-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(29,28,28,0.85) 0%, rgba(29,28,28,0.6) 100%);
    z-index: 1;
}

.allfresh-hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 2rem;
}

.allfresh-hero__tagline {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--allfresh-gold);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
}

.allfresh-hero__title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.allfresh-hero__subtitle {
    font-size: 1.125rem;
    color: rgba(255,255,255,0.85);
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* ── Buttons ── */
.allfresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    border-radius: var(--allfresh-radius);
    transition: var(--allfresh-transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.allfresh-btn--primary {
    background: var(--allfresh-gold);
    color: #FFFFFF;
    border-color: var(--allfresh-gold);
}

.allfresh-btn--primary:hover {
    background: var(--allfresh-gold-dark);
    border-color: var(--allfresh-gold-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(189,147,49,0.3);
}

.allfresh-btn--outline {
    background: transparent;
    color: #FFFFFF;
    border-color: #FFFFFF;
}

.allfresh-btn--outline:hover {
    background: #FFFFFF;
    color: var(--allfresh-dark);
}

/* ── Product Cards ── */
.allfresh-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.allfresh-product-card {
    background: #FFFFFF;
    border-radius: var(--allfresh-radius);
    overflow: hidden;
    box-shadow: var(--allfresh-shadow);
    transition: var(--allfresh-transition);
    border: 1px solid var(--allfresh-border);
}

.allfresh-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--allfresh-shadow-hover);
}

.allfresh-product-card__image {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--allfresh-cream);
}

.allfresh-product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.allfresh-product-card:hover .allfresh-product-card__image img {
    transform: scale(1.05);
}

.allfresh-product-card__body {
    padding: 1.5rem;
}

.allfresh-product-card__title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--allfresh-dark);
    margin-bottom: 0.5rem;
}

.allfresh-product-card__price {
    font-family: "Poppins", sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--allfresh-gold);
}

.allfresh-product-card__desc {
    font-size: 0.9375rem;
    color: var(--allfresh-body);
    line-height: 1.6;
    margin: 0.75rem 0;
}

/* ── Certification Badges ── */
.allfresh-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.allfresh-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 100px;
    background: var(--allfresh-cream);
    color: var(--allfresh-dark);
    border: 1px solid var(--allfresh-border);
}

.allfresh-badge--kosher { background: #EDE7F6; color: #4527A0; border-color: #B39DDB; }
.allfresh-badge--vegan { background: #E8F5E9; color: #2E7D32; border-color: #A5D6A7; }
.allfresh-badge--gluten-free { background: #FFF8E1; color: #F57F17; border-color: #FFE082; }
.allfresh-badge--zero-trans-fat { background: #FFEBEE; color: #C62828; border-color: #EF9A9A; }
.allfresh-badge--allergen-free { background: #E3F2FD; color: #1565C0; border-color: #90CAF9; }
.allfresh-badge--usa-soybeans { background: #FBE9E7; color: #BF360C; border-color: #FFAB91; }

/* ── Trust Section ── */
.allfresh-trust {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
    padding: 4rem 0;
}

.allfresh-trust__item {
    padding: 2rem;
}

.allfresh-trust__number {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--allfresh-gold);
    line-height: 1;
}

.allfresh-trust__label {
    font-size: 0.9375rem;
    color: var(--allfresh-body);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Section Styles ── */
.allfresh-section {
    padding: 5rem 0;
}

.allfresh-section--cream {
    background: var(--allfresh-cream);
}

.allfresh-section--dark {
    background: var(--allfresh-dark);
    color: #FFFFFF;
}

.allfresh-section__eyebrow {
    font-family: "Poppins", sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--allfresh-gold);
    margin-bottom: 0.75rem;
}

.allfresh-section__title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.allfresh-section__divider {
    width: 60px;
    height: 3px;
    background: var(--allfresh-gold);
    margin-bottom: 2rem;
}

/* ── WooCommerce Overrides ── */
.allfresh-woo-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.woocommerce ul.products li.product {
    border-radius: var(--allfresh-radius);
    overflow: hidden;
    box-shadow: var(--allfresh-shadow);
    border: 1px solid var(--allfresh-border);
    transition: var(--allfresh-transition);
    background: #FFFFFF;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-4px);
    box-shadow: var(--allfresh-shadow-hover);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--allfresh-dark);
    padding: 0.75rem 1rem 0;
}

.woocommerce ul.products li.product .price {
    font-family: "Poppins", sans-serif;
    font-weight: 700;
    color: var(--allfresh-gold);
    font-size: 1.125rem;
    padding: 0 1rem;
}

.woocommerce ul.products li.product .button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
    background: var(--allfresh-gold) !important;
    color: #FFFFFF !important;
    border-radius: var(--allfresh-radius) !important;
    font-family: "Poppins", sans-serif !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    font-size: 0.8125rem !important;
    padding: 0.75rem 1.5rem !important;
    transition: var(--allfresh-transition) !important;
    border: none !important;
    text-align: center !important;
    display: block !important;

}

.woocommerce ul.products li.product .button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
    background: var(--allfresh-gold-dark) !important;
    transform: translateY(-1px);
}

.woocommerce .star-rating span::before {
    color: var(--allfresh-gold);
}

/* Single product page */
.woocommerce div.product div.summary {
    padding-left: 2rem;
}

.woocommerce div.product .product_title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--allfresh-dark);
}

.woocommerce div.product p.price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--allfresh-gold);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: var(--allfresh-gold);
    border-bottom-color: var(--allfresh-gold);
}

/* ── Newsletter / CTA Banner ── */
.allfresh-cta-banner {
    background: linear-gradient(135deg, var(--allfresh-dark) 0%, #2D2B2B 100%);
    padding: 4rem 2rem;
    text-align: center;
    border-radius: var(--allfresh-radius);
}

.allfresh-cta-banner__title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 1rem;
}

.allfresh-cta-banner__text {
    color: rgba(255,255,255,0.75);
    font-size: 1.0625rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .allfresh-hero {
        min-height: 60vh;
    }

    .allfresh-trust {
        grid-template-columns: repeat(2, 1fr);
    }

    .allfresh-products {
        grid-template-columns: 1fr;
    }

    .allfresh-section {
        padding: 3rem 0;
    }

    .woocommerce div.product div.summary {
        padding-left: 0;
        padding-top: 1.5rem;
    }
}

@media (max-width: 480px) {
    .allfresh-trust {
        grid-template-columns: 1fr;
    }

    .allfresh-badges {
        justify-content: center;
    }
}

/* ── Topbar Styles ── */
.allfresh-topbar {
    position: relative;
    z-index: 100;
}

.allfresh-topbar a {
    transition: color 0.2s ease;
}

.allfresh-topbar a:hover {
    color: var(--allfresh-gold) !important;
}

.allfresh-main-header {
    position: sticky;
    top: 0;
    z-index: 99;
    border-bottom: 2px solid var(--allfresh-gold);
}

.allfresh-main-header a {
    transition: color 0.2s ease;
}

.allfresh-main-header .wp-block-navigation a:hover {
    color: var(--allfresh-gold) !important;
}

/* ── Product Card Button Padding Fix ── */
.woocommerce ul.products li.product .button {
    margin: 0.75rem 1rem 0.5rem 1rem !important;
}

/* ── "View Cart" link (appears after AJAX add-to-cart) ── */
.woocommerce ul.products li.product a.added_to_cart {
    display: block;
    text-align: center;
    font-family: "Poppins", sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--allfresh-gold, #BD9331);
    text-decoration: none;
    padding: 0.25rem 1rem 1rem 1rem;
    letter-spacing: 0.04em;
    transition: color 0.2s ease;
}

.woocommerce ul.products li.product a.added_to_cart:hover {
    color: var(--allfresh-gold-dark, #A07B1A);
    text-decoration: underline;
}

.woocommerce ul.products li.product {
    padding-bottom: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__link {
    flex: 1;
}

/* ── Hide duplicate page title on inner pages (hero has its own) ── */
.page .entry-title,
.page .wp-block-post-title,
body.page article .entry-header {
    display: none !important;
}

/* ── Inner page hero sections ── */
.wp-block-cover {
    min-height: 50vh;
}

.wp-block-cover .wp-block-cover__inner-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

/* ── Alternating section backgrounds ── */
.page .entry-content .wp-block-group.has-background {
    padding: 3rem 2rem;
}

/* ── Certification cards grid ── */
.cert-card {
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cert-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* ── Recipe sections ── */
.wp-block-columns .wp-block-column {
    padding: 1rem;
}

/* ── YouTube embed responsive ── */
.wp-block-embed__wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.wp-block-embed__wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}



/* ── WooCommerce Content Centering ──
 * The legacy template renders classic PHP output that needs
 * explicit centering to match the block theme constrained layout.
 */
.woocommerce .woocommerce-notices-wrapper,
.woocommerce-page .woocommerce {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* ══════════════════════════════════════════════════════
   WooCommerce Shop Page
   ══════════════════════════════════════════════════════ */

/* ── Shop Toolbar (result count + sort) ── */
.allfresh-shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--allfresh-border, #E0DCD0);
}

.allfresh-shop-toolbar .woocommerce-result-count {
    font-family: "Poppins", sans-serif;
    font-size: 0.875rem;
    color: var(--allfresh-body, #545454);
    margin: 0;
    padding: 0;
}

.allfresh-shop-toolbar .woocommerce-ordering {
    margin: 0;
}

.allfresh-shop-toolbar .woocommerce-ordering select.orderby {
    font-family: "Poppins", sans-serif;
    font-size: 0.875rem;
    color: var(--allfresh-dark, #1D1C1C);
    background-color: #ffffff;
    border: 1px solid var(--allfresh-border, #E0DCD0);
    border-radius: var(--allfresh-radius, 8px);
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231D1C1C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 180px;
}

.allfresh-shop-toolbar .woocommerce-ordering select.orderby:hover {
    border-color: var(--allfresh-gold, #BD9331);
}

.allfresh-shop-toolbar .woocommerce-ordering select.orderby:focus {
    outline: none;
    border-color: var(--allfresh-gold, #BD9331);
    box-shadow: 0 0 0 2px rgba(189, 147, 49, 0.15);
}

/* ── Product Grid Fix (3 columns) ──
 * WHY: WooCommerce ::before pseudo-element for float-clearing
 * occupies a CSS Grid cell. We suppress it for proper 3-col layout.
 */
.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce-page ul.products::before,
.woocommerce-page ul.products::after {
    display: none !important;
    content: none !important;
}

.woocommerce ul.products,
.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2rem !important;
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
}

/* ── Product Grid Responsive ── */
@media (max-width: 768px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .allfresh-shop-toolbar {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: 1fr !important;
    }
}

/* ── Hide WooCommerce breadcrumb on shop ── */
.woocommerce .woocommerce-breadcrumb {
    display: none !important;
}