/* ===========================
   Cabinets of America - Styles
   =========================== */

/* --- Variables --- */
:root {
  --navy: #1B3A6B;
  --navy-dark: #122850;
  --red: #C41E2A;
  --red-hover: #A8181F;
  --gold: #D4A017;
  --gold-light: #F0D060;
  --white: #FFFFFF;
  --off-white: #F7F8FA;
  --light-gray: #EAEDF2;
  --gray: #6B7280;
  --dark: #1F2937;
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Open Sans', sans-serif;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 6px 24px rgba(0,0,0,0.13);
  --radius: 8px;
  --transition: 0.25s ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--dark);
  line-height: 1.6;
  background: var(--white);
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* --- Container --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Top Bar --- */
.top-bar {
  background: var(--navy-dark);
  color: var(--white);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}
.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.top-bar a { color: var(--gold-light); }
.top-bar a:hover { text-decoration: underline; }
.top-bar-contact { display: flex; gap: 1.5rem; }

/* --- Header / Nav --- */
.header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
}
.logo img { height: 60px; }
.nav-list {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-list a {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy);
  transition: color var(--transition);
  padding: 0.25rem 0;
  position: relative;
}
.nav-list a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: width var(--transition);
}
.nav-list a:hover::after,
.nav-list a.active::after { width: 100%; }
.nav-list a:hover { color: var(--red); }
.nav-cta {
  padding: 0.6rem 1.5rem !important;
  border-radius: var(--radius) !important;
}
.nav-cta::after { display: none !important; }

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.mobile-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--navy);
  border-radius: 2px;
  transition: var(--transition);
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  text-align: center;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn-primary:hover {
  background: var(--red-hover);
  border-color: var(--red-hover);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}
.btn-outline:hover {
  background: var(--white);
  color: var(--navy);
}
.btn-secondary {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn-secondary:hover {
  background: var(--navy-dark);
  border-color: var(--navy-dark);
}
.btn-lg { padding: 1rem 2.5rem; font-size: 1.05rem; }

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-slideshow {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}
.hero-slide.active { opacity: 1; }
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(27, 58, 107, 0.65);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: 4rem 0;
  max-width: 700px;
}
.hero h1 {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 1rem;
}
.hero-slogan {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 1rem;
}
.hero-sub {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.9);
  margin-bottom: 2rem;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* --- Sections --- */
.section { padding: 5rem 0; }
.bg-light { background: var(--off-white); }
.section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  margin-bottom: 0.5rem;
}
.section-subtitle {
  text-align: center;
  color: var(--gray);
  font-size: 1.05rem;
  margin-bottom: 3rem;
}
.text-center { text-align: center; }

/* --- Pillars Grid (3 core selling points) --- */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 1rem;
}
.pillar-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--gold);
  transition: box-shadow var(--transition), transform var(--transition);
}
.pillar-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}
.pillar-icon { font-size: 3rem; margin-bottom: 1rem; }
.pillar-card h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--navy);
  margin-bottom: 0.75rem;
}
.pillar-card p { color: var(--gray); font-size: 1rem; line-height: 1.7; }

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}
.feature-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
}
.feature-card p { color: var(--gray); font-size: 0.95rem; }

/* --- Products Grid --- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
}
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.product-img {
  width: 100%;
  overflow: hidden;
  background: var(--off-white);
}
.product-img img { width: 100%; height: auto; display: block; }
.placeholder-img {
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 0.9rem;
}
.product-card h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--navy);
  padding: 1rem 1rem 0.25rem;
}
.product-card p {
  color: var(--gray);
  font-size: 0.9rem;
  padding: 0 1rem;
  flex: 1;
}
.product-card .btn {
  margin: 1rem;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

/* --- CTA Banner --- */
.cta-banner {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-hover) 100%);
  color: var(--white);
  text-align: center;
  padding: 4rem 0;
}
.cta-banner h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: 1rem;
}
.cta-banner p {
  font-size: 1.1rem;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto 2rem;
}
.cta-banner .btn-primary {
  background: var(--white);
  color: var(--red);
  border-color: var(--white);
}
.cta-banner .btn-primary:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* --- Locations --- */
.locations-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
.locations-3 {
  grid-template-columns: repeat(3, 1fr);
}
.location-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--gold);
}
.location-card h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--navy);
  margin-bottom: 1rem;
}
.location-card p { margin-bottom: 0.5rem; color: var(--gray); }
.location-card a { color: var(--navy); }
.location-card .btn { margin-top: 1rem; }

