/* ==========================================================================
   Cain Food Industries – Clean Static Theme
   Matches original Avada design. ~550 lines.
   ========================================================================== */

/* --- Design Tokens --- */
:root {
  --brown:      #351e0e;
  --green:      #65bc7b;
  --green-dark: #54a868;
  --orange:     #f0682f;
  --orange-dark:#d85a25;
  --text:       #333;
  --gray:       #747474;
  --gray-light: #f6f6f6;
  --gray-light2:#f5f5f5;
  --border:     #e0dede;
  --border-lt:  #ebeaea;
  --white:      #fff;
  --font-heading: 'Montserrat', sans-serif;
  --font-body:    'PT Sans', sans-serif;
  --max-w:      1200px;
}

/* === 1. Reset + Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.7;
  color: var(--brown);
  background: var(--white);
  overflow-x: hidden;
}
body.menu-open { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--orange); text-decoration: none; transition: color .2s; }
a:hover { color: var(--orange-dark); }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--brown);
  font-weight: 700;
  line-height: 1.3;
}
h1 { font-size: 40px; }
h2 { font-size: 30px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }
h5 { font-size: 14px; color: var(--gray); text-transform: uppercase; letter-spacing: 2px; }
p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }
table { width: 100%; border-collapse: collapse; }

/* === 2. Layout === */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}
.narrow { max-width: 700px; margin: 0 auto; }
.section { padding: 80px 0; }
.section-gray { background: var(--gray-light); }

/* === 3. Header === */

/* Secondary bar */
.secondary-bar {
  background: var(--brown);
  color: var(--white);
  font-style: italic;
  font-size: 13px;
  font-weight: 300;
  text-align: right;
  padding: 0 20px;
  height: 44px;
  line-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Main header */
#site-header { position: relative; }
.main-header {
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.main-header > .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 95px;
}
#site-header.is-sticky .main-header { box-shadow: 0 2px 12px rgba(0,0,0,.12); }
.logo img { width: 249px; height: 75px; }

/* Desktop nav */
.main-nav > ul { display: flex; gap: 28px; align-items: center; margin: 0; }
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a {
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0;
  color: var(--brown);
  padding: 8px 0;
  display: block;
  font-weight: 400;
  transition: color .2s;
}
.main-nav > ul > li > a:hover,
.main-nav > ul > li > a[aria-current="page"] { color: var(--orange); }
.main-nav svg { vertical-align: middle; margin-left: 4px; }

/* Mega dropdown */
.has-mega-menu { position: relative; }
.has-mega-menu::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 12px;
}
.mega-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: -60px;
  background: var(--brown);
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
  width: 420px;
  z-index: 900;
}
.has-mega-menu:hover > .mega-menu,
.has-mega-menu:focus-within > .mega-menu {
  display: flex;
}
.mega-col {
  flex: 1;
  padding: 28px 30px;
}
.mega-col + .mega-col { border-left: 1px solid rgba(255,255,255,.12); }
.mega-heading {
  font-family: var(--font-body);
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,.85);
  padding: 0 0 12px;
  margin: 0 0 8px;
  display: block;
  letter-spacing: 0;
}
.mega-menu ul { padding: 0; }
.main-nav .mega-menu a {
  font-family: var(--font-body);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 400;
  padding: 8px 0;
  line-height: 1.4;
  color: rgba(255,255,255,.6);
  transition: color .2s;
  display: block;
}
.main-nav .mega-menu a:hover { color: var(--white); }

/* Hamburger button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  position: relative;
  flex-shrink: 0;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--brown);
  position: absolute;
  left: 10px;
  transition: transform .3s, opacity .2s;
}
.menu-toggle span:nth-child(1) { top: 14px; }
.menu-toggle span:nth-child(2) { top: 21px; }
.menu-toggle span:nth-child(3) { top: 28px; }
.menu-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.menu-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav close button (X) */
.nav-close {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: var(--brown);
  border: none;
  border-radius: 50%;
  font-size: 24px;
  line-height: 42px;
  text-align: center;
  color: var(--white);
  cursor: pointer;
  z-index: 10001;
  transition: background .2s;
}
.nav-close:hover { background: var(--orange); }

/* Products arrow indicator on mobile */
.has-mega-menu > a svg { transition: transform .3s; }
.has-mega-menu.mega-open > a svg { transform: rotate(180deg); }

