/* 
 * SPI Logistics Texas McAllen Custom Style Sheet
 * Built with Vanilla CSS for high performance, responsiveness, and premium aesthetics.
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* --- Design Tokens --- */
:root {
  --primary-gold: #c2993d;
  --primary-gold-hover: #a17c2e;
  --dark-bg: #0d0d0d;
  --card-bg: #141414;
  --text-light: #ffffff;
  --text-dark: #1a1a1a;
  --text-gray: #666666;
  --light-gray: #f5f5f5;
  --border-light: #e0e0e0;
  
  --font-sans: 'Outfit', sans-serif;
  --font-serif: 'Playfair Display', serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-premium: 0 15px 35px rgba(0, 0, 0, 0.15);
  --shadow-light: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* --- Reset & Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--text-light);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
}

/* --- Scrollbar Customization --- */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--dark-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--primary-gold);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-gold-hover);
}

/* --- Header / Navigation --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-light);
  transition: var(--transition-smooth);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

header.scrolled {
  padding: 10px 0;
  background-color: #ffffff;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 20px;
}

.logo-link {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 60px;
  width: auto;
  object-fit: contain;
  transition: var(--transition-smooth);
}

header.scrolled .logo-img {
  height: 45px;
}

nav {
  display: flex;
  align-items: center;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 30px;
  align-items: center;
}

nav ul li a {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dark);
  position: relative;
  padding: 5px 0;
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-gold);
  transition: var(--transition-smooth);
}

nav ul li a:hover::after,
nav ul li a.active::after {
  width: 100%;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--primary-gold);
}

/* Header Utilities */
.header-phone {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-gold);
  letter-spacing: 0.05em;
  transition: var(--transition-smooth);
}

.header-phone:hover {
  color: var(--primary-gold-hover);
}

@media (max-width: 600px) {
  .header-phone {
    display: none;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  font-size: 1.1rem;
  transition: var(--transition-smooth);
}

.search-btn:hover {
  color: var(--primary-gold);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
}

.mobile-menu-toggle span {
  width: 100%;
  height: 2px;
  background-color: var(--text-dark);
  transition: var(--transition-smooth);
}

/* --- Hero Banner (Home) --- */
.hero {
  position: relative;
  height: 90vh;
  min-height: 600px;
  background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.65)), url('coverimage.png');
  background-size: cover;
  background-position: center;
  background-attachment: scroll; /* Fallback */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-light);
  padding: 0 20px;
  margin-top: 70px;
}

/* Parallax effect support */
@media (min-width: 1024px) {
  .hero {
    background-attachment: fixed;
  }
}

.hero-content {
  max-width: 800px;
  animation: fadeInUp 1.2s ease-out;
}

.hero-logo-container {
  margin-bottom: 25px;
}

.hero-logo-img {
  max-width: 250px;
  height: auto;
  filter: brightness(0) invert(1); /* Turns black parts of the logo white */
  margin-bottom: 5px;
}

.hero-sub-brand {
  font-size: 1.8rem;
  letter-spacing: 0.25em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-location {
  font-size: 2.2rem;
  letter-spacing: 0.15em;
  font-weight: 300;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 35px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.btn-gold {
  display: inline-block;
  background-color: var(--primary-gold);
  color: var(--text-light);
  padding: 14px 35px;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 4px;
  border: 2px solid var(--primary-gold);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-gold:hover {
  background-color: transparent;
  color: var(--primary-gold);
  box-shadow: 0 0 15px rgba(194, 153, 61, 0.4);
  transform: translateY(-2px);
}

/* --- Hero Banner (Contact Page - Shorter) --- */
.hero-contact {
  height: 60vh;
  min-height: 400px;
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)), url('coverimage.png');
  background-size: cover;
  background-position: center;
  background-attachment: scroll;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-light);
  padding: 0 20px;
  margin-top: 70px;
}

@media (min-width: 1024px) {
  .hero-contact {
    background-attachment: fixed;
  }
}

.hero-contact .hero-sub-brand {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  font-size: 2.5rem;
  letter-spacing: 0.05em;
  color: var(--text-light);
}

.hero-contact .hero-location {
  font-size: 2.2rem;
  letter-spacing: 0.2em;
  font-weight: 300;
  margin-top: 15px;
}

/* --- Daring to be Great Section --- */
.daring-section {
  background-color: var(--dark-bg);
  color: var(--text-light);
  padding: 80px 20px;
  text-align: center;
}

