/*
 * Base stylesheet for Pro Motors website.
 *
 * The visual language of this site takes its cues directly from the company
 * branding: clean lines, generous white space, strong colour blocks and a
 * youthful energy. Colours are defined in CSS variables at the top of the
 * document to make future adjustments painless. Hebrew and Arabic text run
 * right‑to‑left, while English runs left‑to‑right; the JavaScript will
 * toggle the direction on the <html> element via a language switcher.
 */

/* CSS variables for easy theme management */
:root {
  --colour-primary: #0a4696;    /* deep blue from the logo */
  --colour-secondary: #e94b35;  /* orange accent from the logo */
  --colour-dark: #0c2540;       /* dark blue for footers and overlays */
  --colour-light: #f4f8ff;      /* light background for sections */
  --colour-text: #1a1a1a;       /* default text colour */
  --colour-muted: #666666;      /* muted text colour */
  --transition-fast: 0.3s;      /* animation timing */
  --nav-height: 70px;           /* fixed header height */
  --max-width: 1200px;          /* maximum content width */
}

/* Global resets and typography */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Heebo', 'Open Sans', 'Cairo', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--colour-text);
  background-color: #ffffff;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--colour-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--colour-secondary);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Utilities */
.container {
  width: 90%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.text-center {
  text-align: center;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  /* Use a dynamic gradient for a more modern look */
  background-image: linear-gradient(135deg, var(--colour-secondary) 0%, var(--colour-primary) 100%);
  color: #fff;
  font-weight: 600;
  text-align: center;
  transition: background-image var(--transition-fast), transform var(--transition-fast);
}

.btn:hover {
  background-image: linear-gradient(135deg, var(--colour-primary) 0%, var(--colour-secondary) 100%);
  transform: translateY(-2px);
}

/* Header & Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background-color: #ffffffcc;
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

header .nav-wrapper {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

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

header .logo img {
  height: 48px;
  width: auto;
  margin-right: 0.5rem;
}

header nav ul {
  display: flex;
  align-items: center;
  gap: 1rem;
}

header nav li a {
  font-weight: 500;
  padding: 0.5rem 0.25rem;
}

header nav li a:hover, header nav li a.active {
  color: var(--colour-secondary);
}

/* Language selector */
.lang-selector {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.9rem;
}

.lang-selector button {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--colour-primary);
  font-weight: 600;
  transition: color var(--transition-fast);
}

.lang-selector button.active {
  color: var(--colour-secondary);
  text-decoration: underline;
}

/* Mobile navigation toggle */
.hamburger {
  display: none;
  flex-direction: column;
  width: 25px;
  height: 20px;
  justify-content: space-between;
  cursor: pointer;
}

.hamburger span {
  display: block;
  height: 3px;
  background-color: var(--colour-primary);
  border-radius: 2px;
  transition: transform var(--transition-fast);
}

@media (max-width: 900px) {
  header nav {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    max-height: 0;
    transition: max-height var(--transition-fast) ease;
    flex-direction: column;
  }
  header nav.open {
    max-height: 400px;
  }
  header nav ul {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    gap: 0.5rem;
  }
  .hamburger {
    display: flex;
  }
}

/* Hero section */
.hero {
  position: relative;
  height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: brightness(0.7);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 1rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
  color: #fff;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  color: #e2e8f0;
}

/* Sections */
section {
  padding: 4rem 0;
}

.section-heading {
  margin-bottom: 2rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background-color: var(--colour-light);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.service-card h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  color: var(--colour-primary);
}

.service-card p {
  font-size: 0.95rem;
  color: var(--colour-muted);
}

.service-card .service-icon {
  font-size: 2.5rem;
  color: var(--colour-secondary);
}

/* About section */
.about-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  align-items: center;
}

.about-wrapper img {
  border-radius: 8px;
  width: 100%;
}

/* Testimonials */
.testimonials {
  background-color: var(--colour-light);
}

.testimonials .testimonial-item {
  background: #ffffff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  margin-bottom: 1rem;
}

.testimonial-author {
  font-weight: 600;
  margin-top: 0.5rem;
}

/* Gallery */
.gallery-grid {
  display: grid;
  /* Use larger columns for before-after pairs */
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* individual images are now wrapped in before-after containers. Images inherit border radius via parent */
.gallery-grid img {
  border-radius: 0;
  cursor: pointer;
  width: 100%;
  height: auto;
  transition: transform var(--transition-fast);
}

.gallery-grid .before-after {
  display: flex;
  flex-wrap: wrap;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.gallery-grid .before-after img {
  width: 50%;
  object-fit: cover;
  transition: transform var(--transition-fast);
}

.gallery-grid .before-after:hover img {
  transform: scale(1.05);
}

/* Lightbox (gallery modal) */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(3px);
  z-index: 2000;
}

.lightbox img {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 8px;
}

/* Blog cards */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.blog-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast);
}

