/* ============================================
   HOME PAGE SPECIFIC STYLES
   Hero section styles for homepage only
   ============================================ */

/* Homepage Background Wrapper */
.home-background-wrapper.has-hero {
  margin-top: 0;
  scroll-snap-type: y mandatory;
}

/* Homepage Section Layout */
.home-background-wrapper.has-hero .home-section {
  position: relative;
  min-height: auto;
  width: 100%;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  scroll-snap-align: start;
}

.home-background-wrapper.has-hero .home-section:first-child {
  align-items: center;
}

/* Products, Our Projects, About, and Contact sections on homepage - full viewport height with centered content */
.home-background-wrapper.has-hero .home-section.contact-section-full#products,
.home-background-wrapper.has-hero .home-section.contact-section-full#our-projects,
.home-background-wrapper.has-hero .home-section.contact-section-full#about,
.home-background-wrapper.has-hero .home-section.contact-section-full#contact {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}

/* Section cards - fill entire section dynamically */
.home-background-wrapper.has-hero .contact-section-full .container-fluid {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.home-background-wrapper.has-hero .contact-section-full .container-fluid>.row {
  flex: 1;
  height: 100%;
}

.home-background-wrapper.has-hero .contact-section-full .container-fluid>.row>.col-12 {
  height: 100%;
  display: flex;
}

.home-background-wrapper.has-hero .contact-section-full .contact-card.section-card-full {
  flex: 1;
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Homepage sections - standardized text sizes to fit in viewport */
.home-background-wrapper.has-hero .section-title {
  font-size: var(--font-size-3xl);
  padding: 1rem 2rem;
  margin-bottom: 1.5rem;
}

.home-background-wrapper.has-hero .section-text {
  font-size: var(--font-size-base);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem !important;
  line-height: 1.6;
}

.home-background-wrapper.has-hero .section-subtitle {
  font-size: var(--font-size-lg);
  padding: 0.75rem 1.5rem;
  margin-bottom: 0.75rem;
}

/* Section transition spacing */
.home-background-wrapper.has-hero .home-section+.home-section {
  margin-top: 0;
}

/* Homepage Products Section - Compact Layout */
.home-background-wrapper.has-hero #products .section-title {
  margin-bottom: 0.5rem;
  padding: 0.5rem 1rem;
}

.home-background-wrapper.has-hero #products .category-card {
  min-height: 380px;
  max-height: 420px;
}

.home-background-wrapper.has-hero #products .category-card-image,
.home-background-wrapper.has-hero #products .category-card-image-placeholder {
  height: 120px;
}

.home-background-wrapper.has-hero #products .category-card .card-body {
  padding: 0.75rem;
}

.home-background-wrapper.has-hero #products .category-card .card-title {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  /* 1.25x larger: 1rem * 1.25 = 1.25rem */
}

.home-background-wrapper.has-hero #products .category-products-list {
  max-height: 150px;
}

.home-background-wrapper.has-hero #products .products-categories-scroll+.text-center.mt-3 {
  margin-top: 0.5rem !important;
}

.home-background-wrapper.has-hero .home-section .container {
  max-width: 100%;
  padding: var(--section-padding) 1rem;
  position: relative;
  z-index: 1;
  background: transparent !important;
}

/* --- Hero Section (Homepage Only) --- */
.hero-section-full {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  height: 100vh;
  padding-top: var(--navbar-height);
  box-sizing: border-box;
  scroll-snap-align: start;
}

.hero-section-full .container {
  position: relative;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 5vw, 4rem);
  background: var(--bg-overlay);
  box-shadow: var(--shadow-lg);
  border-radius: var(--card-radius-lg);
  text-align: center;
  max-width: min(90%, 1200px);
  margin: 0 auto;
  margin-top: -80px;
}

