/*
Theme Name:  Marabu Eats
Theme URI:   https://marabueats.com
Description: Custom theme for Marabu Eats — Tamil Nadu specialty food e-commerce.
Version:     1.0.0
Author:      FC SiteDevs
Text Domain: marabueats
*/

/* ─── Base Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    background-color: #F8FAFC;
    font-family: 'DM Sans', sans-serif;
    color: #1E293B;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

/* ─── Material Symbols ─────────────────────────────────────── */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
}

/* ─── WooCommerce Overrides ────────────────────────────────── */
.woocommerce-page .woocommerce,
.woocommerce-page ul.products,
.woocommerce-page .woocommerce-notices-wrapper { all: unset; }

/* ─── Utility ──────────────────────────────────────────────── */
.site-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }

/* ─── WC Message / Notices ─────────────────────────────────── */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
}
.woocommerce-message { background: #fff7ed; border-left: 4px solid #f97316; color: #1e293b; }
.woocommerce-error   { background: #fef2f2; border-left: 4px solid #dc2626; color: #1e293b; }
.woocommerce-info    { background: #eff6ff; border-left: 4px solid #3b82f6; color: #1e293b; }

/* ─── Quantity Input ────────────────────────────────────────── */
.quantity input[type="number"] {
    width: 60px;
    height: 44px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    font-family: 'DM Sans', sans-serif;
}

/* ─── WC Product Gallery ────────────────────────────────────── */

/* Force visible — WC sets opacity:0 until JS fires, but we override */
.woocommerce-product-gallery {
    opacity: 1 !important;
}

/* Flexslider wrapper — block, not grid; flexslider manages its own layout */
.woocommerce-product-gallery__wrapper {
    display: block;
    position: relative;
}

/* Flexslider viewport: clips the sliding images */
.woocommerce-product-gallery__wrapper .flex-viewport {
    overflow: hidden;
    border-radius: 12px;
    background: #fff7ed;
}

/* Each slide */
.woocommerce-product-gallery__image {
    overflow: hidden;
}
.woocommerce-product-gallery__image img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

/* Flexslider slide positioning — required for JS image-swap to work */
.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image {
    display: none;   /* flexslider JS shows/hides slides */
}
.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:first-child {
    display: block;  /* show first image before JS fires */
}
/* Once flexslider inits it adds .flex-viewport; after that let JS control */
.woocommerce-product-gallery__wrapper.flexslider .woocommerce-product-gallery__image {
    display: block;
}

/* ── Thumbnail strip — side by side ───────────────────────── */
.flex-control-nav {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}
.flex-control-thumbs {
    display: flex;
    flex-direction: row;
    gap: 8px;
}
.flex-control-thumbs li {
    flex: 0 0 auto;
}
.flex-control-thumbs img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #e2e8f0;
    transition: border-color 150ms ease-out;
    display: block;
    opacity: 1 !important; /* WC sometimes dims these */
}
.flex-control-thumbs img:hover {
    border-color: #F97316;
}
.flex-control-thumbs .flex-active {
    border-color: #F97316;
}

/* ─── WC Single Product — Add to Cart ──────────────────────── */
.single_add_to_cart_button,
.woocommerce .button.alt,
button.single_add_to_cart_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #F97316;
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    min-height: 44px;
    transition: background-color 150ms ease-out;
    margin-top: 12px;
}
.single_add_to_cart_button:hover,
.woocommerce .button.alt:hover {
    background-color: #ea6c10;
}

/* ─── WC Product Title & Price ──────────────────────────────── */
.product_title.entry-title {
    font-family: 'Source Serif 4', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #1E293B;
    line-height: 1.25;
    margin: 0 0 12px;
}
.entry-summary .price,
.entry-summary .woocommerce-Price-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #F97316;
    font-family: 'DM Sans', sans-serif;
}
.entry-summary .price del {
    color: #94a3b8;
    font-size: 1rem;
    margin-right: 8px;
}
.entry-summary .short-description {
    font-size: 15px;
    color: #475569;
    line-height: 1.65;
    margin: 16px 0;
}
.product_meta {
    margin-top: 16px;
    font-size: 13px;
    color: #64748b;
    font-family: 'DM Sans', sans-serif;
}
.product_meta span {
    display: block;
    margin-bottom: 4px;
}
.product_meta a {
    color: #F97316;
    text-decoration: underline;
}