/* --- Page Hero (inner pages) --- */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: var(--white);
  padding: 3.5rem 0;
  text-align: center;
}
.page-hero h1 {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.page-hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Catalog Tabs --- */
.catalog-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}
.tab-btn {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.8rem;
  border-radius: var(--radius);
  border: 2px solid var(--navy);
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  transition: all var(--transition);
}
.tab-btn:hover,
.tab-btn.active {
  background: var(--navy);
  color: var(--white);
}

/* --- Catalog Headings --- */
.catalog-heading {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.5rem;
  padding-top: 1rem;
}
.catalog-desc {
  color: var(--gray);
  font-size: 1rem;
  margin-bottom: 2rem;
}
.catalog-grid { margin-bottom: 3rem; }

/* --- Product Code Badge --- */
.product-code {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray);
  background: var(--light-gray);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin: 0 1rem 0.5rem;
  letter-spacing: 0.5px;
}

/* --- Gallery --- */
.gallery-filters {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.filter-btn {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid var(--navy);
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--navy);
  color: var(--white);
}
.gallery-notice {
  text-align: center;
  padding: 1.5rem;
  background: var(--off-white);
  border-radius: var(--radius);
}
.gallery-notice a { color: var(--red); font-weight: 600; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.gallery-item.hidden {
  display: none;
}
.gallery-item.gallery-project {
  grid-column: span 2;
}
.gallery-item img { width: 100%; height: auto; display: block; }
.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: var(--white);
  padding: 2rem 1rem 1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
}
.gallery-caption span {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.8;
  margin-top: 0.2rem;
}

/* --- Contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  align-items: start;
}
.contact-info h2,
.contact-form-wrap h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--navy);
  margin-bottom: 1.5rem;
}
.contact-location {
  background: var(--off-white);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--gold);
}
.contact-location h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--navy);
  margin-bottom: 0.75rem;
}
.contact-location p { color: var(--gray); margin-bottom: 0.4rem; font-size: 0.95rem; }
.contact-location a { color: var(--navy); }
.contact-location a:hover { color: var(--red); }

/* Form */
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; }
.form-group label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--dark);
  margin-bottom: 0.4rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--dark);
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--navy);
}
.form-success {
  background: #ecfdf5;
  color: #065f46;
  padding: 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
}
.map-section { padding: 0 0 4rem; }
.map-section .section-title { margin-bottom: 1.5rem; }
.map-wrap { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

/* --- Downloads --- */
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}
.download-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.download-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.download-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.download-card h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
}
.download-card p { color: var(--gray); font-size: 0.9rem; flex: 1; margin-bottom: 1rem; }
.download-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--gray);
  margin-bottom: 1rem;
}
.btn-disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}
.download-notice {
  text-align: center;
  padding: 1.5rem;
  background: var(--off-white);
  border-radius: var(--radius);
}
.download-notice a { color: var(--red); font-weight: 600; }

/* --- Responsive additions --- */
@media (max-width: 992px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .downloads-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .downloads-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .gallery-item img { height: 250px; }
}

/* --- Footer --- */
.footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.85);
  padding: 3rem 0 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}
.footer-logo { margin-bottom: 0.5rem; }
.footer-slogan {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gold);
  letter-spacing: 1px;
  margin-bottom: 0.75rem !important;
}
.footer-col h4 {
  font-family: var(--font-heading);
  color: var(--white);
  margin-bottom: 1rem;
  font-size: 1rem;
}
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a:hover { color: var(--gold-light); }
.footer-col p { font-size: 0.9rem; margin-bottom: 0.5rem; }
.footer-bottom {
  margin-top: 2rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(255,255,255,0.15);
  text-align: center;
  font-size: 0.85rem;
}

/* --- Responsive --- */
@media (max-width: 992px) {
  .pillars-grid { grid-template-columns: repeat(3, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .top-bar-inner { flex-direction: column; text-align: center; }
  .top-bar-contact { flex-direction: column; gap: 0.25rem; }

  .mobile-toggle { display: flex; }
  .nav { 
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 1rem;
  }
  .nav.open { display: block; }
  .nav-list {
    flex-direction: column;
    gap: 0;
  }
  .nav-list li { width: 100%; }
  .nav-list a {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--light-gray);
  }
  .nav-list a::after { display: none; }
  .nav-cta { text-align: center; margin-top: 0.5rem; }

  .hero h1 { font-size: 2rem; }
  .hero-content { padding: 3rem 0; }
  .pillars-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .locations-grid, .locations-3 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