.daring-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-style: italic;
  color: var(--primary-gold);
  margin-bottom: 50px;
  font-weight: 400;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto 50px auto;
}

.info-card {
  background-color: #1a1a1a;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.info-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(194, 153, 61, 0.15);
}

.card-header {
  background-color: #ffffff;
  padding: 15px;
  text-align: center;
  border-bottom: 2px solid var(--primary-gold);
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--primary-gold);
  text-transform: uppercase;
}

.card-image-wrapper {
  position: relative;
  height: 250px;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.info-card:hover .card-img {
  transform: scale(1.08);
}

.btn-outline-white {
  display: inline-block;
  background-color: transparent;
  color: var(--text-light);
  padding: 12px 30px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--text-light);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
  margin-top: 10px;
}

.btn-outline-white:hover {
  background-color: var(--text-light);
  color: var(--text-dark);
}

/* --- Customized Solutions Section --- */
.solutions-section {
  position: relative;
  padding: 120px 20px;
  background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.4)), url('railway_landscape.png');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.solutions-container {
  background-color: rgba(18, 18, 18, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 50px 40px;
  max-width: 800px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-premium);
  color: var(--text-light);
}

.solutions-title {
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 25px;
  letter-spacing: 0.02em;
}

.solutions-desc {
  font-size: 1.05rem;
  font-weight: 300;
  color: #cccccc;
  margin-bottom: 30px;
  line-height: 1.8;
}

.services-list {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-gold);
  letter-spacing: 0.05em;
  margin-bottom: 30px;
  text-transform: uppercase;
}

.solutions-cta {
  font-size: 0.95rem;
  font-weight: 400;
  color: #bbbbbb;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 25px;
}

.solutions-cta a {
  color: var(--primary-gold);
  font-weight: 600;
}

.solutions-cta a:hover {
  text-decoration: underline;
  color: var(--text-light);
}

/* --- Aspire Section --- */
.aspire-section {
  background-color: var(--dark-bg);
  color: var(--text-light);
  padding: 90px 20px;
  text-align: center;
}

.aspire-title {
  font-size: 1.8rem;
  letter-spacing: 0.3em;
  font-weight: 400;
  color: var(--text-light);
  margin-bottom: 5px;
}

.aspire-title span {
  color: var(--primary-gold);
  font-weight: 700;
}

.aspire-number {
  font-size: 3rem;
  font-weight: 300;
  color: var(--text-light);
  margin-bottom: 35px;
  letter-spacing: 0.1em;
}

.aspire-text {
  max-width: 900px;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #dddddd;
  font-weight: 300;
}

/* --- Happy Customers Section --- */
.testimonials-section {
  background-color: #ffffff;
  padding: 90px 20px;
  text-align: center;
}

.section-title {
  font-size: 2.4rem;
  font-weight: 600;
  margin-bottom: 60px;
  color: var(--text-dark);
}

.testimonials-container {
  max-width: 1000px;
  margin: 0 auto 50px auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 50px;
}

.testimonial-card {
  position: relative;
  padding: 0 40px;
}

.testimonial-card::before {
  content: '“';
  position: absolute;
  top: -40px;
  left: 10px;
  font-size: 8rem;
  font-family: var(--font-serif);
  color: rgba(194, 153, 61, 0.15);
}

.testimonial-text {
  font-size: 1.15rem;
  font-style: italic;
  color: #444444;
  margin-bottom: 25px;
  line-height: 1.8;
  font-weight: 300;
}

