.site-footer {
  /* Base styles for the footer wrapper are in layout.css (.floating-section) */
  /* This file styles the content *inside* the footer. */
}

/* ======================================================================== */
/* VARIABLES & BASE CONTAINER */
/* ======================================================================== */
.footer-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  /* Spacing is now handled by the parent .floating-section */
}

.footer-divider {
  border: 0;
  height: 1px; /* FIX: Corrected typo */
  background-color: rgba(1, 62, 55, .15);
  margin: 0;
}

/* ======================================================================== */
/* 1. NEWSLETTER */
/* ======================================================================== */
.footer-newsletter {
  text-align: center;
}

.footer-newsletter h2 {
  font-size: clamp(1.48rem, 6.4vw, 2rem);
  font-weight: 800;
  line-height: 1.08;
  color: var(--deep-green);
}

.footer-newsletter p {
  font-size: clamp(.74rem, 2.9vw, .9rem);
  line-height: 1.45;
  color: var(--muted);
  max-width: 45ch;
  margin: 0 auto 24px;
}

.newsletter-form {
  width: 100%;
  position: relative; /* Set position context for the button */
  max-width: 480px; /* Increased max-width to accommodate text button */
  margin: 0 auto;
}

.newsletter-form input {
  width: 100%;
  min-width: 0; /* Keep for flexbox compatibility */
  height: 46px; /* REFINEMENT: Standardized height. */
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--cream);
  /* Add padding on the right to make space for the button */
  padding: 0 52px 0 16px;
  color: var(--text);
  font-weight: 600;
  font-size: .9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--dark-green);
  box-shadow: 0 0 0 2px var(--dark-green);
}

.newsletter-form button {
  /* Position button inside the input field on mobile */
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  
  /* Style as a square icon button */
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--dark-green);
  color: white;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.newsletter-form button:active {
  transform: translateY(-50%) scale(0.92);
}

.newsletter-form .arrow-icon {
  width: 20px;
  height: 20px;
}

/* Hide the text span on mobile */
.newsletter-form .button-text {
  display: none;
  position: absolute;
}

.newsletter-form button:hover {
  background-color: var(--deep-green);
}

/* ======================================================================== */
/* 2. LINKS GRID */
/* ======================================================================== */
.footer-links-grid {
  width: 100%;
  display: grid;
  padding: 21px 0 22px;
  grid-template-columns: repeat(3, 1fr); /* Mobile: 3 columns */
  gap: 16px; /* POLISH: Reduced gap for mobile */
  text-align: left;
}

.footer-column {
  min-width: 0;
  text-align: left;
}

.footer-column h3 {
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dark-green);
  margin: 0 0 16px;
}

.footer-column ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-column a {
  line-height: 1.28;
  color: var(--dark-green);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.8rem; /* POLISH: Reduced font size for mobile */
  overflow-wrap: anywhere;
  transition: color 0.2s;
}

.footer-column a:hover {
  color: var(--deep-green);
}

/* ======================================================================== */
/* 3. BRAND BLOCK */
/* ======================================================================== */
.footer-brand-block {
  padding: 21px 0 11px;
  text-align: center;
}

.footer-brand-block h4 {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1;
  color: var(--deep-green);
  margin: 0 0 10px; /* POLISH: Reduced margin */
}

.footer-brand-block p {
  line-height: 1.35;
  color: var(--dark-green);
  font-size: 0.9rem;
  margin: 0 0 20px; /* POLISH: Reduced margin */
}

.footer-social {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px; /* POLISH: Adjusted gap for icons */
}

