/* --- Pan American Food + Meat Equipment 2025 --- */

/* ===============================
   1. IMPORTS & VARIABLES
=============================== */
:root {
  --cream: #fff7f0;
  --card-cream: #fff3e6;
  --chili: #c0392b;
  --accent: #ffe5d4;
  --text: #3b2f2f;
  --forest: #2c5f2d;
  --hover-orange: #e67e22;
}

/* ===============================
   2. BASE STYLES
=============================== */
html, body { height: 100%; }
body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  background: var(--cream);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* ✅ Prevents horizontal wiggle */
  font-display: swap;
}
html {
  overflow-y: scroll; /* ✅ Prevents layout shift from scrollbar */
}

/* ===============================
   3. HEADER
=============================== */
header {
  background: var(--chili);
  color: var(--accent);
  padding: 1.5rem;
  text-align: center;
}
header h1 {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  font-size: 2.6rem;
  letter-spacing: 1px;
  color: var(--accent);
  animation: zoomFade 1.2s ease forwards;
}
header p.sub-header {
  margin: .2rem 0 0 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}
.contact-info {
  margin-top: .5rem;
}
.contact-info a {
  color: var(--accent);
  text-decoration: none;
  margin: 0 .5rem;
  font-weight: 600;
}
.contact-info a:hover { text-decoration: underline; }

/* ===============================
   4. NAVIGATION
=============================== */
.nav-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 1rem 0;
}
.nav-link {
  display: inline-block;
  padding: .5rem 1rem;
  background: var(--forest);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  transition: background .2s ease;
}
.nav-link:hover { background: #2a5a2b; }

/* ===============================
   5. GRID LAYOUT
=============================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  align-items: stretch;
}

/* ===============================
   6. CARDS
=============================== */
.card {
  display: flex;
  flex-direction: column;
  background: var(--card-cream);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  overflow: hidden;
  transition: transform .18s ease;
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
}
.card:hover { transform: translateY(-4px); }

.card img {
  width: 100%;
  height: 440px;
  object-fit: cover;
  transition: transform .3s ease;
}
.card img:hover { transform: scale(1.05); }

.brand-card img {
  width: 100%;
  height: 245px; /* or whatever feels right */
  min-height: 230px;
  max-height: 250px;
  object-fit: cover;
}

/* card content */
.card-content {
  flex-grow: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}
.card h2, .card h3 {
  font-size: 1.35rem;
  margin: 0 0 .5rem;
  font-family: 'Montserrat', sans-serif;
  color: var(--chili);
}
.card p {
  margin: .4rem 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
}

/* ===============================
   7. BUTTONS
=============================== */
.contact-btn {
  display: inline-block;
  margin-top: auto;
  padding: .6rem 1.3rem;
  background: var(--forest);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: .95rem;
  text-align: center;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  transition: background .2s ease;
}
.contact-btn:hover { background: var(--hover-orange); }

/* ===============================
   8. SUB-HEADERS
=============================== */
.sub-header {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--accent);
  margin: .2rem 0;
}

/* ===============================
   9. SECTIONS (About / Brands / Categories)
=============================== */
section {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 1rem;
  background: var(--card-cream);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.about-us h2,
.categories-teaser h2,
.brands-section h2 {
  text-align: center;
  color: var(--chili);
  font-family: 'Montserrat', sans-serif;
  margin-bottom: .5rem;
}
.about-us p,
.categories-teaser p,
.brands-section p {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.6;
  text-align: left;
}

/* utility for centered short intros */
.section-intro {
  text-align: center;
  margin-bottom: 1rem;
  color: var(--text);
}

/* brands title */
.brands-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: .2rem 0 1rem;
  font-family: 'Montserrat', sans-serif;
  color: var(--chili);
}

/* ===============================
   10. Slideshow Styles
=============================== */
.slideshow-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 2rem auto;
  overflow: hidden;
  aspect-ratio: 16 / 9;   /* keeps ratio on modern browsers */
  min-height: 250px;      /* fallback height for older browsers */
}

.slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.slides img {
  position: absolute;
  top: 0; 
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
}

.slides img.active {
  opacity: 1;
  z-index: 2;
}

