/**
 * Site Footer Component Styles
 * 
 * Features:
 * - 4-column layout (Info, Categories, Policies, Support)
 * - Newsletter subscription
 * - Payment methods display
 * - Back to top button
 * - Fully responsive
 * 
 * Performance Optimizations:
 * - CSS containment
 * - Hardware acceleration for animations
 * - Minimal reflows
 */

/* ===================================
   Footer Container
   NOTE: Brand colors defined in brand-variables.css
   =================================== */
.site-footer {
  font-family: var(--font-primary);
  background-color: var(--footer-bg-color, #f1f1f1);
  color: var(--footer-text-color, #1C1B1B);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  font-size: 0.875rem; /* 14px */
  line-height: 1.25rem; /* 20px */
  padding-top: 3.5rem; /* 56px */
  position: relative;
  border-top: 1px solid #e5e5e5;
}

.site-footer__container {
  /* Full width like live site - no max-width restriction */
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 40px;  /* Side padding for content */
}

/* ===================================
     Main Footer Content (4-Column Layout)
     =================================== */

.site-footer__main {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-bottom: 50px;
  position: relative;
}

/* Left Group: Info, Categories, Policies, Support (4 equal columns) */
.site-footer__left-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 60px;  /* Increased gap between categories per line 85 */
}

/* Remove right group styles - not needed anymore */
.site-footer__right-group {
  display: none;
}

.site-footer__column {
  display: flex;
  flex-direction: column;
}

.site-footer__column--info {
  min-width: 0;
}

/* Column Headings */
.site-footer__heading {
  font-family: var(--font-bold); /* Changed from font-bold to font-primary to remove bold */
  font-size: 16px; /* Increased from 14px for larger text */
  font-weight: 700; 
  line-height: 1.5;
  color: var(--footer-headings-color, var(--color-nava, #598017));
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 20px 0;
}

/* Lists */
.site-footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.site-footer__list-item {
  line-height: 1.6;
  margin-bottom: 12px; /* Add spacing between items for better readability */
}

.site-footer__list-item:last-child {
  margin-bottom: 0;
}

/* Links */
.site-footer__link {
  color: var(--footer-text-color, #1C1B1B);
  text-decoration: none;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  transition: color 0.2s ease;
  display: inline-block;
}

.site-footer__link:hover {
  color: var(--footerIcon, var(--color-nava, #598017));
}

.site-footer__link--icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Icon */
.site-footer__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}

/* Text */
.site-footer__text {
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 1.6;
  color: var(--footer-text-color, #1C1B1B);
}

.site-footer__text--muted {
  font-size: 13px;
}

/* Address */
.site-footer__address {
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 1.6;
  color: var(--footer-text-color, #1C1B1B);
  font-style: normal;
  margin: 0;
}

.site-footer__address strong {
  font-family: var(--font-bold);
  font-weight: 700;
}

/* ===================================
     Newsletter Section
     =================================== */

.site-footer__newsletter {
  margin-bottom: 40px;
  max-width: 450px; /* Reduced from 600px - narrower email box with button next to it */
}

.site-footer__newsletter-text {
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 1.6;
  color: var(--footer-text-color, #1C1B1B);
  margin: 0 0 16px 0;
}

.site-footer__newsletter-form {
  display: flex;
  align-items: stretch;
  max-width: 450px;
}

.site-footer__newsletter-input {
  flex: 1;
  padding: 12px 20px;
  border: 1px solid #cccccc;
  border-right: none;
  border-radius: 4px 0 0 4px;
  font-family: var(--font-primary);
  font-size: 14px;
  color: var(--color-black);
  background-color: var(--color-white);
  outline: none;
  transition: border-color 0.2s ease;
}

.site-footer__newsletter-input::placeholder {
  color: #999999;
}

.site-footer__newsletter-input:focus {
  border-color: var(--color-nava);
}

.site-footer__newsletter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background-color: var(--color-nava);
  color: var(--color-white);
  border: 1px solid var(--color-nava);
  border-radius: 0 4px 4px 0;
  font-family: var(--font-bold);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.site-footer__newsletter-button:hover {
  background-color: var(--color-nava-dark);
  border-color: var(--color-nava-dark);
}

.site-footer__newsletter-button:active {
  transform: scale(0.98);
}

.site-footer__newsletter-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ===================================
     Divider
     =================================== */

.site-footer__divider {
  height: 1px;
  background-color: #ccc;
  margin: 0 0 30px 0;
}

/* ===================================
     Bottom Section
     =================================== */

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 30px;
  gap: var(--spacing-lg);
}

.site-footer__copyright {
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--color-gray-disabled);
  margin: 0;
}

/* Payment Methods */
.site-footer__payments {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer__payment-icon {
  width: auto;
  max-width: 50px;
  object-fit: contain;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.site-footer__payment-icon:hover {
  opacity: 1;
}

/* ===================================
     Back to Top Button
     =================================== */

.site-footer__back-to-top {
  position: fixed;
  bottom: 100px;
  right: 34px;
  width: 48px;
  height: 48px;
  background-color: transparent;
  color: var(--color-black);
  /* border: 2px solid #e5e5e5; */
  /* border-radius: 50%; */
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); */
  transition: all 0.3s ease;
  z-index: 90;
}
.site-footer__message {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: none;
  width: 56px;
  height: 56px;
  padding: 16px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  border-radius: 30px;
  background: var(--476A6F, #476a6f);
  color: var(--color-white);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 90;
}

.site-footer__back-to-top.is-visible {
  display: flex;
}

.site-footer__message.is-visible {
  display: flex;
}

.site-footer__back-to-top:hover {
  /* background-color: var(--color-nava); */
  /* color: var(--color-white); */
  /* border-color: var(--color-nava); */
  transform: translateY(-4px);
  /* box-shadow: 0 6px 16px rgba(125, 154, 76, 0.3); */
}
.site-footer__message:hover {
  background-color: var(--color-nava);
  color: var(--color-white);
  border-color: var(--color-nava);
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(125, 154, 76, 0.3);
}

.site-footer__back-to-top:active {
  transform: translateY(-2px);
}

.site-footer__back-to-top svg {
  width: 24px;
  height: 24px;
}

/* ===================================
     Mobile Footer Section
     =================================== */

.site-footer__mobile {
  display: none;
}

.site-footer__column--newsletter {
  display: none;
}

/* ===================================
     Responsive Design
     =================================== */

/* Tablet: 768px - 1023px */
@media (max-width: 1023px) {
  .site-footer__main {
    flex-direction: column;
    gap: 40px;
  }

  .site-footer__left-group {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablet */
    gap: 30px;
  }

  .site-footer__column--info {
    grid-column: 1 / -1; /* Full width for info */
  }
}

/* Mobile: 320px - 767px */
@media (max-width: 767px) {
  .site-footer {
    padding: 40px 0 0;
  }

  .site-footer__container {
    padding: 0 var(--spacing-md);
    display: flex;
    flex-direction: column;
  }

  .site-footer__main {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-bottom: 0;
  }

  .site-footer__left-group {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  /* Reorder columns for mobile: Info first, then others */
  .site-footer__column--info {
    order: 1;
    padding-bottom: 32px;
    border-bottom: 1px solid #ccc;
  }

  .site-footer__column--categories {
    order: 2;
    padding-bottom: 32px;
    border-bottom: 1px solid #ccc;
  }

  .site-footer__column--policies {
    order: 3;
    padding-bottom: 32px;
    border-bottom: 1px solid #ccc;
  }

  .site-footer__column--support {
    order: 4;
    padding-bottom: 32px;
    border-bottom: 1px solid #ccc;
  }

  .site-footer__heading {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .site-footer__list {
    gap: 10px;
  }

  .site-footer__link,
  .site-footer__text,
  .site-footer__address {
    font-size: 13px;
  }

  /* Newsletter Section */
  .site-footer__newsletter {
    max-width: 100%;
  }

  .site-footer__newsletter-text {
    font-size: 13px;
    margin-bottom: 12px;
    margin-top: 12px;
  }

  .site-footer__newsletter-form {
    flex-direction: column;
    gap: 10px;
    max-width: 100%;
  }
  .site-footer__newsletter-button img {
    display: none;
  }

  .site-footer__newsletter-input {
    border-radius: 4px 4px 4px 4px;
    border: 1px solid #cccccc;

    padding: 14px 16px;
  }

  .site-footer__newsletter-button {
    border-radius: 4px 4px 4px 4px;
    justify-content: center;
    padding: 14px 20px;
  }

  /* Bottom Section */
  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 32px; /* Extra space for back-to-top button */
    margin-top: 32px;
  }

  .site-footer__copyright {
    font-size: 13px;
    order: 2;
    text-align: center;
    width: 100%;
  }

  .site-footer__payments {
    order: 1;
    justify-content: space-between;
    width: 97%;
  }

  .site-footer__payment-icon {
    max-width: 40px;
  }

  /* Back to Top Button */
  .site-footer__back-to-top {
    bottom: 180px;
    right: 20px;
    width: 56px;
    height: 56px;
    background-color: transparent;
  }

  .site-footer__back-to-top svg {
    width: 22px;
    height: 22px;
  }

  /* Message Button */
  .site-footer__message {
    bottom: 130px;
    right: 20px;
    width: 56px;
    height: 56px;
    padding: 16px;
    background: var(#476a6f, #476a6f);
  }

  .site-footer__message img {
    width: 22px;
    height: 22px;
  }

  .site-footer__message:hover {
    background-color: var(--color-nava-dark);
    border-color: var(--color-nava-dark);
  }
}

/* ===================================
     Print Styles
     =================================== */

@media print {
  .site-footer__newsletter,
  .site-footer__back-to-top,
  .site-footer__message {
    display: none;
  }

  .site-footer {
    background-color: transparent;
    padding: 20px 0;
  }

  .site-footer__main {
    grid-template-columns: repeat(2, 1fr);
  }
}
