/*
Theme Name: Spice Trail
Theme URI: https://example.com/spice-trail
Author: Your Name
Description: A WordPress theme for Palesa wa di Spice in the brand colours (orange, cream, deep red and deep green), with a built-in product catalogue, cart, and WhatsApp ordering.
Version: 1.2.0
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: spicetrail
*/

/* Brand palette (from the Palesa wa di Spice logo board):
   orange #F29D18, cream #F7F0C1, deep red #931310, deep green #0D3629 */
:root {
  --orange: #F29D18;
  --orange-light: #F9C76B;
  --cream-brand: #F7F0C1;   /* brand cream: used for text on dark backgrounds */
  --bg: #FFFEFB;            /* page background: near-white */
  --bg-alt: #F8F6EF;        /* alternate section background */
  --red: #931310;
  --red-dark: #6E0D0B;
  --green: #0D3629;
  --green-mid: #1D5A45;
  --line: #E6E2D3;
  --whatsapp: #25D366;
  --radius: 12px;
  --shadow: 0 6px 20px rgba(13, 54, 41, .14);
  --font-head: "Barlow Semi Condensed", "Bahnschrift", "Arial Narrow", Arial, sans-serif;
  --font-body: "Montserrat", "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--green);
  background: var(--bg);
  line-height: 1.7;
}
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--green);
  line-height: 1.15;
  margin: 0 0 .5em;
}
a { color: var(--red); }
a:hover { color: var(--red-dark); }
img { max-width: 100%; height: auto; display: block; }
.container { width: min(1180px, 92%); margin-inline: auto; }
.section { padding: 72px 0; }
.section-title { text-align: center; font-size: clamp(1.7rem, 4vw, 2.5rem); text-transform: uppercase; letter-spacing: .08em; }
.section-title::after { content: ""; display: block; width: 56px; height: 4px; border-radius: 2px; background: var(--red); margin: 14px auto 0; }
.section-sub { text-align: center; max-width: 620px; margin: 0 auto 40px; opacity: .85; }
.screen-reader-text { position: absolute; left: -9999px; }

