/*
Theme Name: Fresh Chicken Company
Description: Modern WordPress theme for Fresh Chicken Company - NZ wholesale poultry processor & distributor
Author: Fresh Chicken Company
Version: 1.1.0
Text Domain: fresh-chicken
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.3
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* Basic fallback styles to ensure theme displays properly while assets load */
:root {
  --color-burnt-orange: #DA6B3B;
  --color-dark-roast: #1B1D29;
  --color-slate-navy: #313549;
  --color-shell: #F1DCD3;
  --color-pure-white: #FFFFFF;
  --font-heading: 'Bitter', serif;
  --font-body: 'Inter', sans-serif;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --border-radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--color-dark-roast);
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.site-header {
  background: var(--color-pure-white);
  border-bottom: 1px solid rgba(27, 29, 41, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.site-navigation {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin: 0;
}

.site-title a {
  color: var(--color-dark-roast);
  text-decoration: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-lg);
}

.nav-menu a {
  color: var(--color-dark-roast);
  text-decoration: none;
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: var(--space-md) var(--space-xl);
  background-color: var(--color-burnt-orange);
  color: var(--color-pure-white);
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 500;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background-color: #C55A2A;
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-burnt-orange);
  border: 2px solid var(--color-burnt-orange);
}

.section {
  padding: var(--space-xl) 0;
}

.section--hero {
  background: linear-gradient(135deg, var(--color-shell) 0%, var(--color-pure-white) 100%);
  padding: 4rem 0;
}

.hero {
  display: grid;
  gap: 2rem;
  text-align: center;
  align-items: center;
}

@media (min-width: 768px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    text-align: left;
  }

  .hero__actions {
    justify-content: flex-start;
  }
}