.blog-card:hover {
  transform: translateY(-5px);
}

.blog-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.blog-card .content {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  color: var(--colour-primary);
}

.blog-card p {
  flex: 1;
  font-size: 0.9rem;
  color: var(--colour-muted);
}

.blog-card .read-more {
  margin-top: 1rem;
  align-self: flex-start;
  font-weight: 600;
  color: var(--colour-secondary);
}

/* Contact section */
.contact-section {
  background-color: var(--colour-dark);
  color: #fff;
}

.contact-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.contact-details h4 {
  margin-bottom: 0.5rem;
  color: #fff;
}

.contact-details p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  /* Use the default text colour so the addresses are clearly visible on the light section */
  color: var(--colour-text);
}

.social-links {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
}

.social-links a {
  color: #fff;
  font-size: 1.2rem;
  transition: color var(--transition-fast);
}

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

/* Footer */
footer {
  background-color: var(--colour-dark);
  color: #d1d9e0;
  padding: 2rem 0;
  text-align: center;
  font-size: 0.85rem;
}

/* Form styles */
form {
  max-width: 600px;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

form label {
  font-weight: 600;
  color: var(--colour-dark);
  margin-bottom: 0.25rem;
}

form input, form textarea, form select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
}

form textarea {
  resize: vertical;
  min-height: 120px;
}

form button[type="submit"] {
  justify-self: flex-start;
  padding: 0.75rem 2rem;
  background-color: var(--colour-secondary);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

form button[type="submit"]:hover {
  background-color: var(--colour-primary);
  transform: translateY(-2px);
}

/* Appointment form specific */
#appointment-form .two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

#appointment-form .two-column > div {
  display: flex;
  flex-direction: column;
}

@media (max-width: 600px) {
  #appointment-form .two-column {
    grid-template-columns: 1fr;
  }
}

/* Floating chat/WhatsApp button */
.floating-chat {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1500;
}

.floating-chat a {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #25D366;
  color: #fff;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  font-size: 2rem;
  transition: transform var(--transition-fast);
}

.floating-chat a:hover {
  transform: scale(1.05);
}

/*
 * Hero section overlay enhancements
 *
 * Improve the look of hero sections across the site by adding a semi‑transparent
 * overlay on top of background images and ensuring text remains legible. The
 * positioning logic allows the hero content to remain centered within the
 * section regardless of screen size.
 */
.hero {
  position: relative;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 40vh;
  color: #fff;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 0;
}

.hero .hero-content {
  position: relative;
  z-index: 1;
}

.hero .hero-content h1,
.hero .hero-content p {
  color: #fff;
}

/* FAQs accordion */
.accordion {
  max-width: 800px;
  margin: 0 auto;
  border-top: 1px solid #ccc;
}

.accordion-item {
  border-bottom: 1px solid #ccc;
}

.accordion-title {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  font-weight: 600;
  color: var(--colour-primary);
}

.accordion-title:hover {
  color: var(--colour-secondary);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-fast) ease;
  padding-right: 0.5rem;
}

.accordion-content p {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--colour-text);
}

.accordion-item.active .accordion-content {
  max-height: 500px;
  padding-bottom: 1rem;
}

/* Login (customer area) */
.login-wrapper {
  max-width: 400px;
  margin: 0 auto;
  padding: 2rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.login-wrapper h2 {
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--colour-primary);
}

.login-wrapper .form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
}

.login-wrapper .form-group label {
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.login-wrapper .form-group input {
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

.login-wrapper button[type="submit"] {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--colour-secondary);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.login-wrapper button[type="submit"]:hover {
  background-color: var(--colour-primary);
}

/* Cart overlay */
#cart-overlay {
  position: fixed;
  top: var(--nav-height);
  right: 1rem;
  width: 320px;
  max-height: 80vh;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  padding: 1rem;
  overflow-y: auto;
  transform: translateX(110%);
  transition: transform var(--transition-fast) ease;
  z-index: 1200;
}

#cart-overlay.open {
  transform: translateX(0);
}

#cart-overlay h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--colour-primary);
  font-size: 1.2rem;
  text-align: center;
}

#cart-overlay .cart-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

#cart-overlay .cart-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
}

#cart-overlay button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

#cart-overlay #cart-clear {
  background-color: #e2e8f0;
  color: #333;
}

#cart-overlay #cart-checkout {
  background-color: var(--colour-secondary);
  color: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .btn {
    padding: 0.6rem 1.2rem;
  }
}