/* ─── WC Product Tabs ───────────────────────────────────────── */
.woocommerce-tabs {
    margin-top: 48px;
}
.woocommerce-tabs ul.wc-tabs {
    list-style: none;
    margin: 0 0 -1px;
    padding: 0;
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
}
.woocommerce-tabs ul.wc-tabs li {
    margin: 0;
    padding: 0;
}
.woocommerce-tabs ul.wc-tabs li a {
    display: block;
    padding: 10px 20px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 150ms, border-color 150ms;
}
.woocommerce-tabs ul.wc-tabs li.active a,
.woocommerce-tabs ul.wc-tabs li a:hover {
    color: #F97316;
    border-bottom-color: #F97316;
}
.woocommerce-tabs .panel {
    padding: 24px 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: #334155;
    line-height: 1.7;
}
.woocommerce-tabs .panel h2 {
    font-family: 'Source Serif 4', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px;
}

/* ─── WC Stars / Reviews ────────────────────────────────────── */
.star-rating {
    color: #ca8a04;
    font-size: 14px;
}
.woocommerce-review-link {
    font-size: 13px;
    color: #64748b;
    margin-left: 6px;
}

/* ─── Shop Pagination ───────────────────────────────────────── */
.woocommerce-pagination {
    margin-top: 48px;
    display: flex;
    justify-content: center;
}
.woocommerce-pagination ul.page-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.woocommerce-pagination ul.page-numbers li {
    display: flex;
}
.woocommerce-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    transition: all 150ms ease-out;
    text-decoration: none;
}
.woocommerce-pagination .page-numbers:hover {
    border-color: #F97316;
    color: #F97316;
}
.woocommerce-pagination .page-numbers.current {
    background: #F97316;
    border-color: #F97316;
    color: #fff;
    pointer-events: none;
}
.woocommerce-pagination .page-numbers.next,
.woocommerce-pagination .page-numbers.prev {
    font-size: 18px;
    color: #F97316;
    border-color: #e2e8f0;
}
.woocommerce-pagination .page-numbers.next:hover,
.woocommerce-pagination .page-numbers.prev:hover {
    background: #F97316;
    border-color: #F97316;
    color: #fff;
}

/* ─── Animations ────────────────────────────────────────────── */

/* Fade-up: initial hidden state */
.anim-fade-up {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}
.anim-fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Fade-in (no vertical movement — for images, trust bar items) */
.anim-fade-in {
    opacity: 0;
    transition: opacity 600ms ease-out;
}
.anim-fade-in.is-visible {
    opacity: 1;
}

/* Stagger delays — applied via JS */
.anim-delay-1 { transition-delay:  80ms; }
.anim-delay-2 { transition-delay: 160ms; }
.anim-delay-3 { transition-delay: 240ms; }
.anim-delay-4 { transition-delay: 320ms; }
.anim-delay-5 { transition-delay: 400ms; }
.anim-delay-6 { transition-delay: 480ms; }
.anim-delay-7 { transition-delay: 560ms; }
.anim-delay-8 { transition-delay: 640ms; }

/* Hero entrance — runs once on page load, no scroll needed */
.hero-headline {
    opacity: 0;
    transform: translateY(20px);
    animation: heroEntrance 550ms ease-out 100ms forwards;
}
.hero-sub {
    opacity: 0;
    transform: translateY(20px);
    animation: heroEntrance 550ms ease-out 220ms forwards;
}
.hero-cta {
    opacity: 0;
    transform: translateY(20px);
    animation: heroEntrance 550ms ease-out 340ms forwards;
}
.hero-image {
    opacity: 0;
    transform: scale(0.96);
    animation: heroImage 700ms ease-out 200ms forwards;
}
.hero-badge {
    opacity: 0;
    transform: translateY(12px);
    animation: heroEntrance 500ms ease-out 600ms forwards;
}

