/* =========================================================
   EZAutomation - wholepage.css
   (Index page styles + Header include styles)
   Clean + Non-overlapping responsive
   ========================================================= */

/* --- GLOBAL RESET --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #f5f5f5;
  color: #222;
}

a { text-decoration: none; color: inherit; }

/* Prevent images from forcing overflow */
img { max-width: 100%; height: auto; }

/* =========================================================
   PAGE CONTENT WRAPPER
   ========================================================= */
.page-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  min-width: 0;
}

/* =========================================================
   HEADER
   ========================================================= */
header.top-header {
  background-color: #ffffff;
  color: #2c2e31;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  gap: 12px;
  max-width: 100%;
}

.header-left,
.header-middle,
.header-right { min-width: 0; }

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-link {
  display: inline-flex;
  align-items: center;
}

.logo-img {
  width: auto;
  object-fit: contain;
  max-width: 100%;
  max-height: 85px;
  height: clamp(52px, 7vw, 85px);
}

.header-left2 {
  font-weight: 700;
  color: #0056A6;
  font-size: clamp(1rem, 2.2vw, 1.4rem);
  white-space: normal;     /* allow wrap to avoid overflow */
  text-align: center;
  line-height: 1.15;
}

.header-middle {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 240px;
}

.search-form {
  display: flex;
  max-width: 460px;
  width: 100%;
  border: 2px solid #0056A6;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.search-input {
  flex: 1;
  padding: 10px 12px;
  border: none;
  outline: none;
  min-width: 0;
}

.search-button {
  padding: 10px 16px;
  background-color: #0056A6;
  color: #fff;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-right {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: normal;
  flex-wrap: wrap;         /* keep login/cart, never hide */
  justify-content: flex-end;
}

.header-link {
  color: #0056A6;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  line-height: 1.1;
}

/* make sure icons never disappear due to layout */
.header-link i,
.header-link .fa {
  display: inline-block;
  line-height: 1;
  font-size: 1.05em;
}

/* =========================================================
   NAV BAR
   ========================================================= */
nav.main-nav {
  background-color: #b9121b;
  min-height: 56px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 12px 10px;
  margin: 0;
  border: 0;
  border-radius: 0;
  line-height: 1.2;
  text-align: center;
  max-width: 100%;
  flex-wrap: wrap;     /* default: wrap to avoid overflow */
  row-gap: 10px;
}

nav.main-nav a.nav-link,
nav.main-nav a.nav-link:link,
nav.main-nav a.nav-link:visited {
	width: auto;
  color: #ffffff;
  font-size: 22px;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  margin: 0;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, opacity 0.15s ease;
  flex: 0 1 auto;
}

nav.main-nav a.nav-link.active { position: relative; }

nav.main-nav a.nav-link.active::after {
  content: "";
  position: absolute;
  height: 2px;
  bottom: -4px;
  left: 8px;
  right: 8px;
}

/* =========================================================
   MISSION STATEMENT
   ========================================================= */
.mission {
  margin-top: 14px;
  margin-bottom: 24px;
  background: #fff;
  border-radius: 10px;
  padding: 18px 20px;
  border: 1px solid #b71c1c;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

.mission h2 {
  margin: 0 0 8px;
  font-size: 2rem;
  color: #b71c1c;
  text-align: center;
}

.mission p {
  margin: 0;
  text-align: center;
  font-size: 1.2rem;
  line-height: 1.45;
  font-weight: 700;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn-yellow {
  background-color: #ffcc00;
  color: #000;
  padding: 10px 16px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  display: inline-block;
  font-size: 1rem;
}
.btn-yellow:hover { background-color: #ffb300; }

.btn-red {
  background-color: #cc0001;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  font-size: 1.25rem;
  cursor: pointer;
  text-align: center;
  display: inline-block;
}
.btn-red:hover { background-color: #313030; }

.btn-blue {
  background-color: #cc0001;
  color: #fff;
  padding: 10px 10px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  display: inline-block;
  font-size: 1rem;
}
.btn-blue:hover { background-color: #2a44ad; }

/* =========================================================
   FEATURE CARDS (use grid for stable responsive)
   ========================================================= */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 10px;
}

.card {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  min-height: 340px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.20);
}

.card h3 {
  font-size: 16px;
  color: #003366;
  font-weight: 700;
  display: flex;
  align-items: flex-end;
  text-align: center;
  justify-content: center;
  min-height: 44px;
}

.card-img-container {
  height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  gap: 6px;
}

.card-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  border-radius: 6px;
}

.card-btn { margin-top: auto; align-self: center; }

/* =========================================================
   CAROUSEL
   ========================================================= */
.carousel-container {
  margin-top: 24px;
  padding: 4px 6px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 5px 22px rgba(0, 0, 0, 0.18);
  position: relative;
}

.carousel-title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  color: #111;
}

.carousel-track { width: 100%; }

.carousel-slide { display: none; }
.carousel-slide.active { display: block; }

.carousel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  align-items: stretch;
}

