/*
Theme Name: Salix Green
Theme URI: https://example.com/salix-green
Author: Salix Green
Author URI: https://example.com
Description: A modern, premium, nature-inspired WordPress + WooCommerce theme for agricultural brands. Clean layouts, soft shadows, large product imagery, full RTL and translation support.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: salix-green
Tags: e-commerce, one-column, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, rtl-language-support, translation-ready, threaded-comments, woocommerce
*/

/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root{
  /* Palette — nature / agriculture, premium & trustworthy */
  --sg-forest:      #1F3B2C;   /* deep forest green — headings, dark surfaces */
  --sg-green:       #3E7A52;   /* brand green — primary actions, links */
  --sg-green-light: #6FA37A;   /* secondary accent, hovers */
  --sg-leaf:        #B7D6A8;   /* soft leaf tint — badges, highlights */
  --sg-clay:        #B07A45;   /* earthy accent — used sparingly */
  --sg-cream:       #F6F4EC;   /* warm off-white background */
  --sg-paper:       #FFFFFF;   /* card / surface background */
  --sg-ink:         #202821;   /* body text */
  --sg-ink-soft:    #56604F;   /* muted text */
  --sg-line:        #E4E2D6;   /* hairline borders */

  --sg-radius-sm: 10px;
  --sg-radius: 18px;
  --sg-radius-lg: 28px;

  --sg-shadow-sm: 0 2px 10px rgba(31,59,44,.06);
  --sg-shadow: 0 12px 32px rgba(31,59,44,.10);
  --sg-shadow-lg: 0 24px 60px rgba(31,59,44,.16);

  --sg-container: 1240px;
  --sg-gutter: 24px;

  --sg-font-display: "Fraunces", "Noto Serif", Georgia, serif;
  --sg-font-body: "Manrope", "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  --sg-font-fa: "Vazirmatn", "Manrope", Tahoma, sans-serif;

  --sg-header-h: 84px;
}

html[dir="rtl"]{
  --sg-font-display: "Vazirmatn", "Fraunces", Tahoma, serif;
  --sg-font-body: "Vazirmatn", "Manrope", Tahoma, sans-serif;
}

/* =========================================================
   RESET
   ========================================================= */
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body{
  margin: 0;
  font-family: var(--sg-font-body);
  color: var(--sg-ink);
  background: var(--sg-cream);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; height: auto; display: block; }
a{ color: var(--sg-green); text-decoration: none; }
a:hover{ color: var(--sg-forest); }
ul{ margin: 0; padding: 0; list-style: none; }
button, input, textarea, select{ font-family: inherit; font-size: 100%; }
:focus-visible{ outline: 3px solid var(--sg-clay); outline-offset: 2px; }