.testimonial-author {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.rating-stars {
  color: var(--primary-gold);
  font-size: 1.2rem;
}

.testimonials-section .btn-gold {
  margin-top: 30px;
}

/* --- Contact Us Form & Details Section --- */
.contact-section {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 20px;
}

.contact-title {
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 40px;
  text-transform: uppercase;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  margin-bottom: 60px;
}

.contact-info-panel {
  border-right: 1px solid var(--border-light);
  padding-right: 40px;
}

.branch-name {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.contact-block {
  margin-bottom: 35px;
}

.contact-block h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 15px;
  border-bottom: 2px solid var(--primary-gold);
  display: inline-block;
  padding-bottom: 5px;
}

.contact-item {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.contact-item strong {
  font-weight: 600;
  color: var(--text-dark);
}

.contact-item a {
  color: var(--primary-gold);
  font-weight: 500;
}

.contact-item a:hover {
  text-decoration: underline;
}

/* Form Styles */
.contact-form-panel {
  display: flex;
  flex-direction: column;
}

.required-notice {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-gray);
  margin-bottom: 25px;
}

.required-notice span {
  color: #d9534f;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 25px;
}

.form-group {
  display: flex;
  flex-direction: column;
  position: relative;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.form-group label span {
  color: #d9534f;
}

.form-control {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background-color: var(--light-gray);
  color: var(--text-dark);
  transition: var(--transition-smooth);
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-gold);
  background-color: #ffffff;
  box-shadow: 0 0 8px rgba(194, 153, 61, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 150px;
}

.contact-form-panel .btn-gold {
  align-self: flex-start;
  margin-top: 15px;
  padding: 14px 45px;
}

/* Form Validation States */
.form-control.invalid {
  border-color: #d9534f;
  background-color: #fdf7f7;
}

.error-message {
  color: #d9534f;
  font-size: 0.8rem;
  margin-top: 5px;
  display: none;
}

/* Success Message Overlay */
.form-success-overlay {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  box-shadow: var(--shadow-premium);
  animation: fadeInUp 0.5s ease;
}

.success-icon {
  font-size: 3.5rem;
  color: var(--primary-gold);
  margin-bottom: 20px;
}

.success-title {
  font-size: 1.8rem;
  color: var(--text-dark);
  margin-bottom: 10px;
  font-weight: 700;
}

.success-desc {
  color: var(--text-gray);
  max-width: 450px;
  margin-bottom: 25px;
}

/* --- Map Section --- */
.map-section {
  width: 100%;
  height: 400px;
  background-color: #e5e5e0;
  position: relative;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

#map {
  width: 100%;
  height: 100%;
}

/* Leaflet Map Premium Styles */
.leaflet-popup-content-wrapper {
  background: var(--dark-bg) !important;
  color: var(--text-light) !important;
  border-radius: 4px !important;
  padding: 5px !important;
}

.leaflet-popup-content h3 {
  color: var(--primary-gold);
  font-size: 0.95rem;
  margin-bottom: 5px;
}

.leaflet-popup-content p {
  font-size: 0.8rem;
  line-height: 1.4;
  margin: 0;
}

.leaflet-popup-tip {
  background: var(--dark-bg) !important;
}

/* --- Footer --- */
footer {
  background-color: var(--light-gray);
  border-top: 1px solid var(--border-light);
  padding: 70px 20px 30px 20px;
  font-size: 0.85rem;
  color: var(--text-gray);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto 50px auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
}

.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dark);
  margin-bottom: 20px;
  letter-spacing: 0.05em;
}

.footer-col p {
  margin-bottom: 12px;
  line-height: 1.7;
}

.footer-col a {
  color: var(--text-gray);
  transition: var(--transition-smooth);
}

.footer-col a:hover {
  color: var(--primary-gold);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 30px;
  border-top: 1px solid var(--border-light);
  text-align: center;
  line-height: 1.8;
}

.footer-bottom-text {
  font-size: 0.85rem;
  color: var(--text-dark);
  margin-bottom: 15px;
}

.footer-bottom-text a {
  font-weight: 600;
  color: var(--text-dark);
}

.footer-bottom-text a:hover {
  color: var(--primary-gold);
}

.copyright-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 0.8rem;
  margin-bottom: 15px;
}

.weebly-attribution {
  font-size: 0.75rem;
  color: #999999;
}

/* --- Back to Top Button --- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background-color: var(--primary-gold);
  color: var(--text-light);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--primary-gold-hover);
  transform: translateY(-3px);
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .contact-info-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding-right: 0;
    padding-bottom: 40px;
  }
}

@media (max-width: 768px) {
  nav {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 280px;
    height: calc(100vh - 70px);
    background-color: #ffffff;
    box-shadow: -5px 5px 15px rgba(0,0,0,0.05);
    transition: var(--transition-smooth);
    padding: 40px 30px;
    z-index: 1000;
  }

  nav.active {
    right: 0;
  }

  nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 25px;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
  }

  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
  }

  .hero-location {
    font-size: 1.6rem;
  }
  
  .hero-sub-brand {
    font-size: 1.4rem;
  }

  .solutions-title {
    font-size: 1.8rem;
  }
  
  .services-list {
    font-size: 1.1rem;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .form-group.full-width {
    grid-column: span 1;
  }
}