/* === 4. Hero / Masthead === */
.hero {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  padding: 100px 20px 50px;
  min-height: 280px;
}
.hero > * { position: relative; z-index: 1; }
.hero img { max-width: 600px; width: 80%; }
.hero h1 {
  color: var(--white);
  font-weight: 600;
  font-size: 40px;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin: 0;
}
/* Inner page masthead — consistent across all non-homepage pages */
.hero-inner {
  padding: 106px 20px;
  min-height: 320px;
  background-attachment: scroll;
}
.hero-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.15);
}
.hero-orange::before {
  background: rgba(210,100,30,.55);
}

/* === 5. Featured bar === */
.featured-bar {
  background: var(--brown);
  color: var(--white);
  text-align: center;
  padding: 30px 20px;
}
.featured-bar h3 {
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
}

/* === 6. Grid === */
.grid-2, .grid-3 { display: grid; gap: 4%; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* === 7. Cards === */
.cards-section { padding: 20px 0 0; }
.card {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--white);
  transition: transform .3s, box-shadow .3s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
}
.card img {
  width: 100%;
  height: auto;
  transition: transform .4s;
}
.card:hover img { transform: scale(1.05); }
.card-label {
  display: block;
  padding: 16px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  color: var(--brown);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--white);
}

/* === 8. About section (homepage) === */
.about-section {
  text-align: center;
  padding: 40px 20px 60px;
}
.about-section h5 {
  margin-bottom: 16px;
}
.about-section h4 {
  font-weight: 300;
  font-size: 24px;
  margin-bottom: 24px;
}
.about-section p {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 24px;
}
.about-section img {
  margin: 0 auto;
}

/* === 9. CTA section === */
.cta-section {
  background-size: cover;
  background-position: center bottom;
  background-attachment: fixed;
  position: relative;
  text-align: center;
  color: var(--white);
  padding: 96px 20px;
}
.cta-section > .container { position: relative; z-index: 1; }
.cta-section h4 {
  color: var(--white);
  font-style: italic;
  font-weight: 300;
  font-size: 24px;
  margin-bottom: 24px;
}

/* === 10. Buttons === */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  padding: 13px 29px;
  border: 1px solid var(--white);
  border-radius: 0;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  min-height: 44px;
  line-height: 17px;
  color: var(--white);
  background: rgba(255,255,255,0);
}
.btn:hover {
  background: rgba(255,255,255,.35);
  color: var(--white);
}
/* Outline button on light backgrounds */
.btn-outline-dark {
  border-color: var(--brown);
  color: var(--brown);
  background: transparent;
}
.btn-outline-dark:hover {
  background: var(--brown);
  color: var(--white);
}
.btn-outline {
  border: 2px solid var(--white);
  color: var(--white);
  background: transparent;
}
.btn-outline:hover {
  background: rgba(255,255,255,.2);
  color: var(--white);
}

/* === 11. Product Toggles === */
.product-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4%;
  align-items: start;
}
@media (max-width: 800px) {
  .product-columns { grid-template-columns: 1fr; }
}
.toggle-section { margin-bottom: 24px; }
.toggle-section-header,
.section-heading {
  background: var(--brown);
  color: var(--white);
  padding: 14px 20px;
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 2px;
  margin: 0 0 0 0;
}
.accent { color: var(--orange); }
.toggle-item {
  background: var(--gray-light2);
  border: 1px solid var(--border);
  border-top: none;
}
.toggle-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  min-height: 44px;
  user-select: none;
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--orange);
  font-size: 13px;
}
.toggle-title::before {
  content: '+';
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.toggle-item.is-open .toggle-title::before { content: '−'; }
.toggle-content {
  max-height: 0;
  overflow: hidden;
  padding: 0 16px 0 48px;
  font-size: 13px;
  line-height: 1.7;
  transition: max-height .25s ease, padding .25s ease;
}
.toggle-item.is-open .toggle-content {
  max-height: 500px;
  padding: 0 16px 16px 48px;
}
/* Expand/Collapse All button */
.toggle-controls {
  margin-bottom: 16px;
  text-align: right;
}
.toggle-all {
  font-family: var(--font-heading);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--orange);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0;
  font-weight: 700;
  transition: color .2s;
}
.toggle-all:hover { color: var(--brown); }
.toggle-label {
  color: var(--orange);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
}