.carousel-card {
  background: #fff;
  border-radius: 10px;
  padding: 4px 4px 4px 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 340px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.carousel-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.20);
}

.carousel-card img {
  width: 100%;
  height: 280px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.carousel-actions {
  margin-top: 6px;
  display: flex;
  flex-direction: row;
  gap: 20px;
  width: 80%;
  justify-content: center;
}
.carousel-actions .btn-yellow {
  width: 100%;
  font-size: 0.9rem;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border: none;
  padding: 10px 14px;
  font-size: 1.4rem;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
}
.carousel-arrow.left { left: 10px; }
.carousel-arrow.right { right: 10px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
}
.dot.active { background: #0056A6; }

/* =========================================================
   SLOGAN + EXPLORE
   ========================================================= */
.slogan-wrapper {
  margin-top: 50px;
  padding: 25px 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.slogan-middle {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-size: 1.1rem;
  gap: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.07);
  padding: 5px 5px 5px 10px;
  align-items: center;
  min-width: 0;
}

.slogan-middle p { margin: 0; }

.slogan-bold {
  font-weight: 600;
  font-size: 1.3rem;
}

.slogan-img {
  max-height: 200px;
  width: auto;
}

.thumbnail {
  width: 100%;
  max-width: 220px;
  height: auto;
  object-fit: cover;
  display: block;
}

.slogan-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.explore-text {
  font-weight: 700;
  font-size: 22px;
}

.explore-dropdown { position: relative; display: inline-block; }
.explore-main { min-width: 130px; }

.explore-menu {
  position: absolute;
  top: 110%;
  right: 0;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 999;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.explore-dropdown.show-menu .explore-menu {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* Make slogan inner table shrink safely */
.slogan-wrapper table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.slogan-wrapper td {
  width: 50%;
  padding: 6px;
  vertical-align: top;
}

/* =========================================================
   ALL PRODUCTS
   ========================================================= */
#all-products {
  margin-top: 36px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
  padding: 16px;
}

#all-products .block-title {
  background: #000;
  color: #fff;
  font-size: 22px;
  text-align: center;
  padding: 10px 8px;
  border-radius: 8px;
  margin: 4px 0 14px;
}

#all-products table { width: 100%; border-collapse: collapse; }
#all-products td { vertical-align: top; padding: 6px 4px; }

.product-image-wrapper { overflow: hidden; margin-bottom: 6px; }
.single-products { position: relative; display: inline-block; }

.productinfo img {
  display: block;
  width: 100%;
  transition: opacity 0.3s ease;
}

.product-overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.single-products:hover .product-overlay { opacity: 1; }
.single-products:hover .productinfo img { opacity: 0; }

/* helpers to replace inline width/padding-left (optional but clean) */
.collage-pad-left { padding-left: 6px; }

/* =========================================================
   REPLACE INDEX INLINE TYPOGRAPHY (support block)
   ========================================================= */
.support-block {
  margin: 0;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.support-line-1 {
  font-weight: 700;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
}

.support-title {
  display: inline-block;
  font-weight: 700;
  font-size: clamp(1.15rem, 2.4vw, 2rem);
  margin-right: 10px;
  white-space: normal;
}

.support-phone {
  display: inline-block;
  font-weight: 800;
  font-size: clamp(1.35rem, 3vw, 2.25rem);
  white-space: nowrap;
}

.support-hours {
  display: inline-block;
  font-weight: 800;
  font-size: clamp(1.05rem, 2.1vw, 1.6rem);
}

.support-email {
  display: inline-block;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
}

/* =========================================================
   RESPONSIVE (clean + non-overlapping)
   ========================================================= */

/* --- <=1200 --- */
@media (max-width: 1200px) {
  .carousel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --- <=1150 (medium screens: make header 2 rows) --- */
@media (max-width: 1150px) {
  header.top-header {
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
  }

  /* Row 1 */
  .header-left  { order: 1; flex: 0 0 auto; }
  .header-left2 { order: 2; flex: 1 1 auto; }
  .header-right { order: 3; flex: 0 0 auto; }

  /* Row 2 */
  .header-middle {
    order: 4;
    flex: 0 0 100%;
    width: 100%;
    justify-content: center;
  }

  .search-form { max-width: 760px; }

  nav.main-nav a.nav-link,
  nav.main-nav a.nav-link:link,
  nav.main-nav a.nav-link:visited {
    font-size: 22px;
  }

  .feature-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slogan-wrapper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slogan-right { text-align: center; align-items: center; }
}

/* --- <=980 --- */
@media (max-width: 980px) {
  nav.main-nav a.nav-link,
  nav.main-nav a.nav-link:link,
  nav.main-nav a.nav-link:visited {
    font-size: 20px;
  }
}

/* --- <=900 --- */
@media (max-width: 900px) {
  nav.main-nav { gap: 16px; padding: 10px 12px; }

  nav.main-nav a.nav-link,
  nav.main-nav a.nav-link:link,
  nav.main-nav a.nav-link:visited {
    font-size: 18px;
    padding: 6px 6px;
  }

  .carousel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .carousel-card { height: auto; }
  .carousel-card img { height: 220px; }

  /* All Products: NO scroll, 2 columns centered */
  #all-products { overflow: visible; text-align: center; }
  #all-products table {
    width: 100%;
    margin: 0 auto;
    min-width: 0;
    table-layout: fixed;
  }
  #all-products table,
  #all-products tbody,
  #all-products tr {
    display: block;
    width: 100%;
  }
  #all-products td {
    display: inline-block;
    width: 50%;
    padding: 6px;
    vertical-align: top;
    text-align: center;
  }
  #all-products .product-image-wrapper {
    display: flex;
    justify-content: center;
  }
  #all-products .collage-pad-left { padding-left: 0; }
}