@keyframes heroEntrance {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes heroImage {
    to { opacity: 1; transform: scale(1); }
}

/* Header scroll shadow */
.site-header {
    transition: box-shadow 250ms ease-out;
}
.site-header.is-scrolled {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

/* Product card lift on hover */
.product-card-hover {
    transition: transform 250ms ease-out, box-shadow 250ms ease-out;
}
.product-card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.10);
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .anim-fade-up,
    .anim-fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .hero-headline,
    .hero-sub,
    .hero-cta,
    .hero-image,
    .hero-badge {
        opacity: 1;
        transform: none;
        animation: none;
    }
    .product-card-hover {
        transition: none;
    }
}

/* ─── Cart Toast ────────────────────────────────────────────── */
#mbe-toast {
    position: fixed;
    bottom: 28px;
    right: 24px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1e293b;
    color: #f8fafc;
    border-radius: 14px;
    padding: 14px 16px;
    max-width: 340px;
    min-width: 260px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.12);
    /* hidden state */
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 250ms ease-out, transform 250ms ease-out;
}
#mbe-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.mbe-toast__icon {
    color: #4ade80;
    font-size: 22px;
    flex-shrink: 0;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.mbe-toast__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mbe-toast__title {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.2;
}
.mbe-toast__name {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.mbe-toast__name:empty {
    display: none;
}
.mbe-toast__cta {
    flex-shrink: 0;
    background: #F97316;
    color: #fff !important;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 13px;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 150ms ease-out;
    min-height: 32px;
    display: flex;
    align-items: center;
}
.mbe-toast__cta:hover {
    background: #ea6c10;
}
.mbe-toast__close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #475569;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    transition: color 150ms;
}
.mbe-toast__close:hover {
    color: #f8fafc;
}
.mbe-toast__close .material-symbols-outlined {
    font-size: 18px;
}

/* ─── Contact Form 7 ────────────────────────────────────────── */
.wpcf7-form {
    margin-top: 24px;
}
.wpcf7-form p {
    margin-bottom: 16px;
}
.wpcf7-form label {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form textarea {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 11px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: #1e293b;
    background: #fff;
    transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
    outline: none;
    min-height: 44px;
    box-sizing: border-box;
}
.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form input[type="tel"]:focus,
.wpcf7-form textarea:focus {
    border-color: #F97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}
.wpcf7-form textarea {
    min-height: 140px;
    resize: vertical;
}
.wpcf7-form input[type="submit"] {
    background-color: #F97316;
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    min-height: 44px;
    transition: background-color 150ms ease-out;
}
.wpcf7-form input[type="submit"]:hover {
    background-color: #ea6c10;
}
.wpcf7-not-valid-tip {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: #dc2626;
    margin-top: 4px;
    display: block;
}
.wpcf7-response-output {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    border: none !important;
}
.wpcf7-mail-sent-ok {
    background: #f0fdf4;
    color: #166534;
    border-left: 4px solid #22c55e !important;
}
.wpcf7-mail-sent-ng,
.wpcf7-aborted,
.wpcf7-validation-errors {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #dc2626 !important;
}

/* ─── About Us page images ───────────────────────────────────── */
.about-image-full {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin: 32px 0;
    aspect-ratio: 16 / 7;
}
.about-image-full img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.about-image-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 32px 0;
}
.about-image-split .about-img {
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}
.about-image-split .about-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
@media (max-width: 640px) {
    .about-image-split {
        grid-template-columns: 1fr;
    }
}

/* ─── Screen reader only ─────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