.hero-section-full h1 {
  font-size: clamp(2.5rem, 8vw, var(--font-size-hero));
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1.5rem 0;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), 0 0 30px rgba(var(--color-primary-rgb), 0.3);
  letter-spacing: -0.02em;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.hero-section-full p {
  font-size: clamp(1.25rem, 3vw, var(--font-size-2xl));
  font-weight: 400;
  line-height: 1.6;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
  margin: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

/* ============================================
   RESPONSIVE BREAKPOINTS (Homepage)
   ============================================ */

/* Tablet - 992px */
@media (max-width: 992px) {
  .hero-section-full .container {
    margin-top: -60px;
  }
}

/* Mobile - 768px */
@media (max-width: 768px) {
  .hero-section-full .container {
    max-width: 95%;
    margin-top: -40px;
    padding: clamp(1.25rem, 3vw, 2rem) clamp(0.75rem, 4vw, 2rem);
  }

  /* Mobile Background - Performance optimization */
  .home-background-wrapper {
    background-attachment: scroll !important;
    /* Changed from fixed to scroll for better mobile performance */
  }
}

/* Small Mobile - 576px */
@media (max-width: 576px) {
  .hero-section-full .container {
    margin-top: -20px;
    padding: clamp(1rem, 2.5vw, 1.5rem) clamp(0.5rem, 3vw, 1.5rem);
    max-width: 98%;
  }

  .hero-section-full h1 {
    font-size: clamp(2rem, 7vw, 2.5rem);
    margin-bottom: 1rem;
  }

  .hero-section-full p {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    line-height: 1.5;
  }
}

/* ============================================
   HOMEPAGE MOBILE FIXES - Phase 1.5
   Critical fixes for mobile viewport issues
   ============================================ */

/* Mobile - Contact and About Sections Fix */
@media (max-width: 768px) {

  /* Contact Section - Allow scrolling and full content visibility */
  .home-background-wrapper.has-hero .home-section.contact-section-full#contact {
    min-height: auto !important;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    align-items: flex-start !important;
    justify-content: flex-start !important;
  }

  .home-background-wrapper.has-hero .home-section.contact-section-full#contact .contact-card.section-card-full {
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
    justify-content: flex-start !important;
    padding: var(--space-lg) var(--space-md) !important;
  }

  .home-background-wrapper.has-hero .home-section.contact-section-full#contact .container-fluid {
    height: auto !important;
  }

  .home-background-wrapper.has-hero .home-section.contact-section-full#contact .container-fluid>.row {
    height: auto !important;
    flex: none !important;
  }

  .home-background-wrapper.has-hero .home-section.contact-section-full#contact .container-fluid>.row>.col-12 {
    height: auto !important;
  }

  /* Contact Section - Mobile Layout: Stack columns vertically */
  .home-background-wrapper.has-hero #contact .col-md-6 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    margin-bottom: 1.5rem;
  }

  /* Contact Map - Smaller height on mobile */
  .home-background-wrapper.has-hero #contact .contact-map-small {
    height: 200px !important;
    margin-bottom: 1rem;
  }

  /* About Section - Allow scrolling and full content visibility */
  .home-background-wrapper.has-hero .home-section.contact-section-full#about {
    min-height: auto !important;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    align-items: flex-start !important;
    justify-content: flex-start !important;
  }

  .home-background-wrapper.has-hero .home-section.contact-section-full#about .contact-card.section-card-full {
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
    justify-content: flex-start !important;
    padding: var(--space-lg) var(--space-md) !important;
  }

  .home-background-wrapper.has-hero .home-section.contact-section-full#about .container-fluid {
    height: auto !important;
  }

  .home-background-wrapper.has-hero .home-section.contact-section-full#about .container-fluid>.row {
    height: auto !important;
    flex: none !important;
  }

  .home-background-wrapper.has-hero .home-section.contact-section-full#about .container-fluid>.row>.col-12 {
    height: auto !important;
  }

  /* Our Projects Section - Allow scrolling on mobile if content overflows */
  .home-background-wrapper.has-hero .home-section.contact-section-full#our-projects {
    min-height: auto !important;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    align-items: flex-start !important;
    justify-content: flex-start !important;
  }

  .home-background-wrapper.has-hero .home-section.contact-section-full#our-projects .contact-card.section-card-full.our-projects-card {
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
    justify-content: flex-start !important;
    padding: var(--space-lg) var(--space-md) !important;
  }

  .home-background-wrapper.has-hero .home-section.contact-section-full#our-projects .container-fluid {
    height: auto !important;
  }

  .home-background-wrapper.has-hero .home-section.contact-section-full#our-projects .container-fluid>.row {
    height: auto !important;
    flex: none !important;
  }

  .home-background-wrapper.has-hero .home-section.contact-section-full#our-projects .container-fluid>.row>.col-12 {
    height: auto !important;
  }
}

/* Small Mobile - Additional fixes */
@media (max-width: 576px) {

  /* Contact Section - Even more compact */
  .home-background-wrapper.has-hero #contact .contact-map-small {
    height: 150px !important;
  }

  .home-background-wrapper.has-hero .home-section.contact-section-full#contact .contact-card.section-card-full,
  .home-background-wrapper.has-hero .home-section.contact-section-full#about .contact-card.section-card-full,
  .home-background-wrapper.has-hero .home-section.contact-section-full#our-projects .contact-card.section-card-full.our-projects-card {
    padding: var(--space-md) var(--space-sm) !important;
  }
}

/* ============================================
   CONTACT SECTION - UX: Form first, info + map secondary
   ============================================ */
.contact-layout .contact-row {
  align-items: stretch;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Form hero (primary CTA) */
.contact-form-hero {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-primary);
  border-radius: var(--card-radius-lg);
  padding: var(--space-lg);
  backdrop-filter: var(--blur-sm);
}

