/* Main Styles for Bandas Transportadoras SL */
:root {
  --primary-color: #1a1a1a;
  --secondary-color: #f57c00;
  --accent-color: #005f73;
  --background-color: #f9f9f9;
  --text-color: #333333;
  --light-gray: #eeeeee;
  --max-width: 1200px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
}

/*
 * Add consistent bottom margin to paragraphs across the site.  This avoids
 * situations where consecutive paragraphs or paragraphs following headings
 * appear crowded together. */
p {
  margin-bottom: 1rem;
}

/*
 * A generic wrapper that centralises all page content.  In the original
 * version this element had very little internal padding which resulted in
 * cramped layouts and a lack of white‑space.  To improve readability and
 * give the design more breathing room on desktop, the container now
 * provides generous horizontal padding as well as a maximum width.  On
 * smaller viewports the percentage width ensures the content still scales
 * gracefully.
 */
/*
 * The central content wrapper.  On small screens we keep the side padding
 * modest so that the layout remains compact.  On larger viewports a
 * media query increases the padding for better breathing room.
 */
/*
 * The container defines the horizontal margins and internal padding for
 * all content blocks.  The previous version used a fixed 90% width
 * with minimal padding, which caused the design to feel cramped on
 * desktop screens.  We reduce the width slightly and increase the
 * padding so that the layout has more breathing room.  On large
 * viewports the padding increases even further.  The max‑width
 * constraint prevents overly wide lines of text.
 */
/*
 * Central content wrapper.  Increase internal padding and allow more breathing
 * room on desktop.  A 90% width retains a generous left and right margin.
 */
.container {
  width: 85%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem;
}

@media (min-width: 992px) {
  .container {
    padding: 4rem;
  }
}

header {
  background-color: #ffffff;
  border-bottom: 4px solid var(--secondary-color);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 1rem 0;
}

nav .logo a {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

nav ul li {
  position: relative;
}

nav ul li a {
  color: var(--primary-color);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  transition: color 0.3s;
}

nav ul li a:hover {
  color: var(--secondary-color);
}

nav ul li .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #ffffff;
  border: 1px solid var(--light-gray);
  z-index: 1000;
  min-width: 250px;
}

nav ul li:hover > .submenu {
  display: block;
}

nav ul li .submenu li {
  width: 100%;
}

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--primary-color);
}

/* Hero section */
.hero {
  background: url('../img/hero.jpg') no-repeat center center/cover;
  color: #ffffff;
  padding: 4rem 0;
  text-align: center;
  position: relative;
}

.hero .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  z-index: 1;
  position: relative;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  z-index: 1;
  position: relative;
}

.hero .cta {
  background-color: var(--secondary-color);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  z-index: 1;
  position: relative;
}

/* Sections */
/*
 * Section wrapper.  We define a base vertical padding of 2rem and
 * increase it on wider screens using a media query.  This ensures that
 * mobile layouts remain compact while desktop layouts have more
 * white‑space between blocks.
 */
/*
 * Sections define the vertical spacing between blocks.  To improve
 * vertical rhythm, increase the base padding and further expand it on
 * larger screens.  This change provides generous white‑space on
 * desktop while keeping mobile layouts compact.
 */
section {
  padding: 3rem 0;
}

@media (min-width: 992px) {
  section {
    padding: 5rem 0;
  }
}

/*
 * Headings level 1 should be left aligned by default so that titles
 * align with body copy.  Specific contexts like the hero can override
 * this rule.  Add bottom margin for separation from subsequent
 * paragraphs.  Without this, some pages displayed centred headings
 * alongside left‑aligned paragraphs, which looked inconsistent.
 */
h1 {
  text-align: left;
  margin-bottom: 1rem;
}

/*
 * Headings inside sections are now left aligned for consistency with
 * paragraph text.  The additional margin creates clear separation from
 * subsequent content. */
section h2 {
  text-align: left;
  margin-bottom: 2rem;
  color: var(--primary-color);
}

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

.card {
  background-color: #ffffff;
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

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

/*
 * Category hero images on category pages.  These images span the full width
 * of their container, maintain aspect ratio, have subtle corner rounding,
 * and provide breathing space above and below the accompanying text.
 */
/*
 * Images at the top of category and service pages.  Limit the height on
 * desktop to avoid overpowering the content and maintain aspect ratio.
 */
.category-image {
  width: 100%;
  max-height: 350px;
  object-fit: cover;
  border-radius: 8px;
  margin: 1.5rem 0;
}

@media (min-width: 992px) {
  .category-image {
    max-height: 300px;
  }
}

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

.card h3 {
  font-size: 1.25rem;
  color: var(--primary-color);
  margin: 1rem;
  /* Align card headings to the left so that they match the body copy. */
  text-align: left;
}

.card p {
  padding: 0 1rem 1rem;
  font-size: 0.95rem;
  color: var(--text-color);
}

.card a {
  display: block;
  margin: 0 1rem 1rem;
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: bold;
}

/* Forms */
form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

form label {
  font-weight: bold;
}

form input[type="text"],
form input[type="email"],
form input[type="tel"],
form select,
form textarea {
  padding: 0.5rem;
  border: 1px solid var(--light-gray);
  border-radius: 4px;
  width: 100%;
}

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

form button {
  background-color: var(--secondary-color);
  color: #ffffff;
  border: none;
  padding: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

form button:hover {
  background-color: #e06600;
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: #ffffff;
  padding: 2rem 0;
}

footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

footer nav a {
  color: #ffffff;
  margin: 0 0.5rem;
  text-decoration: none;
  font-size: 0.9rem;
}

footer nav a:hover {
  text-decoration: underline;
}

/* Responsive Navigation */
@media (max-width: 768px) {
  nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    background-color: #ffffff;
    border-top: 1px solid var(--light-gray);
  }
  nav ul.open {
    display: flex;
  }
  nav ul li {
    width: 100%;
  }
  nav ul li a {
    display: block;
    padding: 0.75rem 1rem;
  }
  .menu-toggle {
    display: block;
  }
}
