/*
Theme Name: U-Neac Farm
Description: Farm store theme for the U-Neac Farmer Platform. GrazeCart-familiar, customizer-driven colors and hero.
Version: 0.4.0
Author: U-Neac Ministry
*/

:root {
    --uneac-primary: #2D5016;
    --uneac-accent: #C4A265;
    --uneac-cream: #F5F0E8;
    --uneac-text: #3D2B1F;
    --uneac-white: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Georgia, 'Times New Roman', serif;
    background: var(--uneac-cream);
    color: var(--uneac-text);
    font-size: 17px;
    line-height: 1.6;
}

a { color: var(--uneac-primary); }
img { max-width: 100%; height: auto; }

/* ---------- Header ---------- */
.uf-topbar {
    background: var(--uneac-white);
    padding: 14px 4%;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.uf-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.uf-logo img { max-height: 60px; width: auto; }
.uf-logo .uf-sitename { font-size: 24px; font-weight: 700; color: var(--uneac-primary); }
.uf-search { flex-grow: 1; max-width: 520px; }
.uf-search form { display: flex; }
.uf-search input[type=search] {
    flex-grow: 1; padding: 10px 16px; border: 1px solid #ccc;
    border-radius: 24px 0 0 24px; font-size: 15px; outline: none;
}
.uf-search button {
    background: var(--uneac-primary); color: #fff; border: none;
    padding: 10px 18px; border-radius: 0 24px 24px 0; cursor: pointer;
}
.uf-account { margin-left: auto; display: flex; gap: 18px; align-items: center; }
.uf-account a { text-decoration: none; font-size: 14px; }
.uf-cart-count {
    background: var(--uneac-accent); color: #fff; border-radius: 50%;
    padding: 1px 7px; font-size: 12px; margin-left: 3px;
}

/* ---------- Nav ---------- */
.uf-nav { background: var(--uneac-primary); padding: 0 4%; }
.uf-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.uf-nav > ul > li { position: relative; }
.uf-nav a {
    display: block; color: #fff; text-decoration: none;
    padding: 13px 18px; font-size: 15px; font-family: Arial, sans-serif;
}
.uf-nav a:hover { background: rgba(255,255,255,.12); }
.uf-nav li ul {
    display: none; position: absolute; top: 100%; left: 0; z-index: 50;
    background: var(--uneac-white); min-width: 210px;
    box-shadow: 0 6px 18px rgba(0,0,0,.15);
}
.uf-nav li:hover > ul { display: block; }
.uf-nav li ul a { color: var(--uneac-text); padding: 10px 16px; }
.uf-nav li ul a:hover { background: var(--uneac-cream); }

/* ---------- Hero ---------- */
.uf-hero {
    position: relative; min-height: 420px; display: flex;
    align-items: center; justify-content: center; text-align: center;
    background-size: cover; background-position: center;
    background-color: var(--uneac-primary);
}
.uf-hero::before {
    content: ""; position: absolute; inset: 0;
    background: rgba(20, 30, 10, .45);
}
.uf-hero-inner { position: relative; max-width: 760px; padding: 40px 20px; color: #fff; }
.uf-hero h1 { font-size: 44px; margin: 0 0 12px; line-height: 1.15; }
.uf-hero p { font-size: 21px; margin: 0 0 26px; }
.uf-btn {
    display: inline-block; background: var(--uneac-accent); color: #fff;
    padding: 14px 36px; border-radius: 4px; text-decoration: none;
    font-size: 17px; font-family: Arial, sans-serif;
}
.uf-btn:hover { filter: brightness(1.08); color: #fff; }

/* ---------- Sections ---------- */
.uf-section { padding: 54px 4%; max-width: 1240px; margin: 0 auto; }
.uf-section-title { text-align: center; font-size: 32px; margin: 0 0 6px; color: var(--uneac-text); }
.uf-section-sub {
    text-align: center; color: #7a6a58; margin: 0 auto 34px; max-width: 600px;
    border-bottom: 3px solid var(--uneac-accent); display: table; padding-bottom: 10px;
}

/* Category tiles */
.uf-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.uf-cat {
    position: relative; border-radius: 8px; overflow: hidden;
    min-height: 190px; display: flex; align-items: flex-end;
    background: linear-gradient(135deg, var(--uneac-primary), #4a7a2a);
    background-size: cover; background-position: center;
    text-decoration: none; box-shadow: 0 3px 10px rgba(0,0,0,.12);
    transition: transform .15s ease;
}
.uf-cat:hover { transform: translateY(-3px); }
.uf-cat::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,.05) 60%);
}
.uf-cat-label { position: relative; padding: 18px; color: #fff; }
.uf-cat-tag {
    font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
    font-family: Arial, sans-serif; opacity: .9;
}
.uf-cat-name { font-size: 24px; font-weight: 700; }

/* Woo content area */
.uf-content { padding: 34px 4%; max-width: 1240px; margin: 0 auto; }

/* Products grid */
ul.products { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
ul.products li.product {
    background: var(--uneac-white); border-radius: 8px; padding: 16px;
    text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
ul.products li.product img { border-radius: 6px; }
ul.products li.product .woocommerce-loop-product__title { font-size: 17px; color: var(--uneac-text); }
ul.products li.product .price { color: var(--uneac-primary); font-weight: 700; display: block; margin: 6px 0; }
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce #respond input#submit, .wc-block-components-button {
    background: var(--uneac-primary) !important; color: #fff !important;
    border-radius: 4px; font-family: Arial, sans-serif;
}
.woocommerce a.button:hover, .woocommerce button.button:hover { filter: brightness(1.15); }
.onsale { background: var(--uneac-accent) !important; }

/* Notices */
.woocommerce-info { border-top-color: var(--uneac-primary) !important; }

/* ---------- Footer ---------- */
.uf-footer {
    background: var(--uneac-text); color: #e8ded2;
    padding: 40px 4%; margin-top: 60px;
}
.uf-footer-inner {
    max-width: 1240px; margin: 0 auto; display: flex;
    justify-content: space-between; gap: 30px; flex-wrap: wrap;
}
.uf-footer a { color: var(--uneac-accent); text-decoration: none; }
.uf-footer .uf-sitename { font-size: 22px; font-weight: 700; color: #fff; }
.uf-footer-note { max-width: 1240px; margin: 26px auto 0; font-size: 13px; opacity: .7; }

@media (max-width: 700px) {
    .uf-hero h1 { font-size: 30px; }
    .uf-hero p { font-size: 17px; }
    .uf-topbar { gap: 12px; }
    .uf-search { order: 3; max-width: 100%; width: 100%; }
}

/* ---------- v0.2: homepage sections ---------- */
.uf-intro { text-align: center; padding: 40px 4% 10px; max-width: 800px; margin: 0 auto; }
.uf-intro p { font-size: 19px; margin: 8px 0; color: var(--uneac-text); }
.uf-intro p strong { color: var(--uneac-primary); }

.uf-trust { text-align: center; padding: 50px 4%; max-width: 820px; margin: 0 auto; }
.uf-trust h2 { font-size: 28px; margin: 0 0 16px; }
.uf-trust p { font-size: 17px; }

.uf-steps { background: var(--uneac-band, #E7F3D8); padding: 54px 4%; text-align: center; }
.uf-steps-inner { max-width: 1100px; margin: 0 auto; }
.uf-steps h2 { font-size: 26px; margin: 0 0 34px; }
.uf-steps-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 30px; margin-bottom: 34px; }
.uf-step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--uneac-primary); color: #fff; font-size: 20px;
    font-weight: 700; margin-bottom: 12px; font-family: Arial, sans-serif;
}
.uf-step h3 { margin: 0 0 8px; font-size: 19px; }
.uf-step p { font-size: 14px; margin: 0 auto; max-width: 260px; color: #55483a; }

.uf-pickup { text-align: center; padding: 56px 4%; }
.uf-pickup h2 { font-size: 26px; margin: 0 0 10px; text-decoration: underline; text-decoration-color: var(--uneac-accent); text-underline-offset: 8px; }
.uf-pickup p { max-width: 560px; margin: 14px auto 24px; }

/* Product cards closer to CWHM */
ul.products li.product { text-align: left; padding: 0 0 16px; overflow: hidden; }
ul.products li.product a img { aspect-ratio: 1/1; margin-bottom: 10px; }
ul.products li.product .woocommerce-loop-product__title { padding: 0 14px; font-size: 15px; font-family: Arial, sans-serif; }
ul.products li.product .price { padding: 0 14px; font-size: 18px; }
ul.products li.product .price small { display: block; color: #8a7a66; font-weight: 400; font-size: 12px; }
ul.products li.product .button { margin: 8px 14px 0; display: block; text-align: center; }

/* Category archive headline */
.woocommerce-products-header__title { font-size: 30px; margin-bottom: 4px; }
.term-description { color: #7a6a58; margin-bottom: 18px; }

/* Footer columns */
.uf-footer-col h4 { color: #fff; margin: 0 0 10px; font-size: 15px; }
.uf-footer-col ul { list-style: none; margin: 0; padding: 0; }
.uf-footer-col li { margin: 6px 0; font-size: 14px; }

/* Secondary category bar (store pages) */
.uf-nav2 { background: #fff; border-bottom: 1px solid #e2dbd0; padding: 0 4%; }
.uf-nav2 ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.uf-nav2 > ul > li { position: relative; }
.uf-nav2 a {
    display: block; color: var(--uneac-text); text-decoration: none;
    padding: 10px 14px; font-size: 14px; font-family: Arial, sans-serif;
}
.uf-nav2 > ul > li > a:hover { color: var(--uneac-primary); }
.uf-nav2 li ul {
    display: none; position: absolute; top: 100%; left: 0; z-index: 60;
    background: #fff; min-width: 200px; box-shadow: 0 6px 18px rgba(0,0,0,.15);
}
.uf-nav2 li:hover > ul { display: block; }
.uf-nav2 li ul a:hover { background: var(--uneac-cream); }

/* Card width fix (permanent in master) */
ul.products li.product { width: auto !important; float: none !important; margin: 0 !important; }
ul.products li.product a img { width: 100%; }

/* All Foods = primary tab in category bar */
.uf-nav2 > ul > li:first-child > a {
    background: var(--uneac-primary); color: #fff; font-weight: 700; padding: 10px 20px;
}
.uf-nav2 > ul > li:first-child > a:hover { color: #fff; filter: brightness(1.15); }

/* Login / Register side-by-side */
.woocommerce .u-columns.col2-set { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.woocommerce .u-columns.col2-set .u-column1, .woocommerce .u-columns.col2-set .u-column2 { width: auto; float: none; }
@media (max-width: 700px) { .woocommerce .u-columns.col2-set { grid-template-columns: 1fr; } }
.woocommerce form.login, .woocommerce form.register {
    background: #fff; border: 1px solid #e2dbd0; border-radius: 8px; padding: 24px;
}

/* Logo sizing */
.uf-logo img, .uf-logo .custom-logo { max-height: 70px !important; width: auto !important; }

/* ---------- v0.3: mobile menu ---------- */
.uf-menu-btn {
    display: none; background: var(--uneac-primary); color: #fff; border: none;
    font-size: 24px; padding: 8px 16px; width: 100%; cursor: pointer; text-align: left;
}
@media (max-width: 780px) {
    .uf-menu-btn { display: block; }
    .uf-nav > ul { display: none; flex-direction: column; }
    body.uf-nav-open .uf-nav > ul { display: flex; }
    .uf-nav li ul { position: static; display: block; box-shadow: none; background: rgba(255,255,255,.08); }
    .uf-nav li ul a { color: #fff; padding-left: 34px; }
    .uf-nav2 ul { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ---------- v0.3: product page ---------- */
.uf-back { max-width: 1240px; margin: 0 auto; padding: 0 0 10px; }
.uf-back a { font-family: Arial, sans-serif; font-size: 14px; text-decoration: none; }
.single-product div.product {
    background: var(--uneac-white); border-radius: 8px; padding: 28px;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.single-product div.product .woocommerce-product-gallery img { border-radius: 6px; }
.single-product div.product .product_title { font-size: 28px; margin-bottom: 6px; }
.single-product div.product p.price { font-size: 24px; color: var(--uneac-primary); }
.uf-approx { color: #7a6a58; font-size: 14px; font-family: Arial, sans-serif; margin: 4px 0 10px; }
.single-product form.cart .single_add_to_cart_button { padding: 14px 40px; font-size: 16px; }
.woocommerce-tabs { margin-top: 30px; }
.woocommerce-tabs h2 { text-align: center; font-size: 24px; }
.woocommerce-tabs ul.tabs li.active a { color: var(--uneac-primary); }

/* ---------- v0.3.1 ---------- */
.uf-cats-btn { display: none; }
@media (max-width: 780px) {
    .uf-cats-btn {
        display: block; width: 100%; text-align: left; background: #fff;
        border: none; border-bottom: 1px solid #e2dbd0; padding: 11px 16px;
        font-family: Arial, sans-serif; font-size: 15px; color: var(--uneac-text); cursor: pointer;
    }
    .uf-nav2 { display: none; }
    body.uf-cats-open .uf-nav2 { display: block; }
    .uf-nav2 ul { flex-direction: column; overflow: visible; }
    .uf-nav2 li ul { position: static; display: block; box-shadow: none; background: var(--uneac-cream); }
    .uf-nav2 li ul a { padding-left: 30px; }
    .uf-nav2 > ul > li:first-child > a { padding: 10px 16px; }
}

/* Card text breathing room */
ul.products li.product .woocommerce-loop-product__title,
ul.products li.product .price,
ul.products li.product .uf-approx {
    padding-left: 14px !important;
    padding-right: 14px !important;
}
ul.products li.product .button { margin-left: 14px !important; margin-right: 14px !important; }


/* ---------- v0.4: section pattern styles ---------- */
.uf-editor-home { }
.ufp-section { padding: 46px 20px; max-width: 1100px; margin: 0 auto; }
.ufp-band { background: var(--uneac-band, #E7F3D8); padding: 50px 20px; }
.ufp-band > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
.ufp-cta { background: var(--uneac-primary); color: #fff; text-align: center; padding: 54px 20px; }
.ufp-cta h2, .ufp-cta p { color: #fff; }
.ufp-story { background: #fff; border-top: 3px solid var(--uneac-accent); border-bottom: 3px solid var(--uneac-accent); padding: 50px 20px; text-align: center; }
.ufp-story p { max-width: 720px; margin: 12px auto; font-size: 18px; line-height: 1.7; }
h3.ufp-num { width: 58px; height: 58px; line-height: 58px; border-radius: 50%; background: var(--uneac-primary); color: #fff; margin: 0 auto 10px; font-size: 26px; text-align: center; }
.ufp-quote { font-size: 22px; font-style: italic; max-width: 760px; margin: 10px auto; line-height: 1.6; }
.ufp-quote-name { color: #777; font-size: 15px; }
.ufp-faq-item { border: 1px solid #ddd; border-radius: 6px; background: #fff; padding: 12px 18px; max-width: 780px; margin: 10px auto; }
.ufp-faq-item summary { cursor: pointer; font-weight: bold; font-size: 17px; }
.ufp-faq-item p { margin: 10px 0 2px; }
.wp-block-button__link.wp-element-button { background: var(--uneac-primary); color: #fff; border-radius: 4px; padding: 13px 30px; font-size: 16px; text-decoration: none; }
.ufp-cta .wp-block-button__link.wp-element-button { background: #fff; color: var(--uneac-primary); }
.uneac-nl { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; max-width: 560px; margin: 0 auto; }
.uneac-nl input { padding: 12px 14px; font-size: 16px; border: none; border-radius: 4px; flex: 1 1 160px; }
.uneac-nl button { padding: 12px 26px; font-size: 16px; border: none; border-radius: 4px; background: var(--uneac-accent); color: #fff; cursor: pointer; }
.wp-block-columns { gap: 24px; }
.wp-block-details summary::marker { color: var(--uneac-primary); }

/* ---------- v0.4: mobile polish pass (7/15/26) ---------- */
@media (max-width: 780px) {
    /* stop iOS zooming into fields */
    input, select, textarea { font-size: 16px !important; }

    /* the classic cart becomes stacked cards */
    .woocommerce-cart-form table.shop_table thead { display: none; }
    .woocommerce-cart-form table.shop_table,
    .woocommerce-cart-form table.shop_table tbody,
    .woocommerce-cart-form table.shop_table tr,
    .woocommerce-cart-form table.shop_table td { display: block; width: 100%; box-sizing: border-box; }
    .woocommerce-cart-form table.shop_table tr.cart_item { border: 1px solid #e2dbd0; border-radius: 8px; background: #fff; margin: 10px 0; padding: 8px 12px; }
    .woocommerce-cart-form table.shop_table td { border: none; padding: 4px 0; text-align: left !important; }
    .woocommerce-cart-form td.product-remove { position: relative; height: 0; padding: 0; }
    .woocommerce-cart-form td.product-remove a { position: absolute; right: 2px; top: 8px; }
    .woocommerce-cart-form td.product-thumbnail { display: none; }
    .woocommerce-cart-form td.product-price::before { content: "Price: "; color: #8a7a66; font-size: 13px; }
    .woocommerce-cart-form td.product-quantity::before { content: "Quantity: "; color: #8a7a66; font-size: 13px; }
    .woocommerce-cart-form td.product-subtotal::before { content: "Subtotal: "; color: #8a7a66; font-size: 13px; }
    .woocommerce-cart-form td.actions { padding-top: 12px; }
    .woocommerce-cart-form td.actions .coupon { float: none; display: flex; gap: 8px; margin-bottom: 10px; }
    .woocommerce-cart-form td.actions .coupon input { flex: 1; min-width: 0; }
    .woocommerce-cart-form td.actions button[name=update_cart] { width: 100%; }
    .cart-collaterals .cart_totals { width: 100% !important; float: none; }

    /* product page breathing room */
    .single-product div.product { padding: 16px; }
    .single-product div.product .product_title { font-size: 23px; }

    /* account area: chip menu + tables scroll sideways instead of squeezing */
    .woocommerce-MyAccount-navigation ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
    .woocommerce-MyAccount-navigation li { border: 1px solid #e2dbd0; border-radius: 16px; background: #fff; margin: 0; }
    .woocommerce-MyAccount-navigation li.is-active { background: var(--uneac-primary); }
    .woocommerce-MyAccount-navigation li.is-active a { color: #fff; }
    .woocommerce-MyAccount-navigation li a { padding: 7px 13px; display: block; font-size: 14px; text-decoration: none; }
    .woocommerce-MyAccount-content { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .woocommerce-MyAccount-content table.shop_table { min-width: 560px; }

    /* comfortable tap targets */
    .woocommerce a.button, .woocommerce button.button { padding: 12px 18px; }
}

/* ---------- v0.5: mobile header + category balloons (7/16/26) ---------- */
.uf-cat-chips { display: none; }
@media (max-width: 780px) {
    /* logo left, welcome + account + cart on its right */
    .uf-topbar { flex-wrap: wrap; align-items: center; }
    .uf-logo { flex: 1; min-width: 0; }
    .uf-account { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; column-gap: 14px; row-gap: 2px; max-width: 60%; }
    .uf-account a { font-size: 15px; }
    .uf-search { order: 3; }

    /* categories as swipeable balloons; the dropdown button retires */
    .uf-cats-btn { display: none !important; }
    .uf-cat-chips {
        display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch;
        gap: 8px; padding: 10px 12px; background: #fff; border-bottom: 1px solid #e2dbd0;
        scrollbar-width: none;
    }
    .uf-cat-chips::-webkit-scrollbar { display: none; }
    .uf-chip {
        flex: 0 0 auto; white-space: nowrap; text-decoration: none;
        border: 1px solid var(--uneac-primary); color: var(--uneac-primary);
        border-radius: 17px; padding: 6px 14px; font-size: 14px; font-family: Arial, sans-serif;
    }
    .uf-chip.on { background: var(--uneac-primary); color: #fff; font-weight: 600; }

    /* the remove-X gets its own corner, clear of the item name */
    .woocommerce-cart-form td.product-name { padding-right: 36px; }
}
