﻿/**
 * Footer Component - Rebelhorn-inspired Footer
 */

/* ==========================================================================
   Footer Structure
   ========================================================================== */

.site-footer {
  background-color: var(--color-primary);
  color: var(--color-white);
  margin-top: auto;
}

/* Newsletter Section */
.footer-newsletter {
  background-color: var(--color-secondary);
  padding: var(--spacing-xxl) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;   /* anchor for the absolute loader bar */
}

/* Full-width loading bar — bounces red across the top of the section */
.newsletter-loader {
  display: none;          /* out of flow — never a flex child */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: #ff0000;
  overflow: hidden;
  pointer-events: none;
}

.newsletter-loader.active {
  display: block;
}

.newsletter-loader::after {
  content: '';
  width: 96px;
  height: 4px;
  background: rgba(255, 255, 255, 0.8);    /* explicit red — --color-primary is black in this theme */
  position: absolute;
  top: 0;
  left: 0;
  animation: newsletter-bar 1s linear infinite alternate;
}

@keyframes newsletter-bar {
  0%   { left: 0;    transform: translateX(-1%); }
  100% { left: 100%; transform: translateX(-99%); }
}

.newsletter-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-xl);
}

.newsletter-text h3 {
  font-size: 1.5rem;
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-sm);
  color: var(--color-white);
}

.newsletter-text p {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0;
}

.newsletter-form {
  display: flex;
  gap: var(--spacing-sm);
  min-width: 400px;
}

.newsletter-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  font-size: var(--font-size-base);
  border-radius: 0;
  transition: all var(--transition-fast);
}

.newsletter-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.newsletter-input:focus {
  border-color: var(--color-white);
  background-color: rgba(255, 255, 255, 0.15);
  outline: none;
}

.newsletter-btn {
  padding: 12px 24px;
  background-color: var(--color-white);
  color: var(--color-primary);
  border: none;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.newsletter-btn:hover {
  background-color: var(--color-accent);
  color: var(--color-white);
}

.newsletter-success {
  display: none;
  align-items: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-white);
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.newsletter-success.visible,
.newsletter-error.visible {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.newsletter-success i {
  font-size: 1.4rem;
  color: #6ee79e;
}

/* Error message */
.newsletter-error {
  display: none;
  align-items: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-white);
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.newsletter-error i {
  font-size: 1.4rem;
  color: #f87171;
}

/* Main Footer */
.footer-main {
  padding: var(--spacing-xxxl) 0;
}

.footer-columns {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--spacing-xxl);
}

.footer-column h4 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  margin-bottom: var(--spacing-lg);
  color: var(--color-white);
  letter-spacing: 0.5px;
}

.footer-column p {
  font-size: var(--font-size-sm);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--spacing-md);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: var(--spacing-sm);
}

.footer-links a {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color var(--transition-fast);
  display: inline-block;
}

.footer-links a:hover {
  color: var(--color-white);
  transform: translateX(4px);
}

/* Social Links */
.footer-social {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: var(--color-white);
  text-decoration: none;
  transition: all var(--transition-base);
}

.social-link:hover {
  background-color: var(--color-white);
  color: var(--color-primary);
  border-color: var(--color-white);
  transform: translateY(-2px);
}

.social-link i {
  font-size: 18px;
}

/* Features/Benefits Section */
.footer-features {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--spacing-xl) 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-xl);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.feature-icon {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon img,
.feature-icon svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.feature-text h5 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 2px;
  color: var(--color-white);
}

.feature-text p {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

/* Bottom Footer */
.footer-bottom {
  background-color: rgba(0, 0, 0, 0.3);
  padding: var(--spacing-lg) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-lg);
}

.footer-copyright {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.7);
}

.footer-credit {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  margin: 0;
}

.footer-credit a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-credit a:hover {
  color: var(--color-white);
}

.footer-credit strong {
  color: rgba(255, 255, 255, 0.7);
}

.footer-legal-links {
  display: flex;
  gap: var(--spacing-lg);
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-legal-links a {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-legal-links a:hover {
  color: var(--color-white);
}

.payment-methods {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.payment-icon {
  height: 24px;
  width: auto;
  font-size: 1.65rem;
  line-height: 1;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.payment-icon:hover {
  opacity: 1;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 992px) {
  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
  }
  
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
  }
  
  .newsletter-content {
    flex-direction: column;
    text-align: center;
  }
  
  .newsletter-form {
    min-width: 100%;
    max-width: 500px;
  }
}

@media (max-width: 768px) {
  .footer-columns {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-md);
  }
  
  .footer-legal-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .payment-methods {
    justify-content: center;
  }
  
  .footer-newsletter {
    padding: var(--spacing-xl) 0;
  }
  
  .footer-main {
    padding: var(--spacing-xl) 0;
  }
}

@media (max-width: 576px) {
  .newsletter-form {
    flex-direction: column;
  }
  
  .newsletter-btn {
    width: 100%;
  }
  
  .footer-social {
    justify-content: center;
  }
  
  .feature-item {
    flex-direction: column;
    text-align: center;
  }
}