/* ===============================
   11. ANIMATIONS
=============================== */
.animate {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}
.animate.show {
  opacity: 1;
  transform: translateY(0);
}
@keyframes zoomFade {
  0% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

/* ===============================
   12. RESPONSIVE
=============================== */
@media (max-width: 900px) {
  .card img { height: 420px; }
  .brand-card img { height: 140px; }
  .slideshow-container { max-width: 560px; }
}
@media (max-width: 600px) {
  header h1 { font-size: 1.8rem; }
  .card img { height: 400px; }
  .brand-card img { height: 120px; }
  .slideshow-container { max-width: 340px; aspect-ratio: 4/3; }
  .brands-title { font-size: 1.4rem; }
  .contact-btn, .nav-link { padding: .5rem .9rem; font-size:.9rem; }
  .about-us p, .categories-teaser p { font-size: 1rem; }
}
@media (max-width: 768px) {
  .slideshow-container {
    min-height: 200px; /* ensure mobile has some height */
  }
}

/* ===============================
   13. UTILITIES
=============================== */
hr.section-divider {
  border: 0;
  border-top: 1px solid rgba(0,0,0,.06);
  margin: 1rem 0;
}

/* ===============================
   14. BRAND LOGO STYLES (Stacking & Centering)
=============================== */
.brand-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}
.brand-logo img {
  max-width: 450px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Free freight badge */
.free-freight {
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  background: var(--chili);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  text-align: center;
}

/* ===============================
   15. COMPANY INTRO VIDEO (UPDATED)
=============================== */
.intro-video {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 2rem 1rem;
  text-align: center;
  background: var(--card-cream);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.intro-video h2 {
  font-family: 'Montserrat', sans-serif;
  color: var(--chili);
  margin-bottom: 1rem;
}

.company-video,
.intro-video video {
  width: 100%;
  max-width: 900px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@media (max-width: 700px) {
  .company-video,
  .intro-video video {
    max-width: 100%;
  }
}

/* ===============================
   16. MACHINES PAGE (UPDATED)
=============================== */
.machines-page h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--chili);
}

/* Machines container grid */
.machines-page #machinesContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* ✅ Reduced from 340px */
  gap: 2rem;
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* Tablet: 2 columns */
@media (max-width: 900px) {
  .machines-page #machinesContainer {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
  }
}

/* Mobile: 1 column */
@media (max-width: 700px) {
  .machines-page #machinesContainer {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    padding: 1rem;
  }
}

/* Machine cards */
.machines-page .machine {
  display: flex;
  flex-direction: column;
  background: var(--card-cream);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  overflow: hidden;
  transition: transform .18s ease;
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
}

.machines-page .machine:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Machine images */
.machines-page .machine img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3; /* or 3 / 2 for taller machines */
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  transition: transform 0.3s ease;
}
.machines-page .machine img:hover {
  transform: scale(1.05);
}

/* ===============================
   MACHINES PAGE - MOBILE IMAGE FIX
=============================== */
@media (max-width: 600px) {
  .machines-page .machine img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3; /* or 3 / 2 if ovens are taller */
    object-fit: cover;
    max-height: 280px; /* prevents it from dominating the screen */
  }
}

/* Filters */
.machines-page .filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: center;
}
.machines-page .filters label {
  font-weight: 600;
  color: var(--chili);
}
.machines-page .filters select {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
  background: var(--card-cream);
  color: var(--text);
  cursor: pointer;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}
.machines-page .filters select:hover,
.machines-page .filters select:focus {
  border-color: var(--forest);
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.machines-page #brandFilter,
.machines-page label[for="brandFilter"] {
  display: none;
}

/* ===============================
   17. MULTI-PRICE LIST STYLING
=============================== */
.price-list {
  list-style: none;
  padding-left: 0;
  margin: 0.5rem 0;
}
.price-list li { margin-bottom: 0.25rem; }

/* ===============================
   18. SITE LOGO
=============================== */
.site-logo {
  display: block;
  margin: 0 auto 10px auto;
  width: 80%;        /* default: fills most of screen */
  max-width: 600px;  /* cap for big screens */
  height: auto;
}

/* Make logo larger on smaller devices */
@media (max-width: 600px) {
  .site-logo {
    width: 80%;       /* nearly full width */
    max-width: none;  /* allow bigger than 600px if screen allows */
  }
}

/* ===============================
   19. BRAND LINK STYLE (Elegant Accent)
=============================== */
.brand-logo a {
  color: var(--chili);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--chili);
  padding-bottom: 2px;
  transition: all 0.2s ease-in-out;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.3px;
}

.brand-logo a:hover {
  color: var(--hover-orange);
  border-color: var(--hover-orange);
  transform: translateY(-2px);
}

/* ===============================
   20. SMOOTH SCROLL (Optional polish)
=============================== */
* {
  scroll-behavior: smooth; /* ✅ Makes transitions feel stable */
}

/* ===============================
   21. FOOTER STYLES
=============================== */
.site-footer {
  background: var(--chili);
  color: var(--accent);
  padding: 2rem 1rem 1rem 1rem;
  text-align: center;
  margin-top: 3rem;
}

.site-footer a {
  color: var(--accent);
  text-decoration: underline;
}

.site-footer a:hover {
  color: var(--hover-orange);
}

.footer-dev {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 0.5rem;
}

.footer-dev .dev-credit {
  font-style: italic;
  margin-top: 0.3rem;
}

/* ===============================
   22. LANGUAGE SWITCH
=============================== */
.lang-switch-top {
  text-align: center;
  margin: 1rem 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

.lang-switch-top a {
  color: var(--chili);
  text-decoration: none;
  margin: 0 0.5rem;
  transition: color 0.2s;
}

.lang-switch-top a:hover {
  color: var(--hover-orange);
  text-decoration: underline;
}