/* Tablet specific fixes */
@media (min-width: 768px) and (max-width: 1024px) {
  .hero__actions {
    justify-content: center !important;
    flex-wrap: wrap;
  }

  .hero__actions .btn {
    min-width: 160px;
    text-align: center;
  }

  /* General CTA section button fixes for tablet */
  .cta__actions {
    justify-content: center !important;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .cta__actions .btn {
    min-width: 160px;
    text-align: center;
  }

  /* Any button container centering */
  .btn-group,
  .button-container,
  .actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: var(--space-lg);
  color: var(--color-dark-roast);
}

.hero__subtitle {
  font-size: 1.125rem;
  color: var(--color-slate-navy);
  margin-bottom: var(--space-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero__actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
  align-items: center;
}

.hero__badges {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  flex-wrap: wrap;
}

.badge {
  background-color: var(--color-pure-white);
  padding: var(--space-md);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(27, 29, 41, 0.1);
  text-align: center;
  min-width: 140px;
}

.badge strong {
  display: block;
  color: var(--color-burnt-orange);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.badge span {
  font-size: 0.75rem;
  color: var(--color-slate-navy);
  font-weight: 500;
}

.site-footer {
  background-color: var(--color-dark-roast);
  color: var(--color-pure-white);
  padding: var(--space-xl) 0;
}

.footer__logo img {
  filter: none !important;
  max-width: 200px;
  height: auto;
}

.grid {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Mobile Navigation */
.nav-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  justify-content: space-around;
  align-items: center;
  position: relative;
  z-index: 1000;
}


.nav-toggle__line {
  width: 1.5rem;
  height: 2px;
  background-color: var(--color-dark-roast);
  transition: all 0.3s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

@media (max-width: 767px) {
  .hero__actions {
    flex-direction: column;
    align-items: center;
  }

  /* Mobile header layout */
  .header__container {
    padding: var(--space-md) var(--space-lg);
    position: relative;
  }

  .nav-toggle {
    display: flex;
    order: 1;
  }

  .header__brand {
    order: 0;
  }

  .site-navigation {
    order: 2;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-pure-white);
    border-top: 1px solid rgba(27, 29, 41, 0.1);
    box-shadow: 0 4px 12px rgba(27, 29, 41, 0.15);
    padding: var(--space-lg) var(--space-lg);
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s ease;
  }

  .site-navigation.nav-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-menu-wrapper {
    order: 1;
  }

  .nav-menu {
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-menu a {
    display: block;
    padding: var(--space-md);
    text-align: left;
    border-radius: var(--border-radius);
  }

  .header__cta {
    order: 0;
    margin-bottom: var(--space-md);
  }

  .header__cta .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Typography Utility Classes */
.font-heading {
  font-family: var(--font-heading) !important;
}

.font-body {
  font-family: var(--font-body) !important;
}

/* WPForms Styling - Brand Integration */
.wpforms-container .wpforms-form {
  background: var(--color-pure-white);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(27, 29, 41, 0.08);
}

.wpforms-container .wpforms-field {
  margin-bottom: 1.5rem;
}

.wpforms-container .wpforms-field-label {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--color-dark-roast);
  margin-bottom: 0.5rem;
  display: block;
}

.wpforms-container .wpforms-field input,
.wpforms-container .wpforms-field textarea,
.wpforms-container .wpforms-field select {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-dark-roast);
  background-color: var(--color-pure-white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wpforms-container .wpforms-field input:focus,
.wpforms-container .wpforms-field textarea:focus,
.wpforms-container .wpforms-field select:focus {
  outline: none;
  border-color: var(--color-burnt-orange);
  box-shadow: 0 0 0 3px rgba(218, 107, 59, 0.1);
}

.wpforms-container .wpforms-submit-container {
  text-align: center !important;
  margin-top: 2rem !important;
}

.wpforms-container .wpforms-submit,
.wpforms-container button[type="submit"],
.wpforms-container input[type="submit"] {
  background-color: var(--color-burnt-orange) !important;
  color: var(--color-pure-white) !important;
  border: none !important;
  padding: 1rem 2rem !important;
  border-radius: var(--border-radius) !important;
  font-family: var(--font-body) !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-transform: none !important;
  width: auto !important;
  min-width: 200px !important;
  display: inline-block !important;
  margin: 0 auto !important;
}

.wpforms-container .wpforms-submit:hover,
.wpforms-container button[type="submit"]:hover,
.wpforms-container input[type="submit"]:hover {
  background-color: #c55a2f !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(218, 107, 59, 0.3) !important;
}

.wpforms-container .wpforms-required {
  color: var(--color-burnt-orange);
}

.wpforms-container .wpforms-error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.wpforms-container .wpforms-field-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 767px) {
  .wpforms-container .wpforms-field-row {
    grid-template-columns: 1fr;
  }

  .wpforms-container .wpforms-form {
    padding: 1.5rem;
  }
}

/* =============================================================================
   RESPONSIVE IMAGE FIXES
   ============================================================================= */

/* Hero Image Responsive */
.hero__img {
  width: 100%;
  height: auto;
  min-height: 250px;
  max-height: 400px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.hero__fallback {
  width: 100%;
  min-height: 250px;
  max-height: 400px;
  background: linear-gradient(135deg, #DA6B3B 0%, #C55A2A 100%);
  border-radius: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
}

/* Product Images Responsive */
.product-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 14px 14px 0 0;
}

.product-fallback {
  width: 100%;
  height: 200px;
  background: linear-gradient(45deg, #F1DCD3 0%, #E8C9B8 100%);
  display: none;
  align-items: center;
  justify-content: center;
  color: #1B1D29;
  font-weight: 600;
  border-radius: 14px 14px 0 0;
  font-size: 1.1rem;
}

/* Mobile Responsive Breakpoints */
@media (max-width: 480px) {
  /* Extra small screens */
  .hero__img,
  .hero__fallback {
    min-height: 200px;
    max-height: 300px;
  }

  .product-img,
  .product-fallback {
    height: 180px;
  }

  .hero__title {
    font-size: clamp(1.8rem, 6vw, 2.5rem) !important;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  /* Fix button overflow on mobile phones */
  .cta__actions {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
  }

  .cta__actions .btn {
    width: 100%;
    max-width: 280px;
    min-width: 200px;
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
    text-align: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
  }

  .hero__actions .btn {
    width: 100%;
    max-width: 100%;
    min-width: unset;
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
  }

  /* Shorter button text for mobile */
  .btn--large {
    padding: 1rem 0.75rem;
    font-size: 0.875rem;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero__badges {
    flex-direction: column;
    align-items: center;
  }

  .badge {
    width: 100%;
    max-width: 250px;
  }
}

@media (min-width: 481px) and (max-width: 767px) {
  /* Small screens - tablets portrait */
  .hero__img,
  .hero__fallback {
    min-height: 300px;
    max-height: 350px;
  }

  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  /* Medium screens - tablets landscape */
  .hero__img,
  .hero__fallback {
    height: 350px;
  }
}