/*
Theme Name: Kemet Farm Agri Export
Theme URI: https://kemetfarm.example
Author: Kemet Farm
Description: Custom theme for Kemet Farm Agri Export. Controls site-wide header, breadcrumb, footer, colors and typography. Page content is managed per-page in WordPress.
Version: 1.0
Requires PHP: 7.4
Text Domain: kemet-farm
*/

:root{
  --kf-green:#049647;
  --kf-dark-green:#056B38;
  --kf-orange:#E98021;
  --kf-soft-green:#DCEFE3;
  --kf-cream:#FFF9F1;
  --kf-text:#183126;
  --kf-grey:#F4F5F2;
  --kf-white:#FFFFFF;
  --kf-font-heading:'Montserrat',sans-serif;
  --kf-font-body:'Open Sans',sans-serif;
  --kf-font-ar:'Tajawal',sans-serif;
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;overflow-x:hidden;max-width:100%;}
body{background:var(--kf-cream);color:var(--kf-text);font-family:var(--kf-font-body);}
img{max-width:100%;}
a{color:var(--kf-green);text-decoration:none;}
a:hover{color:var(--kf-orange);}
::selection{background:var(--kf-soft-green);}
h1,h2,h3,h4{font-family:var(--kf-font-heading);margin:0;}
[dir="rtl"] body,[dir="rtl"] h1,[dir="rtl"] h2,[dir="rtl"] h3,[dir="rtl"] h4{font-family:var(--kf-font-ar);}

.kf-container{max-width:1180px;margin:0 auto;padding:0 32px;}
.kf-btn{display:inline-block;background:var(--kf-green);color:#fff;padding:14px 28px;border-radius:4px;font:700 15px var(--kf-font-heading);transition:background .18s ease,transform .18s ease;}
.kf-btn:hover{background:var(--kf-dark-green);color:#fff;transform:translateY(-1px);}
.kf-btn-outline{display:inline-block;background:transparent;color:#fff;border:2px solid var(--kf-orange);padding:12px 26px;border-radius:4px;font:700 15px var(--kf-font-heading);transition:background .18s ease,transform .18s ease;}
.kf-btn-outline:hover{background:rgba(233,128,33,0.15);color:#fff;transform:translateY(-1px);}
.kf-variety-card{transition:box-shadow .2s ease,transform .2s ease;}
.kf-variety-card:hover{box-shadow:0 12px 28px rgba(5,107,56,0.12);transform:translateY(-3px);}
.kf-cat-card{transition:box-shadow .2s ease,transform .2s ease;}
.kf-cat-card:hover{box-shadow:0 14px 30px rgba(5,107,56,0.14);transform:translateY(-3px);}
a{transition:color .15s ease;}
.kf-menu-toggle{display:none;}
.kf-menu-overlay{display:none;}
.kf-header-right{display:flex;align-items:center;gap:28px;flex-wrap:wrap;}
button,.kf-btn,.kf-btn-outline,a{-webkit-tap-highlight-color:transparent;}

/* Site-wide mobile fixes — applies to every page's inline-styled grids/type without duplicating CSS per page */
@media (max-width:900px){
  .kf-menu-toggle{display:flex;}
  .kf-header-right{
    position:fixed;top:0;right:-100%;height:100dvh;width:min(320px,86%);
    background:#fff;flex-direction:column;align-items:flex-start;justify-content:flex-start;
    padding:96px 28px 28px;gap:0;transition:right .3s ease;box-shadow:-10px 0 30px rgba(0,0,0,0.15);
    z-index:70;overflow-y:auto;
  }
  .kf-header-right[data-open="true"]{right:0;}
  .kf-header-right .kf-primary-menu{flex-direction:column!important;align-items:flex-start!important;gap:22px!important;width:100%;}
  .kf-header-right .kf-primary-menu a{font-size:17px!important;display:block;padding:8px 0;}
  .kf-header-actions{flex-direction:column!important;align-items:stretch!important;width:100%;gap:14px!important;margin-top:32px;}
  .kf-header-actions button,.kf-header-actions .kf-btn{width:100%;text-align:center;min-height:46px;box-sizing:border-box;}
  .kf-menu-overlay[data-open="true"]{display:block;position:fixed;inset:0;background:rgba(24,49,38,0.4);z-index:45;}
  body.kf-menu-locked{overflow:hidden;}
}
/* Product pages: image sits statically above specs on mobile — no scroll-stick */
@media (max-width:900px){
  [style*="position:static"] + div table,
  table{font-size:13px;}
  table th,table td{padding:8px 6px!important;}
}
/* Product hero: stack before the text column's min-content width starves the image track */
@media (max-width:1000px){
  [style*="minmax(0,1fr) minmax(0,1fr)"]{grid-template-columns:1fr!important;}
}
@media (max-width:768px){
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns:repeat(2,1fr)"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns:1.1fr 0.9fr"],
  [style*="grid-template-columns:1fr 1.4fr"],
  [style*="grid-template-columns:1.4fr 1fr"],
  [style*="grid-template-columns:1.4fr 1fr 1fr"],
  [style*="grid-template-columns:180px 1fr"]{grid-template-columns:1fr!important;}
  [style*="grid-template-columns:repeat(5,1fr)"]{grid-template-columns:repeat(2,1fr)!important;}
  [style*="grid-template-columns:180px 1fr"] img,[style*="grid-template-columns:180px 1fr"] > div:first-child{min-height:200px!important;}
  h1[style*="font:800 46px"],h1[style*="font:800 38px"]{font-size:28px!important;}
  h1[style*="font:800 36px"]{font-size:26px!important;}
  h2[style*="font:700 32px"]{font-size:24px!important;}
  section[style*="padding:100px"],section[style*="padding:90px"],section[style*="padding:80px"],section[style*="padding:70px"]{padding-top:48px!important;padding-bottom:48px!important;}
  .kf-container,section>div[style*="max-width:1180px"]{padding-left:20px!important;padding-right:20px!important;}
  input,textarea,select,button{font-size:16px!important;} /* prevents iOS zoom-on-focus */
  table{min-width:0!important;width:100%!important;}
  table th,table td{white-space:normal!important;}
  [style*="min-width:52px"]{min-width:40px!important;flex:1 1 40px!important;font-size:11px!important;padding:8px 2px!important;}
}
@media (max-width:380px){
  [style*="min-width:52px"]{min-width:calc(33.33% - 5px)!important;flex:0 0 calc(33.33% - 5px)!important;}
}


/* KF product photo gallery */
.kf-gallery{max-width:1040px;margin:0 auto 90px;padding:0 32px}
.kf-gallery h2{color:#183126;font:700 24px Montserrat,sans-serif;margin:0 0 18px}
.kf-g-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:14px}
.kf-g-item{display:block;border:1px solid #F4F5F2;border-radius:8px;overflow:hidden}
.kf-g-item img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block;transition:transform .3s}
.kf-g-item:hover img{transform:scale(1.05)}
.kf-lb{position:fixed;inset:0;background:rgba(10,24,16,.93);display:none;align-items:center;justify-content:center;padding:24px;z-index:9999}
.kf-lb:target{display:flex}
.kf-lb img{max-width:92vw;max-height:88vh;border-radius:8px;position:relative;z-index:2}
.kf-lb-bg{position:absolute;inset:0;z-index:1}

/* KF hero copy panel */
.kf-hero-copy{background:rgba(6,30,18,.42);border:1px solid rgba(255,255,255,.16);border-radius:18px;padding:34px 30px;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
@media (max-width:640px){.kf-hero-copy{padding:22px 16px;border-radius:14px;margin:0 4px}}