/* === 12. Sales Table === */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sales-table th,
.sales-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.sales-table th {
  background: var(--brown);
  color: var(--white);
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
}
.sales-table tr:nth-child(even) td { background: var(--gray-light); }
.sales-table a { font-weight: 600; color: var(--orange); }

/* === 13. Contact === */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.contact-info h4 {
  margin-bottom: 4px;
  font-size: 15px;
}
.contact-info p { margin-bottom: 16px; }
.contact-map { border-radius: 4px; overflow: hidden; min-height: 350px; }
.contact-map iframe { width: 100%; height: 350px; border: 0; }

/* === 14. About page === */
.about-photos { padding: 0; }
.about-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.about-photo-grid > div {
  overflow: hidden;
}
.about-photo-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s;
}
.about-photo-grid > div:hover img { transform: scale(1.05); }
.about-checklist ul {
  text-align: left;
  list-style: none;
}
.about-checklist li {
  padding: 8px 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.check-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}
.logo-row img { max-height: 80px; width: auto; }

/* === 15. Featured products === */
.featured-product {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}
.featured-product:last-child { border-bottom: none; }
.featured-product h3 { margin-bottom: 8px; }

/* === 16. Footer === */
#site-footer {
  background: var(--brown);
  color: #fefefe;
  padding: 32px 20px;
  text-align: center;
  font-size: 13px;
}
#site-footer a { color: rgba(255,255,255,.7); }
#site-footer a:hover { color: var(--white); }

/* === 17. Additional page styles === */
.content-section { padding: 60px 0; }
.content-section + .content-section { padding-top: 0; }
.lead { font-size: 14px; font-weight: 300; line-height: 28px; }
.dark-bar {
  background: var(--brown);
  color: var(--white);
  padding: 40px 20px;
  text-align: center;
}
.dark-bar h3, .dark-bar h4 { color: var(--white); margin-bottom: 12px; }
.gallery-section { padding: 60px 0; }
.gallery-section .grid-3 img { width: 100%; border-radius: 4px; }
.partners-section { padding: 60px 0; text-align: center; }
.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 20px 0;
}
.logo-row img { max-height: 60px; width: auto; opacity: .7; transition: opacity .2s; }
.logo-row img:hover { opacity: 1; }
.logos-bar { background: var(--gray-light); padding: 40px 20px; text-align: center; }
.products-section { padding: 60px 0; }
.product-links { columns: 2; column-gap: 32px; }
.product-links a {
  display: block;
  padding: 8px 0;
  color: var(--text);
  font-size: 14px;
  break-inside: avoid;
}
.product-links a:hover { color: var(--orange); }
/* Sales page */
.service-box {
  border: 1px solid var(--border);
  padding: 30px 24px;
  text-align: center;
}
.service-box p { font-size: 13px; text-align: left; }
.sales-grid { gap: 40px 4%; }
.sales-card {
  text-align: center;
}
.sales-card h5 {
  font-size: 16px;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.sales-title {
  font-style: italic;
  font-size: 13px;
  margin-bottom: 4px;
}
.sales-region {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 8px;
}
.sales-contact { font-size: 14px; margin-bottom: 4px; }
.sales-card a { color: var(--orange); }
.btn-email {
  display: inline-block;
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 20px;
  border: 2px solid var(--orange);
  color: var(--orange);
  background: transparent;
  transition: all .2s;
  margin-top: 4px;
}
.btn-email:hover {
  background: var(--orange);
  color: var(--white);
}
.spec-card {
  background: var(--gray-light);
  padding: 24px;
  border-left: 3px solid var(--orange);
}
.spec-card h4 { margin-bottom: 8px; }
.specs-section { padding: 60px 0; }
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 768px) {
  .contact-layout { grid-template-columns: 1fr; }
  .product-links { columns: 1; }
}