/* Buttons */
.btn {
  display: inline-block; border: 0; cursor: pointer;
  padding: 12px 26px; border-radius: 999px; font: 700 .95rem var(--font-body);
  background: var(--orange); color: var(--green); text-decoration: none;
  transition: transform .15s, background .15s;
}
.btn:hover { background: var(--orange-light); color: var(--green); transform: translateY(-2px); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); color: #fff; }
.btn-whatsapp { background: var(--whatsapp); color: var(--green); }
.btn-whatsapp:hover { background: #3fe07f; color: var(--green); }

/* Top bar + header */
.topbar { background: var(--red); color: var(--cream-brand); font-size: .82rem; text-align: center; padding: 6px 0; }
.site-header { background: var(--orange); position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 8px 0; }
.site-title { display: block; line-height: 0; text-decoration: none; }
.site-logo { display: block; height: 64px; width: auto; max-width: 100%; }
.custom-logo { max-height: 64px; width: auto; }
.main-nav ul { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; }
.main-nav a { color: var(--green); text-decoration: none; font-weight: 700; padding-bottom: 3px; border-bottom: 3px solid transparent; }
.main-nav a:hover { color: var(--red); }
.main-nav .current-menu-item a, .main-nav .current_page_item a { color: var(--red); border-bottom-color: var(--red); }
.cart-toggle {
  background: var(--green); color: var(--cream-brand); border: 0; cursor: pointer;
  border-radius: 999px; padding: 9px 18px; font: 700 .9rem var(--font-body);
}
.cart-toggle:hover { background: var(--green-mid); }
.cart-count { background: var(--orange); color: var(--green); border-radius: 999px; padding: 1px 8px; margin-left: 6px; font-size: .85rem; }
.menu-toggle { display: none; background: none; border: 2px solid var(--green); color: var(--green); border-radius: 8px; padding: 6px 12px; font-size: 1.1rem; cursor: pointer; }

/* Hero */
.hero {
  background:
    linear-gradient(90deg, transparent calc(50% + 60px), var(--red) calc(50% + 60px)),
    linear-gradient(135deg, var(--orange) 0%, #EE9410 100%);
  color: var(--green); padding: 96px 0;
}
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
.hero p { font-size: 1.1rem; max-width: 520px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.hero-art {
  aspect-ratio: 1; border-radius: 50%; background: var(--green);
  display: grid; place-items: center; box-shadow: var(--shadow); overflow: hidden;
  font-size: 7rem; color: var(--orange);
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.hero-art--logo { background: var(--bg); padding: 9%; }
.hero-art--logo img { object-fit: contain; }

/* Trust badges */
.badges { background: var(--green); color: var(--cream-brand); }
.badges ul { list-style: none; margin: 0; padding: 14px 0; display: flex; flex-wrap: wrap; gap: 6px 32px; justify-content: center; font-weight: 600; font-size: .9rem; }
.badges li::before { content: "\2714\00a0"; color: var(--orange); }

/* Features */
.features { background: var(--bg-alt); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.feature { text-align: center; padding: 28px 20px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.feature .icon { font-size: 2.4rem; }

/* Range */
.range-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; max-width: 900px; margin: 0 auto 28px; }
.range-photo { display: block; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: var(--green); transition: transform .2s; }
.range-photo:hover { transform: translateY(-5px); color: var(--green); }
.range-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.range-photo span { display: block; padding: 12px 16px 14px; font-size: .85rem; }
.range-photo strong { display: block; font-family: var(--font-head); font-size: 1.2rem; color: var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 36px; }
.chip { padding: 7px 18px; border-radius: 999px; background: var(--bg-alt); border: 2px solid var(--orange); font-weight: 700; font-size: .9rem; }
.range-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.range-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; border-top: 5px solid var(--red); }
.range-card h3 { margin-bottom: .3em; }
.range-card p { margin: 0; }

/* Products */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px; }
.product-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s; }
.product-card:hover { transform: translateY(-5px); }
.product-thumb { aspect-ratio: 1; background: var(--bg-alt); display: grid; place-items: center; font-size: 4rem; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-body h3 { font-size: 1.3rem; margin: 0; }
.product-body h3 a { color: inherit; text-decoration: none; }
.product-meta { font-size: .85rem; opacity: .75; }
.product-price { font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; color: var(--red); }
.product-actions { margin-top: auto; display: flex; gap: 8px; align-items: center; }
.product-actions select { padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--green); font: inherit; font-size: .85rem; flex: 1; min-width: 0; }
.product-actions .btn { padding: 9px 16px; background: var(--red); color: #fff; }
.product-actions .btn:hover { background: var(--red-dark); color: #fff; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 32px; }
.filter-bar a { padding: 7px 18px; border-radius: 999px; border: 2px solid var(--orange); text-decoration: none; font-weight: 700; color: var(--green); }
.filter-bar a:hover { background: var(--orange); color: var(--green); }
.filter-bar a.active { background: var(--red); border-color: var(--red); color: #fff; }

/* Single product */
.single-product-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.single-product-wrap .product-thumb { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: 8rem; }
.single-product-wrap .product-price { font-size: 2rem; margin: 10px 0 18px; }

/* About / team */
.about-split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.about-card { background: var(--green); color: var(--cream-brand); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.about-card img { width: 100%; height: auto; background: var(--orange); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; }
.about-card ul { margin: 0; padding-left: 1.1em; }
.about-card li { margin-bottom: 4px; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.team-member { text-align: center; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 20px; }
.team-member h3 { margin-bottom: .1em; }
.team-role { margin: 0; opacity: .8; }
.avatar { width: 84px; height: 84px; border-radius: 50%; background: var(--orange); color: var(--green); display: grid; place-items: center; font: 700 2.2rem var(--font-head); margin: 0 auto 14px; }

/* CTA band */
.cta-band { background: var(--red); color: #fff; text-align: center; }
.cta-band h2 { color: var(--orange-light); }

/* Content pages */
.entry { background: #fff; padding: 36px; border-radius: var(--radius); box-shadow: var(--shadow); }
.post-list article { margin-bottom: 28px; }

/* Footer */
.site-footer { background: var(--green); color: var(--cream-brand); padding: 56px 0 24px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.site-footer h4 { color: var(--orange); text-transform: uppercase; letter-spacing: .08em; }
.site-footer a { color: var(--orange-light); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.footer-logo { display: inline-block; background: var(--orange); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; line-height: 0; }
.footer-logo img { width: 190px; height: auto; }
.footer-bottom { border-top: 1px solid rgba(247, 240, 193, .18); margin-top: 32px; padding-top: 18px; text-align: center; font-size: .8rem; }

/* Floating WhatsApp */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  background: var(--whatsapp); color: #fff; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.7rem; text-decoration: none; box-shadow: 0 6px 18px rgba(0,0,0,.3);
}

/* Cart drawer */
.cart-overlay { position: fixed; inset: 0; background: rgba(13, 54, 41, .6); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 90; }
.cart-overlay.open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 100%);
  background: var(--bg); z-index: 100; transform: translateX(100%);
  visibility: hidden; transition: transform .3s, visibility 0s .3s;
  display: flex; flex-direction: column;
}
.cart-drawer.open { transform: none; visibility: visible; transition: transform .3s; box-shadow: -8px 0 30px rgba(0,0,0,.25); }
.cart-head { background: var(--green); color: var(--orange); padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; }
.cart-head h3 { margin: 0; color: var(--orange); }
.cart-close { background: none; border: 0; color: var(--cream-brand); font-size: 1.6rem; cursor: pointer; }
.cart-items { flex: 1; overflow-y: auto; padding: 16px 22px; }
.cart-empty { text-align: center; opacity: .7; padding: 40px 0; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line .name { font-weight: 700; }
.cart-line .opt { font-size: .85rem; opacity: .7; }
.cart-line .qty { display: flex; align-items: center; gap: 8px; }
.cart-line .qty button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--green); background: #fff; color: var(--green); cursor: pointer; }
.cart-line .remove { background: none; border: 0; color: var(--red); cursor: pointer; font-size: .85rem; }
.cart-foot { padding: 18px 22px; border-top: 3px solid var(--orange); background: #fff; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; }
.cart-foot input, .cart-foot textarea { width: 100%; padding: 9px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .9rem; color: var(--green); }
.cart-foot .btn { width: 100%; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--green); color: var(--orange-light); padding: 10px 22px; border-radius: 999px; z-index: 120; opacity: 0; transition: opacity .25s; pointer-events: none; }
.toast.show { opacity: 1; }

/* Responsive */
@media (max-width: 860px) {
  .hero-inner, .single-product-wrap, .about-split { grid-template-columns: 1fr; }
  .about-split { gap: 28px; }
  .hero { background: linear-gradient(180deg, transparent 58%, var(--red) 58%), linear-gradient(135deg, var(--orange) 0%, #EE9410 100%); }
  .hero-art { max-width: 320px; margin: 0 auto; font-size: 5rem; }
  .menu-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--orange); padding: 14px 4%; box-shadow: var(--shadow); }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 12px; }
  .header-inner { position: relative; }
  .site-logo, .custom-logo { height: 52px; max-height: 52px; }
}
