/* Import Modern Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* CSS Custom Properties / Design Tokens */
:root {
  /* Color Palette */
  --primary: hsl(22, 75%, 48%);       /* Terracotta / Burnt Orange */
  --primary-light: hsl(22, 85%, 95%);
  --primary-medium: hsl(22, 75%, 65%);
  --secondary: #1e3a8a;               /* Deep Tyrrhenian Blue */
  --secondary-light: hsl(224, 75%, 95%);
  --accent: hsl(152, 60%, 33%);       /* Sardinian Olive / Forest Green */
  --accent-light: hsl(152, 60%, 94%);
  
  /* Neutral Palette */
  --bg-primary: hsl(30, 30%, 98%);    /* Soft warm cream background */
  --bg-secondary: #ffffff;
  --bg-dark: #0f172a;                 /* Slate 900 for dark footer/hero */
  --text-dark: #0f172a;
  --text-medium: #475569;
  --text-light: #94a3b8;
  --text-white: #ffffff;
  
  /* Borders and Shadows */
  --border-color: hsl(210, 20%, 90%);
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Layout */
  --max-width: 1280px;
  --header-height: 80px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--secondary);
}

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

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

ul {
  list-style: none;
}

/* Utility Classes */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.py-12 { padding-top: 48px; padding-bottom: 48px; }
.py-20 { padding-top: 80px; padding-bottom: 80px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: var(--border-radius-sm);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

.btn-primary:hover {
  background-color: hsl(22, 75%, 42%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.3);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--text-white);
}

.btn-secondary:hover {
  background-color: hsl(224, 75%, 20%);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--secondary);
  color: var(--secondary);
}

.btn-outline:hover {
  background-color: var(--secondary);
  color: var(--text-white);
  transform: translateY(-2px);
}

/* Header Styling */
.site-header {
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-normal);
}

.site-header.scrolled {
  height: 70px;
  box-shadow: var(--shadow-sm);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--secondary);
  letter-spacing: -0.5px;
}

.logo-text span {
  color: var(--primary);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-medium);
  position: relative;
  padding: 8px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: var(--transition-fast);
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: var(--secondary);
  font-weight: 600;
}

/* Mobile Nav Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1100;
}

.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--secondary);
  margin: 5px 0;
  transition: var(--transition-normal);
}

/* Main Layout Spacer */
main {
  margin-top: var(--header-height);
  flex-grow: 1;
}

/* Hero Section */
.hero {
  position: relative;
  background: linear-gradient(135deg, hsl(224, 70%, 15%) 0%, hsl(224, 80%, 8%) 100%);
  color: var(--text-white);
  padding: 100px 0 140px 0;
  overflow: hidden;
  text-align: center;
}

.hero-bg-shapes::before,
.hero-bg-shapes::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  z-index: 1;
}

.hero-bg-shapes::before {
  width: 400px;
  height: 400px;
  background-color: var(--primary);
  top: -100px;
  right: -100px;
}

.hero-bg-shapes::after {
  width: 500px;
  height: 500px;
  background-color: var(--secondary);
  bottom: -200px;
  left: -200px;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.hero-tagline {
  font-family: 'Outfit', sans-serif;
  color: var(--primary-medium);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: inline-block;
  background: rgba(245, 158, 11, 0.1);
  padding: 6px 16px;
  border-radius: 50px;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-white);
  margin-bottom: 24px;
  line-height: 1.15;
}

.hero-desc {
  font-size: 1.2rem;
  color: var(--text-white);
  opacity: 0.85;
  margin-bottom: 40px;
  font-weight: 300;
}

/* Card Grid on Homepage */
.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.section-desc {
  color: var(--text-medium);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 48px auto;
}

.search-filters {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}

.search-bar {
  width: 100%;
  max-width: 500px;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 16px 24px 16px 48px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: var(--transition-normal);
}

.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

.search-bar::before {
  content: '🔍';
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  opacity: 0.5;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.filter-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 8px 20px;
  border-radius: 50px;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.filter-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary-medium);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  color: var(--text-white);
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.25);
}

.coop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 32px;
  margin-top: 24px;
}

.coop-card {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.coop-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--secondary);
  transition: var(--transition-normal);
}

.coop-card:hover::before {
  background: var(--primary);
}

.coop-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(245, 158, 11, 0.2);
}

.coop-card-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.coop-card-logo-container {
  width: 70px;
  height: 70px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  padding: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.coop-card-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.coop-card-title-group {
  display: flex;
  flex-direction: column;
}

.coop-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
}