/* === 18. Utilities === */
.text-center { text-align: center; }
.text-white { color: var(--white) !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mb-40 { margin-bottom: 40px; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.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;
}

/* === 18. Tablet (max 1024px) === */
@media (max-width: 1024px) {
  .main-nav > ul { gap: 18px; }
  .main-nav > ul > li > a { font-size: 13px; }
  .hero h1 { font-size: 32px; }
  .section { padding: 60px 0; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

/* === 19. Mobile (max 768px) === */
@media (max-width: 768px) {
  body { font-size: 16px; line-height: 1.8; }

  /* Header */
  .secondary-bar { font-size: 11px; height: 36px; }
  .logo img { width: 180px; height: auto; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }

  /* ===== MOBILE NAV — fullscreen overlay ===== */
  .nav-close { display: block; }
  .main-nav {
    display: none;
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: var(--brown);
    z-index: 9999;
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .main-nav.is-open { display: block; }
  body.menu-open { overflow: hidden; }

  /* Close button */
  .nav-close {
    position: fixed;
    top: 16px;
    right: 16px;
    color: var(--white);
    background: rgba(255,255,255,.15);
    border-color: rgba(255,255,255,.3);
    z-index: 10000;
  }
  .nav-close:hover { background: rgba(255,255,255,.3); color: var(--white); }

  /* Main menu items — full width, left aligned */
  .main-nav > ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 70px 0 40px;
    width: 100%;
  }
  .main-nav > ul > li {
    border-bottom: 1px solid rgba(255,255,255,.1);
    width: 100%;
  }
  .main-nav > ul > li > a {
    font-size: 18px;
    padding: 18px 30px;
    min-height: 56px;
    color: var(--white);
    display: block;
    text-align: left;
    width: 100%;
    text-transform: uppercase;
  }
  .main-nav > ul > li > a:hover,
  .main-nav > ul > li > a[aria-current="page"] {
    background: rgba(255,255,255,.06);
  }

  /* Products sub-menu — flush, no background change, full width */
  .mega-menu {
    position: static !important;
    transform: none !important;
    box-shadow: none !important;
    display: none;
    flex-direction: column;
    padding: 0 !important;
    width: 100% !important;
    background: none !important;
    border: none !important;
  }
  .has-mega-menu > .mega-menu { display: none !important; }
  .has-mega-menu.mega-open > .mega-menu { display: flex !important; }

  .mega-col {
    padding: 0;
    width: 100%;
  }
  .mega-col + .mega-col { border-left: none; border-top: none; }

  .mega-heading {
    color: var(--orange);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 14px 30px 8px;
    margin: 0;
    border-bottom: none;
  }

  .main-nav .mega-menu a {
    color: rgba(255,255,255,.75);
    font-size: 17px;
    padding: 14px 30px 14px 44px;
    min-height: 48px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,.06);
    text-transform: none;
  }
  .main-nav .mega-menu li:last-child a { border-bottom: none; }
  .main-nav .mega-menu a:hover { color: var(--white); background: rgba(255,255,255,.05); }

  /* Hero */
  .hero { padding: 60px 16px; min-height: 240px; background-attachment: scroll; }
  .hero img { max-width: 90%; }
  .hero h1 { font-size: 26px; letter-spacing: 2px; }
  .hero-inner { padding: 70px 16px; min-height: 220px; }

  /* Sections */
  .section { padding: 48px 0; }
  .container { padding: 0 16px; }
  h2 { font-size: 24px; }
  h3 { font-size: 18px; }
  .toggle-content { font-size: 15px; }
  .sales-region, .sales-title, .service-box p { font-size: 15px; }
  .accent { font-size: 13px; }

  /* Grids */
  .grid-2, .grid-3 { grid-template-columns: 1fr; }

  /* Cards */
  .cards-section .grid-3 { gap: 16px; }

  /* CTA */
  .cta-section { background-attachment: scroll; padding: 60px 16px; }
  .cta-section h4 { font-size: 18px; }

  /* About */
  .about-section h4 { font-size: 20px; }

  /* About photos */
  .about-photo-grid { grid-template-columns: 1fr 1fr; }

  /* Sales service boxes */
  .service-boxes.grid-3 { grid-template-columns: 1fr; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr; gap: 24px; }

  /* Tables */
  .sales-table th, .sales-table td { padding: 10px 12px; font-size: 13px; white-space: nowrap; }

  /* Footer */
  #site-footer { padding: 24px 16px; }
}

/* === 20. Small mobile (max 480px) === */
@media (max-width: 480px) {
  .hero { min-height: 240px; padding: 40px 12px; }
  .hero h1 { font-size: 22px; }
  .logo img { width: 150px; }
  .btn { width: 100%; }
  .featured-bar { padding: 32px 12px; }
}

/* === 21. Print === */
@media print {
  .secondary-bar, .main-header, #site-footer, .menu-toggle, .cta-section { display: none; }
  body { font-size: 12pt; color: #000; }
  .hero { min-height: auto; padding: 20px; }
  .hero::before { display: none; }
}