/* --- <=768 --- */
@media (max-width: 768px) {
  nav.main-nav { gap: 16px; }

  .mission h2 { font-size: 1.6rem; }
  .mission p  { font-size: 1.05rem; }

  .card-img-container { height: 160px; }
}

/* --- <=700 --- */
@media (max-width: 700px) {
  .slogan-wrapper {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .slogan-middle { padding: 12px; }
  .slogan-bold { font-size: 1.15rem; }

  /* center dropdown menu under button */
  .explore-menu {
    right: 50%;
    transform: translateX(50%);
  }
}

/* --- <=650 --- */
@media (max-width: 650px) {
  .feature-cards { grid-template-columns: 1fr; }
  .card { min-height: auto; }
}

/* --- <=600 --- */
@media (max-width: 600px) {
  nav.main-nav { gap: 12px; }

  nav.main-nav a.nav-link,
  nav.main-nav a.nav-link:link,
  nav.main-nav a.nav-link:visited {
    font-size: 16px;
    padding: 6px 6px;
  }
}

/* --- <=560 --- */
@media (max-width: 560px) {
  .carousel-grid { grid-template-columns: 1fr; }

  .carousel-actions {
    width: 100%;
    gap: 10px;
  }

  .carousel-actions .btn-yellow {
    padding: 8px 10px;
    font-size: 1rem;
  }

  /* arrows: avoid covering cards */
  .carousel-arrow {
    top: 16px;
    transform: none;
    padding: 8px 10px;
    font-size: 1.1rem;
  }
  .carousel-arrow.left  { left: 8px; }
  .carousel-arrow.right { right: 8px; }
}

/* --- <=520 --- */
@media (max-width: 520px) {
  /* navbar: if still too tight, allow horizontal scroll as last resort */
  nav.main-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }
  nav.main-nav::-webkit-scrollbar { height: 8px; }

  /* header: keep login/cart visible, 2-per-row buttons */
  .header-right {
    justify-content: center;
    gap: 10px;
  }

  .header-link {
    flex: 1 1 45%;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    background: #fff;
  }

  /* NEVER hide text (keep login/register + cart text if exists) */
  .header-link span { display: inline !important; }

  /* All Products: 1 column */
  #all-products td { width: 100%; }

  /* support phone can wrap */
  .support-phone { white-space: normal; }
}
