/* Modern CSS Variables - Santoro Oil Inspired */
/* Reset any old styles that might interfere */
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Prevent any element from causing horizontal overflow */
*, *::before, *::after {
  max-width: 100%;
}

.container, .header-content, .hero-content, .footer-content {
  max-width: min(1200px, 100vw);
  width: 100%;
}

:root {
  --primary-color: #004DDB;
  --secondary-color: #E61F26;
  --success-color: #00C851;
  --danger-color: #ff4444;
  --warning-color: #ffbb33;
  --dark-color: #263238;
  --light-color: #f8f9fa;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --border-radius: 12px;
  --box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  --box-shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Override existing styles */
body {
  margin: 0 !important;
  margin-top: 0 !important;
  padding: 0;
  line-height: 1.6;
  font-family: 'Roboto', sans-serif !important;
  color: var(--gray-800);
  background-color: #ffffff;
}

.pageHeader {
  display: none !important; /* Hide the old header */
}

/* New Modern Header */
.modern-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #1976d2 50%, var(--secondary-color) 100%);
  color: white;
  padding: 1.5rem 0;
  box-shadow: 0 4px 20px rgba(0, 77, 219, 0.15);
  position: relative;
  overflow: hidden;
}

.header-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-logo {
  font-family: 'Oswald', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header-tagline {
  font-size: 1rem;
  opacity: 0.95;
  margin: 0;
  font-weight: 400;
}

.header-contact {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.header-phone {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  color: white;
  transition: var(--transition);
}

.header-phone:hover {
  color: #ffeb3b;
  transform: scale(1.05);
}

.header-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
  .modern-header {
    padding: 1rem 0;
  }
  
  .header-content {
    flex-direction: column;
    text-align: center;
    padding: 0 1rem;
  }
  
  .header-logo {
    font-size: 2rem;
  }
  
  .header-contact {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Typography System */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

h1 { font-size: 3.5rem; line-height: 1.1; }
h2 { font-size: 2.5rem; line-height: 1.2; }
h3 { font-size: 1.75rem; line-height: 1.3; }

p, div, span, label, input, select, textarea {
  font-family: 'Roboto', sans-serif;
}

.lead {
  font-size: 1.25rem;
  font-weight: 400;
  opacity: 0.9;
}

/* Hero Section - Modern Santoro Style */
.hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, #1976d2 50%, var(--primary-color) 100%);
  color: white;
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-bottom: 4rem;
  box-shadow: 0 4px 20px rgba(0, 77, 219, 0.2);
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('/img/scituate-oil-truck.jpg') center/cover;
  opacity: 0.25;
  z-index: 0;
}

.hero-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 70% 30%, rgba(230, 31, 38, 0.1) 0%, transparent 50%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
}

.hero-section h1 {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-shadow: 2px 4px 8px rgba(0,0,0,0.3);
  line-height: 1.1;
}

.hero-section .lead {
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 2rem;
  opacity: 0.95;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.hero-cta .btn {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 50px;
  min-width: 200px;
}

.btn-hero-primary {
  background: var(--secondary-color);
  color: white;
  border: 2px solid var(--secondary-color);
}

.btn-hero-primary:hover {
  background: transparent;
  color: var(--secondary-color);
  border-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(230, 31, 38, 0.3);
}

.btn-hero-secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-hero-secondary:hover {
  background: white;
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
  .hero-section {
    padding: 4rem 0;
    margin-bottom: 3rem;
  }
  
  .hero-content {
    padding: 0 1rem;
  }
  
  .hero-section h1 {
    font-size: 2.5rem;
  }
  
  .hero-cta {
    flex-direction: column;
  }
  
  .hero-cta .btn {
    width: 100%;
    max-width: 300px;
  }
}

.price-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.price-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2.5rem;
  text-align: center;
  transition: var(--transition);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.price-card.cash {
  background: linear-gradient(135deg, #f8fff8 0%, #e8f5e8 100%);
  border-color: var(--success-color);
}

.price-card.credit {
  background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
  border-color: var(--primary-color);
}

.price-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.price-card.cash::before {
  background: linear-gradient(90deg, var(--success-color), #00e676);
}

.price-card.credit::before {
  background: linear-gradient(90deg, var(--primary-color), #2196f3);
}

.price-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.price-card.cash:hover {
  border-color: var(--success-color);
  box-shadow: 0 20px 40px rgba(0, 200, 81, 0.2);
}

.price-card.credit:hover {
  border-color: var(--primary-color);
  box-shadow: 0 20px 40px rgba(0, 77, 219, 0.2);
}

.price-card h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: var(--dark-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.price-display {
  font-family: 'Oswald', sans-serif;
  font-size: 4.5rem;
  font-weight: 700;
  margin: 1.5rem 0;
  letter-spacing: -2px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
  line-height: 1;
}

.cash .price-display {
  color: var(--success-color);
}

.credit .price-display {
  color: var(--primary-color);
}

.price-unit {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.price-benefits {
  background: rgba(255, 255, 255, 0.7);
  padding: 1.25rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.price-benefits p {
  margin: 0.5rem 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--dark-color);
}

.price-highlight {
  background: var(--warning-color);
  color: var(--dark-color);
  padding: 0.75rem 1rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 1rem;
  margin-top: 1rem;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(255, 187, 51, 0.3);
}

.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  
  .price-cards {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .gallons-input-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .phone-inputs {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.order-form {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2.5rem;
  border: 1px solid var(--gray-200);
  position: relative;
}

.order-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.order-form h2 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-size: 2rem;
}

.info-section {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2rem;
  border: 1px solid var(--gray-200);
  margin-bottom: 1.5rem;
}

.info-section h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 500;
  color: var(--dark-color);
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--border-radius);
  transition: var(--transition);
  font-size: 1rem;
  background: #ffffff;
  box-sizing: border-box;
  font-family: 'Roboto', sans-serif;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(0, 77, 219, 0.1);
  transform: translateY(-1px);
}

.form-control:hover {
  border-color: var(--gray-400);
}

.form-control.error {
  border-color: var(--danger-color);
  box-shadow: 0 0 0 4px rgba(255, 68, 68, 0.1);
}

.btn {
  padding: 1rem 2rem;
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  font-family: 'Roboto', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 77, 219, 0.2);
}

.btn-success {
  background: var(--success-color);
  color: white;
  border-color: var(--success-color);
}

.btn-success:hover {
  background: transparent;
  color: var(--success-color);
  border-color: var(--success-color);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 200, 81, 0.2);
}

.alert {
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  font-weight: 500;
}

.alert-warning {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
}

.alert-danger {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.alert-success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.phone-inputs {
  display: grid;
  grid-template-columns: 80px 80px 100px;
  gap: 0.5rem;
  align-items: center;
}

.phone-inputs input {
  text-align: center;
}

/* Medium screens - adjust phone input sizes */
@media (max-width: 768px) {
  .phone-inputs {
    grid-template-columns: 70px 70px 90px;
    gap: 0.4rem;
  }
}

.gallons-calculator {
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  border: 1px solid #e2e8f0;
}

.gallons-input-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.total-display {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--primary-color);
  color: white;
  padding: 1.25rem;
  border-radius: var(--border-radius);
  margin-top: 1rem;
  line-height: 1.5;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.service-areas, .contact-info, .about-service {
  margin-bottom: 1.5rem;
}

.footer-info {
  background: var(--danger-color);
  color: white;
  padding: 1rem;
  border-radius: var(--border-radius);
  text-align: center;
  margin-top: 2rem;
}

.hidden {
  display: none;
}

/* Modern Footer Styles */
.modern-footer {
  background: linear-gradient(135deg, var(--dark-color) 0%, var(--gray-800) 50%, var(--primary-color) 100%);
  color: white;
  margin-top: 4rem;
}

.footer-top {
  padding: 3rem 0 2rem 0;
  position: relative;
}

.footer-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--success-color));
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.footer-section h3,
.footer-section h4 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-section h5 {
  color: white;
  margin: 1rem 0 0.5rem 0;
  font-weight: 600;
}

.footer-logo h3 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.footer-tagline {
  opacity: 0.9;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
}

.footer-certifications {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cert-badge {
  background: rgba(0, 77, 219, 0.2);
  border: 1px solid rgba(0, 77, 219, 0.3);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  backdrop-filter: blur(10px);
}

.contact-info p {
  margin: 0.75rem 0;
  font-size: 1rem;
}

.contact-info a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

.contact-info a:hover {
  color: #ffeb3b;
  text-decoration: underline;
}

.services-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.services-list li {
  margin: 0.75rem 0;
  font-size: 1rem;
}

.services-list a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: all 0.3s ease;
}

.services-list a:hover {
  color: var(--secondary-color);
  padding-left: 0.5rem;
}

.cities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.cities-grid span {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.3rem 0.6rem;
  border-radius: 15px;
  font-size: 0.85rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-bottom {
  background: rgba(0, 0, 0, 0.3);
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.footer-links a:hover {
  color: var(--secondary-color);
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.social-link {
  display: inline-block;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  text-align: center;
  line-height: 40px;
  font-size: 1.2rem;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-link:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(230, 31, 38, 0.3);
}

.copyright {
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.8;
  line-height: 1.6;
}

.additional-info {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  font-style: italic;
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }
  
  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-links {
    justify-content: center;
  }
  
  .cities-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }
  
  .cert-badge {
    font-size: 0.8rem;
  }
}

/* Additional mobile responsive styles */
@media (max-width: 480px) {
  .container {
    padding: 0.5rem !important;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  .order-form, .info-section {
    padding: 1rem;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  .price-card {
    padding: 1.5rem;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  .hero-section {
    padding: 3rem 0;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  .header-content,
  .hero-content,
  .footer-content {
    max-width: 100%;
    overflow-x: hidden;
    padding: 0 1rem;
  }
  
  /* Fix grid layouts on small screens */
  div[style*="grid-template-columns: 2fr 1fr 1fr"] {
    display: block !important;
  }
  
  div[style*="grid-template-columns: 1fr 1fr"] {
    display: block !important;
  }
  
  /* Prevent text and elements from overflowing */
  .header-logo, .header-tagline, .header-phone, .header-badge {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Force flex items to wrap and not overflow */
  .header-contact, .hero-cta, .gallons-input-group {
    flex-wrap: wrap;
    max-width: 100%;
  }
  
  /* Ensure form elements don't overflow */
  .form-control, input, select, textarea {
    max-width: 100%;
    min-width: 0;
  }
  
  /* Fix phone inputs specifically - keep horizontal for US phone format */
  .phone-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 0.3rem;
    align-items: center;
  }
  
  .phone-inputs input {
    width: 100%;
    text-align: center;
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
  }
}

/* Ultra-small screens (below 320px) */
@media (max-width: 320px) {
  .header-logo {
    font-size: 1.5rem !important;
  }
  
  .hero-section h1 {
    font-size: 1.8rem !important;
  }
  
  .price-display {
    font-size: 3rem !important;
  }
  
  .container {
    padding: 0.25rem !important;
  }
  
  .order-form, .info-section, .price-card {
    padding: 0.75rem !important;
    margin: 0.5rem 0 !important;
  }
  
  /* Ensure no fixed widths cause overflow */
  * {
    max-width: 100% !important;
  }
  
  /* Force word wrapping on all text */
  h1, h2, h3, h4, h5, h6, p, span, div, label {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto;
  }
}