.contact-form-hero-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-white);
  margin-bottom: 0.35rem;
  text-shadow: var(--shadow-text);
}

.contact-form-hero-lead {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.contact-form-hero .form-label {
  color: var(--color-text-white);
  font-weight: 500;
  font-size: 0.9rem;
}

.contact-form-hero .form-control {
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
}

/* Name/Email row: align with Country/Message (no extra indent from column padding) */
.contact-form-hero .contact-form-name-email-row {
  margin-left: 0;
  margin-right: 0;
}
.contact-form-hero .contact-form-name-email-row > .col-md-6:first-child {
  padding-left: 0;
  padding-right: 0.5rem;
}
.contact-form-hero .contact-form-name-email-row > .col-md-6:last-child {
  padding-right: 0;
  padding-left: 0.5rem;
}

.contact-form-hero textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.btn-send-message {
  padding: 0.75rem 2rem;
  font-weight: 600;
  font-size: 1rem;
  background: var(--color-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 10px;
  transition: background var(--transition-normal), transform var(--transition-fast), box-shadow var(--transition-normal);
}

.btn-send-message:hover {
  background: var(--color-primary-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(var(--color-primary-rgb), 0.4);
}

.btn-send-message:disabled {
  opacity: 0.85;
  transform: none;
}

/* Home page: all primary-style buttons use same orange as send button */
.home-background-wrapper.has-hero .btn-outline-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

.home-background-wrapper.has-hero .btn-outline-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.35);
}

/* Sidebar: contact info + map (secondary) - card style for readability */
.contact-sidebar {
  background: rgba(28, 35, 48, 0.95);
  border-radius: var(--card-radius-lg);
  padding: var(--space-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: var(--blur-sm);
}

.contact-sidebar-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--space-md);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.contact-info-list {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #fff;
}

.contact-info-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.95);
}

.contact-info-list li:last-of-type {
  margin-bottom: 0;
}

.contact-info-icon {
  color: var(--color-primary);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.contact-info-list a {
  color: #fff;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.contact-info-list a:hover {
  color: var(--color-primary);
}

.contact-map-wrap .contact-map-small {
  height: 140px;
  border-radius: 10px;
}

.contact-map-wrap .map-overlay {
  border-radius: 10px;
}

/* Mobile: form first, then sidebar */
@media (max-width: 991px) {
  .contact-layout .contact-row .order-1 { margin-bottom: 0; }
  .contact-layout .contact-row .order-2 { margin-top: 0; }
  .contact-form-hero { padding: var(--space-md); }
  .contact-sidebar { padding: var(--space-sm); }
}

@media (max-width: 576px) {
  .contact-map-wrap .contact-map-small {
    height: 120px !important;
  }
}

/* Mobile: Send button + other primary buttons - same solid orange */
@media (max-width: 768px) {
  .contact-form-hero .btn-send-message,
  .home-background-wrapper.has-hero .btn-outline-primary {
    background: #c95a3d !important;
    background-color: #c95a3d !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
  }
  .contact-form-hero .btn-send-message:hover,
  .home-background-wrapper.has-hero .btn-outline-primary:hover {
    background: #e06b4a !important;
    background-color: #e06b4a !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
  }
}

/* ============================================
   OUR PROJECTS SECTION (Homepage)
   Full viewport section with horizontal scroll content
   ============================================ */
.our-projects-section .our-projects-card {
  padding: 2rem 1rem;
  overflow: visible;
  flex: 0 1 auto;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.our-projects-scroll-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.our-projects-scroll-wrapper::-webkit-scrollbar {
  height: 6px;
}

.our-projects-scroll-wrapper::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.our-projects-scroll-wrapper::-webkit-scrollbar-thumb {
  background: rgba(162, 87, 63, 0.5);
  border-radius: 3px;
}

.our-projects-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.25rem;
  padding: 0.5rem 1rem;
  min-width: min-content;
  margin: 0 auto;
}

.our-projects-item {
  flex: 0 0 auto;
  display: block;
  transition: transform 0.2s ease;
}

.our-projects-item:hover {
  transform: translateY(-4px);
}

.our-projects-item-card {
  width: 280px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(20, 28, 40, 0.9);
  border: 1px solid rgba(162, 87, 63, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.2s ease;
}

.our-projects-item:hover .our-projects-item-card {
  box-shadow: 0 8px 24px rgba(162, 87, 63, 0.25);
}

.our-projects-item-image-wrapper {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(162, 87, 63, 0.15);
}

.our-projects-item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.our-projects-item-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 2.5rem;
}

.our-projects-item-title {
  padding: 1rem;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
}

.our-projects-view-all {
  border-width: 2px;
}

/* Projects: mobile - left-align so first card is fully visible */
@media (max-width: 768px) {
  .our-projects-scroll-wrapper {
    justify-content: flex-start;
  }

  .our-projects-scroll {
    margin: 0;
  }
}