.coop-card-sector {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--text-light);
  margin-top: 2px;
}

.coop-card-desc {
  color: var(--text-medium);
  font-size: 0.95rem;
  margin-bottom: 24px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.coop-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-top: auto;
}

.coop-card-motto {
  font-style: italic;
  font-size: 0.8rem;
  color: var(--text-light);
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coop-card-link {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.coop-card-link::after {
  content: '→';
  transition: var(--transition-fast);
}

.coop-card:hover .coop-card-link::after {
  transform: translateX(4px);
}

/* Network Stats Section */
.stats-section {
  background: var(--secondary);
  color: var(--text-white);
  padding: 80px 0;
  position: relative;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

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

.stat-num {
  font-family: 'Outfit', sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--primary-medium);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.85;
}

/* Individual Cooperative Page Styling */
.coop-hero {
  position: relative;
  background: linear-gradient(135deg, hsl(205, 85%, 20%) 0%, hsl(205, 85%, 10%) 100%);
  color: var(--text-white);
  padding: 80px 0 100px 0;
  overflow: hidden;
}

.coop-hero-container {
  display: flex;
  align-items: center;
  gap: 40px;
  position: relative;
  z-index: 2;
}

.coop-hero-logo {
  width: 140px;
  height: 140px;
  border-radius: var(--border-radius-md);
  padding: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.coop-hero-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.coop-hero-info {
  display: flex;
  flex-direction: column;
}

.coop-badge {
  display: inline-block;
  background: var(--primary);
  color: var(--text-white);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: fit-content;
  margin-bottom: 12px;
}

.coop-hero-title {
  font-size: 3rem;
  color: #fff;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.coop-hero-motto {
  font-size: 1.25rem;
  font-style: italic;
  opacity: 0.9;
  font-weight: 300;
  border-left: 3px solid var(--primary);
  padding-left: 16px;
  margin-top: 8px;
}

/* Detail Page Content */
.coop-main-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
  padding: 60px 0;
}

.coop-detail-card {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-md);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 32px;
}

.coop-detail-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 24px;
  position: relative;
  padding-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.coop-detail-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--primary);
}

.coop-paragraph {
  color: var(--text-medium);
  font-size: 1.05rem;
  margin-bottom: 20px;
  white-space: pre-wrap;
}

/* Services styling */
.services-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.service-card {
  background: var(--bg-primary);
  padding: 24px;
  border-radius: var(--border-radius-sm);
  border-left: 4px solid var(--secondary);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.service-card:hover {
  transform: translateX(4px);
  border-left-color: var(--primary);
}

.service-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 8px;
}

.service-desc {
  color: var(--text-medium);
  font-size: 0.95rem;
}

/* Sidebar Contacts Card */
.sidebar-card {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  position: sticky;
  top: 100px;
}

.sidebar-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.contact-icon {
  background: var(--primary-light);
  color: var(--primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 700;
}

.contact-value {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.contact-form-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-medium);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* Footer Styling */
.site-footer {
  background-color: var(--bg-dark);
  color: var(--text-white);
  padding: 60px 0 30px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.footer-logo span {
  color: var(--primary);
}

.footer-desc {
  opacity: 0.75;
  margin-bottom: 24px;
  max-width: 400px;
}

.footer-title {
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  position: relative;
}

.footer-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--primary);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  opacity: 0.75;
}

.footer-links a:hover {
  opacity: 1;
  color: var(--primary-medium);
  transform: translateX(4px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0.75;
  font-size: 0.8rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Responsive Rules */
@media (max-width: 1024px) {
  .coop-main-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .sidebar-card {
    position: static;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 70px;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .section-title {
    font-size: 1.75rem;
  }
  
  .coop-hero-container {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  
  .coop-hero-logo {
    width: 120px;
    height: 120px;
  }
  
  .coop-hero-title {
    font-size: 2rem;
  }
  
  .coop-hero-motto {
    border-left: none;
    border-top: 2px solid var(--primary);
    padding-left: 0;
    padding-top: 12px;
  }
  
  /* Mobile Navigation Hamburger Menu */
  .mobile-toggle {
    display: block;
  }
  
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    justify-content: center;
    gap: 40px;
    padding: 40px;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-top: 1px solid var(--border-color);
  }
  
  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-link {
    font-size: 1.25rem;
  }
  
  /* Hamburger State */
  .mobile-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .mobile-toggle.open span:nth-child(2) {
    opacity: 0;
  }
  .mobile-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .coop-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-title {
    font-size: 2rem;
  }
}