h1, h2, h3, h4{
  font-family: var(--sg-font-display);
  color: var(--sg-forest);
  line-height: 1.2;
  margin: 0 0 .5em;
  font-weight: 600;
}
h1{ font-size: clamp(2.1rem, 4vw, 3.4rem); }
h2{ font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3{ font-size: 1.3rem; }
p{ margin: 0 0 1em; }

.container{ max-width: var(--sg-container); margin: 0 auto; padding: 0 var(--sg-gutter); }
.screen-reader-text{ position:absolute!important; height:1px; width:1px; overflow:hidden; clip:rect(1px,1px,1px,1px); white-space:nowrap; }
.skip-link{ position:absolute; left:-999px; top:0; background:var(--sg-forest); color:#fff; padding:12px 20px; z-index:10000; border-radius:0 0 8px 0; }
.skip-link:focus{ left:0; }

/* Buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:.5em;
  padding: 14px 28px; border-radius: 999px; font-weight:600; font-size:.95rem;
  border: 2px solid transparent; cursor:pointer; transition: all .25s ease;
  background: var(--sg-green); color:#fff;
}
.btn:hover{ background: var(--sg-forest); color:#fff; transform: translateY(-2px); box-shadow: var(--sg-shadow); }
.btn.btn-outline{ background:transparent; border-color: var(--sg-green); color: var(--sg-green); }
.btn.btn-outline:hover{ background: var(--sg-green); color:#fff; }
.btn.btn-clay{ background: var(--sg-clay); }
.btn.btn-clay:hover{ background:#8f602f; }

/* =========================================================
   HEADER
   ========================================================= */
.site-header{
  position: static; top:0; z-index: 1000;
  height: var(--sg-header-h);
  display:flex; align-items:center;
  background: rgba(246,244,236,.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: background .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.site-header.is-solid{
  background: var(--sg-paper);
  box-shadow: var(--sg-shadow-sm);
  border-color: var(--sg-line);
}
.header-inner{ display:flex; align-items:center; justify-content:space-between; gap: 24px; width:100%; }
.site-branding{ display:flex; align-items:center; gap:10px; }
.site-branding img{ max-height: 44px; width:auto; }
.site-title{ font-family: var(--sg-font-display); font-size:1.4rem; color: var(--sg-forest); font-weight:700; }
.site-title a{ color:inherit; }

.primary-nav{ display:flex; }
.primary-nav ul{ display:flex; align-items:center; gap: 28px; }
.primary-nav a{ color: var(--sg-ink); font-weight:600; font-size:.96rem; position:relative; }
.primary-nav a::after{
  content:""; position:absolute; left:0; right:0; bottom:-6px; height:2px;
  background: var(--sg-green); transform: scaleX(0); transform-origin: right;
  transition: transform .25s ease;
}
html[dir="rtl"] .primary-nav a::after{ transform-origin: left; }
.primary-nav a:hover::after, .primary-nav .current-menu-item > a::after{ transform: scaleX(1); }
.primary-nav .sub-menu{
  position:absolute; top:100%; margin-top:14px; background:var(--sg-paper);
  border-radius: var(--sg-radius-sm); box-shadow: var(--sg-shadow); padding:10px;
  min-width:200px; opacity:0; visibility:hidden; transform: translateY(6px);
  transition: all .2s ease;
}
.primary-nav li:hover > .sub-menu{ opacity:1; visibility:visible; transform:translateY(0); }
.primary-nav .sub-menu a::after{ display:none; }
.primary-nav .sub-menu a{ display:block; padding:8px 12px; border-radius:8px; }
.primary-nav .sub-menu a:hover{ background: var(--sg-cream); }

.header-actions{ display:flex; align-items:center; gap: 16px; }
.header-search-toggle, .menu-toggle{
  background:none; border:none; cursor:pointer; color:var(--sg-forest); padding:8px;
  display:flex; align-items:center;
}
.header-search-form{ display:flex; align-items:center; }
.header-search-form input[type="search"]{
  border:1px solid var(--sg-line); border-radius:999px; padding:8px 16px; background:var(--sg-paper);
  width: 200px;
}
.menu-toggle{ display:none; }

@media (max-width: 900px){
  .primary-nav{ display:none; }
  .menu-toggle{ display:flex; }
  .header-search-form input[type=search]{ width:130px; }
}

/* =========================================================
   HERO
   ========================================================= */
.hero{
  position:relative; overflow:hidden;
  min-height: 640px; display:flex; align-items:center;
  background: linear-gradient(180deg, var(--sg-cream) 0%, #EEF1E4 100%);
}
.hero-bg{
  position:absolute; inset:0; z-index:0;
}
.hero-bg img{ width:100%; height:100%; object-fit:cover; }
.hero-bg::after{
  content:""; position:absolute; inset:0;
  background: linear-gradient(100deg, rgba(15,30,20,.72) 10%, rgba(15,30,20,.35) 55%, rgba(15,30,20,.05) 85%);
}
html[dir="rtl"] .hero-bg::after{
  background: linear-gradient(260deg, rgba(15,30,20,.72) 10%, rgba(15,30,20,.35) 55%, rgba(15,30,20,.05) 85%);
}
.hero-content{ position:relative; z-index:1; max-width: 620px; color:#fff; padding: 60px 0; }
.hero-content h1{ color:#fff; }
.hero-content .eyebrow{
  display:inline-block; padding:6px 16px; border-radius:999px; background:rgba(255,255,255,.15);
  color:var(--sg-leaf); font-weight:700; font-size:.8rem; letter-spacing:.06em; margin-bottom:18px;
}
.hero-content p{ color: rgba(255,255,255,.86); font-size:1.1rem; }
.hero-actions{ display:flex; gap:16px; margin-top: 28px; flex-wrap:wrap; }

/* organic leaf-vein divider used between homepage sections */
.leaf-divider{ display:block; width:100%; height:48px; }
.leaf-divider path{ fill: var(--sg-cream); }

/* =========================================================
   SECTIONS (generic)
   ========================================================= */
.section{ padding: 90px 0; }
.section.alt{ background: var(--sg-paper); }
.section-head{ max-width: 640px; margin: 0 auto 48px; text-align:center; }
.section-head .eyebrow{
  color: var(--sg-clay); font-weight:700; letter-spacing:.08em; text-transform:uppercase; font-size:.8rem;
}

/* Category / card grids */
.grid{ display:grid; gap: 28px; }
.grid-4{ grid-template-columns: repeat(4, 1fr); }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-2{ grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1000px){ .grid-4{ grid-template-columns: repeat(2,1fr);} .grid-3{ grid-template-columns: repeat(2,1fr);} }
@media (max-width: 640px){ .grid-4, .grid-3, .grid-2{ grid-template-columns: 1fr; } }

.card{
  background: var(--sg-paper); border-radius: var(--sg-radius); overflow:hidden;
  box-shadow: var(--sg-shadow-sm); transition: transform .3s ease, box-shadow .3s ease;
  border: 1px solid var(--sg-line);
}
.card:hover{ transform: translateY(-6px); box-shadow: var(--sg-shadow); }
.card-media{ aspect-ratio: 4/3; overflow:hidden; background: var(--sg-cream); }
.card-media img{ width:100%; height:100%; object-fit:cover; transition: transform .5s ease; }
.card:hover .card-media img{ transform: scale(1.06); }
.card-body{ padding: 22px; }
.card-body h3{ margin-bottom:.35em; }
.card-body .desc{ color: var(--sg-ink-soft); font-size:.95rem; }

.category-card{ position:relative; border-radius: var(--sg-radius); overflow:hidden; aspect-ratio: 1/1; }
.category-card img{ width:100%; height:100%; object-fit:cover; transition: transform .5s ease; }
.category-card:hover img{ transform: scale(1.08); }
.category-card .label{
  position:absolute; inset:auto 0 0 0; padding: 20px;
  background: linear-gradient(0deg, rgba(15,30,20,.75), transparent);
  color:#fff; font-weight:700;
}

/* About / split section */
.split{ display:grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items:center; }
@media (max-width: 860px){ .split{ grid-template-columns: 1fr; } }
.split-media{ border-radius: var(--sg-radius-lg); overflow:hidden; box-shadow: var(--sg-shadow); }

/* Why choose us / benefits */
.feature-item{ display:flex; gap:16px; align-items:flex-start; }
.feature-icon{
  flex:0 0 auto; width:52px; height:52px; border-radius: 14px;
  background: var(--sg-leaf); display:flex; align-items:center; justify-content:center; color: var(--sg-forest);
}
.feature-icon svg{ width:26px; height:26px; }

/* Applications */
.app-card{ position:relative; border-radius: var(--sg-radius); overflow:hidden; }
.app-card img{ width:100%; aspect-ratio: 3/4; object-fit:cover; }
.app-card .tag{
  position:absolute; top:16px; inset-inline-start:16px; background: var(--sg-paper);
  padding: 6px 14px; border-radius:999px; font-weight:700; font-size:.82rem; color:var(--sg-forest);
}

/* FAQ */
.faq-item{ border-bottom:1px solid var(--sg-line); }
.faq-question{
  display:flex; align-items:center; justify-content:space-between; width:100%;
  background:none; border:none; text-align: start; padding: 20px 0; cursor:pointer;
  font-weight:700; color:var(--sg-forest); font-size:1.05rem;
}
.faq-question .icon{ transition: transform .25s ease; }
.faq-item[open] .faq-question .icon{ transform: rotate(45deg); }
.faq-answer{ padding: 0 0 20px; color: var(--sg-ink-soft); }

/* Contact CTA */
.contact-cta{
  background: var(--sg-forest); color:#fff; border-radius: var(--sg-radius-lg);
  padding: 60px; display:flex; align-items:center; justify-content:space-between; gap: 24px; flex-wrap:wrap;
}
.contact-cta h2{ color:#fff; margin-bottom:.2em; }
.contact-cta p{ color: rgba(255,255,255,.8); margin:0; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer{ background: var(--sg-forest); color: rgba(255,255,255,.82); padding: 70px 0 0; }
.footer-grid{ display:grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 50px; }
@media (max-width: 860px){ .footer-grid{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .footer-grid{ grid-template-columns: 1fr; } }
.footer-grid h4{ color:#fff; font-size:1rem; margin-bottom: 16px; }
.footer-grid ul li{ margin-bottom:10px; }
.footer-grid a{ color: rgba(255,255,255,.8); }
.footer-grid a:hover{ color:#fff; }
.footer-social{ display:flex; gap:12px; margin-top:16px; }
.footer-social a{
  width:38px; height:38px; border-radius:50%; background: rgba(255,255,255,.1);
  display:flex; align-items:center; justify-content:center;
}
.footer-social svg{ width:18px; height:18px; }
.footer-bottom{
  border-top: 1px solid rgba(255,255,255,.12); padding: 22px 0; text-align:center; font-size:.85rem;
}

/* =========================================================
   SHOP / WOOCOMMERCE
   ========================================================= */
.shop-toolbar{ display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom: 34px; flex-wrap:wrap; }
.shop-layout{ display:grid; grid-template-columns: 280px 1fr; gap: 40px; align-items:start; }
@media (max-width: 900px){ .shop-layout{ grid-template-columns: 1fr; } }
.shop-filters{ background:var(--sg-paper); border-radius: var(--sg-radius); padding:24px; border:1px solid var(--sg-line); position:sticky; top: calc(var(--sg-header-h) + 20px); }
.shop-filters h4{ margin-bottom: 10px; }
.shop-filters .filter-group{ margin-bottom: 24px; }
.products-grid,
ul.products{
  display:grid; grid-template-columns: repeat(3,1fr); gap: 26px;
  list-style:none; margin:0; padding:0;
}
ul.products li.product{ list-style:none; }
@media (max-width: 900px){ .products-grid, ul.products{ grid-template-columns: repeat(2,1fr);} }
@media (max-width: 560px){ .products-grid, ul.products{ grid-template-columns: 1fr; } }

.product-card{
  background:var(--sg-paper); border-radius: var(--sg-radius); overflow:hidden; border:1px solid var(--sg-line);
  box-shadow: var(--sg-shadow-sm); transition: box-shadow .3s ease, transform .3s ease; display:flex; flex-direction:column;
}
.product-card:hover{ transform: translateY(-4px); box-shadow: var(--sg-shadow); }
.product-card .product-media{ aspect-ratio: 1/1; overflow:hidden; background:var(--sg-cream); position:relative; }
.product-card .product-media img{ width:100%; height:100%; object-fit:cover; transition: transform .5s ease; }
.product-card:hover .product-media img{ transform: scale(1.06); }
.product-card .badge{ position:absolute; top:14px; inset-inline-start:14px; background:var(--sg-clay); color:#fff; padding:4px 12px; border-radius:999px; font-size:.75rem; font-weight:700; }
.product-card .product-body{ padding: 18px; display:flex; flex-direction:column; gap:8px; flex:1; }
.product-card .price{ font-weight:700; color: var(--sg-forest); }
.product-card .button, a.add-to-cart-redirect, a.request-price-button{
  margin-top:auto; display:inline-flex; align-items:center; justify-content:center;
  padding: 10px 20px; border-radius:999px; background:var(--sg-green); color:#fff; font-weight:700; font-size:.9rem;
  transition: background .2s ease;
}
.product-card .button:hover, a.add-to-cart-redirect:hover, a.request-price-button:hover{ background: var(--sg-forest); color:#fff; }

.pagination{ display:flex; justify-content:center; gap:8px; margin-top: 50px; }
.pagination a, .pagination span{
  min-width:40px; height:40px; display:flex; align-items:center; justify-content:center;
  border-radius:50%; border:1px solid var(--sg-line); color:var(--sg-ink);
}
.pagination .current{ background:var(--sg-green); color:#fff; border-color:var(--sg-green); }

/* Single product */
.product-page{ display:grid; grid-template-columns: 1.1fr 1fr; gap: 56px; }
@media (max-width: 900px){ .product-page{ grid-template-columns: 1fr; } }
.product-gallery-main{ border-radius: var(--sg-radius-lg); overflow:hidden; box-shadow: var(--sg-shadow); margin-bottom: 16px; aspect-ratio: 1/1;}
.product-gallery-main img{ width:100%; height:100%; object-fit:cover; }
.product-gallery-thumbs{ display:flex; gap:12px; flex-wrap:wrap; }
.product-gallery-thumbs img{ width:82px; height:82px; object-fit:cover; border-radius:12px; cursor:pointer; border:2px solid transparent; }
.product-gallery-thumbs img.active, .product-gallery-thumbs img:hover{ border-color: var(--sg-green); }
.product-summary .price{ font-size:1.6rem; font-weight:700; color: var(--sg-forest); margin: 14px 0; }
.product-meta-list{ margin: 20px 0; border-top:1px solid var(--sg-line); }
.product-meta-list li{ display:flex; justify-content:space-between; padding: 12px 0; border-bottom:1px solid var(--sg-line); }
.product-tabs .tab-nav{ display:flex; gap: 10px; border-bottom:2px solid var(--sg-line); margin-bottom: 24px; }
.product-tabs .tab-nav button{
  background:none; border:none; padding: 12px 18px; font-weight:700; color: var(--sg-ink-soft); cursor:pointer;
  border-bottom: 2px solid transparent; margin-bottom:-2px;
}
.product-tabs .tab-nav button.active{ color: var(--sg-forest); border-color: var(--sg-green); }
.product-tabs .tab-panel{ display:none; }
.product-tabs .tab-panel.active{ display:block; }

.breadcrumbs{ font-size:.88rem; color: var(--sg-ink-soft); margin-bottom: 26px; }
.breadcrumbs a{ color: var(--sg-ink-soft); }
.breadcrumbs a:hover{ color: var(--sg-green); }

/* =========================================================
   BLOG
   ========================================================= */
.blog-layout{ display:grid; grid-template-columns: 2fr 1fr; gap: 50px; align-items:start; }
@media (max-width: 900px){ .blog-layout{ grid-template-columns: 1fr; } }
.post-card{ display:grid; grid-template-columns: 260px 1fr; gap: 24px; background:var(--sg-paper); border-radius: var(--sg-radius); border:1px solid var(--sg-line); overflow:hidden; margin-bottom: 26px; }
@media (max-width: 640px){ .post-card{ grid-template-columns: 1fr; } }
.post-card .post-media{ aspect-ratio: 4/3; overflow:hidden; }
.post-card .post-media img{ width:100%; height:100%; object-fit:cover; }
.post-card .post-body{ padding: 20px 20px 20px 0; }
html[dir="rtl"] .post-card .post-body{ padding: 20px 0 20px 20px; }
.post-meta{ font-size:.82rem; color: var(--sg-ink-soft); margin-bottom: 8px; }
.post-meta a{ color: var(--sg-clay); font-weight:700; }

.single-article .featured-media{ border-radius: var(--sg-radius-lg); overflow:hidden; margin-bottom: 30px; box-shadow: var(--sg-shadow); }
.single-article .entry-content{ max-width: 760px; margin:0 auto; font-size:1.05rem; }
.single-article .entry-content h2{ margin-top:1.4em; }
.single-article .entry-content img{ border-radius: var(--sg-radius); }

.widget{ background:var(--sg-paper); border:1px solid var(--sg-line); border-radius: var(--sg-radius); padding: 24px; margin-bottom: 24px; }
.widget h3, .widget h2.widget-title{ font-size:1.05rem; margin-bottom: 16px; }

/* =========================================================
   PAGES (about / contact / 404 / archive)
   ========================================================= */
.page-hero{ padding: 60px 0 20px; text-align:center; }
.values-grid{ display:grid; grid-template-columns: repeat(4,1fr); gap: 24px; }
@media (max-width:900px){ .values-grid{ grid-template-columns: repeat(2,1fr);} }
@media (max-width:560px){ .values-grid{ grid-template-columns: 1fr; } }

.contact-layout{ display:grid; grid-template-columns: 1fr 1fr; gap: 50px; }
@media (max-width: 900px){ .contact-layout{ grid-template-columns: 1fr; } }
.contact-info-list li{ display:flex; gap:14px; margin-bottom: 20px; align-items:flex-start; }
.contact-form input, .contact-form textarea, .contact-form select{
  width:100%; padding: 14px 16px; border-radius: 12px; border:1px solid var(--sg-line);
  background: var(--sg-paper); margin-bottom: 16px;
}
.map-placeholder{ background: var(--sg-leaf); border-radius: var(--sg-radius); height: 320px; display:flex; align-items:center; justify-content:center; color: var(--sg-forest); font-weight:700; }

.error-404{ text-align:center; padding: 100px 0; }
.error-404 .code{ font-family: var(--sg-font-display); font-size: 6rem; color: var(--sg-leaf); }

/* Search form (shared) */
.search-form{ display:flex; gap:10px; }
.search-form input[type=search]{ flex:1; padding: 12px 16px; border-radius:999px; border:1px solid var(--sg-line); }
.search-form button{ background:var(--sg-green); color:#fff; border:none; border-radius:999px; padding: 0 20px; cursor:pointer; }

/* comments */
.comment-list{ margin: 0 0 30px; }
.comment-list li{ margin-bottom: 20px; padding-bottom:20px; border-bottom:1px solid var(--sg-line); }
.comment-author{ font-weight:700; color: var(--sg-forest); }
.comment-meta{ font-size:.82rem; color: var(--sg-ink-soft); margin-bottom: 8px; }

/* mobile drawer menu */
.mobile-nav{
  position: fixed; inset: 0 0 0 auto; width: min(320px, 86%); background: var(--sg-paper);
  transform: translateX(100%); transition: transform .3s ease; z-index: 1100; padding: 24px; overflow-y:auto;
  box-shadow: var(--sg-shadow-lg);
}
html[dir="rtl"] .mobile-nav{ inset: 0 auto 0 0; transform: translateX(-100%); }
.mobile-nav.is-open{ transform: translateX(0); }
.mobile-nav ul li{ border-bottom: 1px solid var(--sg-line); }
.mobile-nav a{ display:block; padding: 14px 0; font-weight:600; color: var(--sg-forest); }
.mobile-nav-close{ background:none; border:none; cursor:pointer; margin-bottom:20px; }
.nav-overlay{ position:fixed; inset:0; background:rgba(15,30,20,.4); z-index:1090; opacity:0; visibility:hidden; transition:all .3s ease; }
.nav-overlay.is-open{ opacity:1; visibility:visible; }

@media (max-width: 900px){
  .section{ padding: 60px 0; }
  .contact-cta{ padding: 40px 24px; }
}