.footer-social img {
  display: block;
  height: 22px; /* POLISH: Set icon height */
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-social a:hover img {
  opacity: 1;
}

/* ======================================================================== */
/* 4. BOTTOM BAR */
/* ======================================================================== */
.footer-bottom-bar {
  flex-direction: row; /* Mobile: Horizontal layout */
  flex-wrap: wrap; /* Allow wrapping on very small screens */
  justify-content: space-between;
  align-items: center;
  display: flex;
  gap: 12px 24px; /* row-gap column-gap */
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-bottom-bar p {
  margin: 0;
  line-height: 1.35;
}

.footer-legal-links {
  display: flex;
  justify-content: flex-start; /* Align to the start of the container */
  align-items: center;
  gap: clamp(12px, 4vw, 22px);
}

.footer-legal-links a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-legal-links a:hover {
  color: var(--dark-green);
}

/* ======================================================================== */
/* RESPONSIVE: Tablet, Laptop, Desktop (SHARED LAYOUT) */
/* ======================================================================== */
@media (min-width: 768px) {
  .footer-newsletter h2 {
    margin-bottom: 10px;
    font-size: 2.25rem;
  }

  .footer-newsletter p {
    max-width: 36rem;
    margin-bottom: 20px;
    font-size: 1rem;
  }

  .newsletter-form {
    max-width: 620px;
    gap: 12px;
  }

  .newsletter-form input,
  .newsletter-form button {
    height: 56px;
    border-radius: 10px;
  }

  .newsletter-form input {
    padding-inline: 18px;
    font-size: 1rem;
  }

  .newsletter-form button {
    width: 128px;
    font-size: .92rem;
  }

  /* Revert to original layout for tablet and desktop */
  .newsletter-form {
    position: static;
    display: flex;
    flex-direction: row;
    gap: 12px;
  }

  .newsletter-form input {
    flex-grow: 1;
    padding: 0 18px; /* Restore original padding */
  }

  .newsletter-form button {
    position: static;
    transform: none;
    width: 128px; /* Restore original width */
    height: 56px;
  }

  /* --- 3-Column Links Grid --- */

  .footer-column {
    text-align: left;
  }

  .footer-column h3,
  .footer-column ul {
    text-align: left;
  }

  .newsletter-form .arrow-icon {
    display: none; /* Hide arrow icon */
  }

  .newsletter-form .button-text {
    display: inline; /* Show "Subscribe" text */
    position: static;
  }

  .footer-links-grid {
    gap: 24px;
    text-align: left;
    padding: 32px 0 34px; /* Adjust padding for tablet */
  }

  .footer-column h3 {
    margin-bottom: 14px;
    font-size: .82rem;
  }

  .footer-column ul {
    gap: 10px;
  }

  .footer-column a {
    font-size: .88rem;
  }

  .footer-brand-block {
    padding: 32px 0 14px;
  }

  .footer-brand-block h4 {
    margin-bottom: 8px;
    font-size: 2.45rem;
  }

  .footer-brand-block p {
    font-size: 1rem;
  }

  /* --- 2-Column Bottom Bar --- */
  .footer-bottom-bar {
    gap: 9px; /* Adjust gap for tablet */
  }

  .footer-legal-links {
    gap: 26px;
  }

  .footer-bottom-bar,
  .footer-legal-links a {
    font-size: .88rem;
  }
}

@media (min-width: 1024px) {
  .footer-newsletter h2 {
    font-size: 2.65rem;
  }

  .footer-newsletter p {
    max-width: 42rem;
    margin-bottom: 24px;
    font-size: 1.08rem;
  }

  .newsletter-form {
    max-width: 660px;
    gap: 14px;
  }

  .newsletter-form input,
  .newsletter-form button {
    height: 60px;
    border-radius: 12px;
  }

  .newsletter-form button {
    width: 140px;
    font-size: .96rem;
  }

  .footer-links-grid {
    width: min(100%, 1040px);
    gap: 72px;
    padding: 44px 0 46px;
  }

  .footer-column h3 {
    margin-bottom: 18px;
    font-size: .94rem;
  }

  .footer-column ul {
    gap: 14px;
  }

  .footer-column a {
    font-size: 1.04rem;
  }

  .footer-brand-block {
    padding: 44px 0 18px;
    padding: 24px 0;
  }

  .footer-brand-block h4 {
    margin-bottom: 10px;
    font-size: 3.25rem;
  }

  .footer-brand-block p {
    font-size: 1.12rem;
  }

  .footer-legal-links {
    gap: 34px;
  }

  .footer-bottom-bar,
  .footer-legal-links a {
    font-size: 1rem;
  }
}

@media (min-width: 1440px) {
  .footer-newsletter h2 {
    font-size: 3rem;
  }

  .footer-newsletter p {
    max-width: 46rem;
    margin-bottom: 28px;
    font-size: 1.14rem;
  }

  .newsletter-form {
    max-width: 700px;
    gap: 16px;
  }

  .newsletter-form input,
  .newsletter-form button {
    height: 64px;
  }

  .newsletter-form input {
    padding-inline: 22px;
  }

  .newsletter-form button {
    width: 152px;
    font-size: 1rem;
  }
}
