/* COPIAL, S.L. - Modern Visual Design System */

:root {
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);

  /* Primary & Accent Palette (Blue & Industrial Cyan) */
  --color-brand-primary: #0284c7;
  --color-brand-primary-hover: #0369a1;
  --color-brand-secondary: #06b6d4;
  --color-brand-accent: #38bdf8;
  --color-brand-accent-glow: rgba(56, 189, 248, 0.35);

  /* Dark Theme Default Variables */
  --bg-main: #0b1329;
  --bg-surface: #111e38;
  --bg-surface-hover: #19294d;
  --bg-card: rgba(17, 30, 56, 0.75);
  --bg-card-border: rgba(56, 189, 248, 0.18);
  --bg-glass: rgba(15, 23, 42, 0.82);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --border-light: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(56, 189, 248, 0.3);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.25);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-border: rgba(2, 132, 199, 0.18);
  --bg-glass: rgba(255, 255, 255, 0.88);

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --border-light: rgba(0, 0, 0, 0.08);
  --border-accent: rgba(2, 132, 199, 0.3);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(2, 132, 199, 0.15);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
}

body {
  overflow-x: hidden;
  min-height: 100vh;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
}

a {
  color: inherit;
  text-decoration: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-surface-hover);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-main);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-brand-primary);
}

/* Glassmorphism Cards */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.glass-panel:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Header & Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: 0.85rem 2rem;
  transition: background-color var(--transition-normal);
}

.navbar-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  font-family: var(--font-display);
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--color-brand-primary), var(--color-brand-secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

.logo-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-brand-accent);
  display: block;
  margin-top: -4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style: none;
}

.nav-item {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  color: var(--color-brand-accent);
}

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-brand-primary), var(--color-brand-secondary));
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5);
  background: linear-gradient(135deg, var(--color-brand-primary-hover), var(--color-brand-primary));
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-accent);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-surface-hover);
  border-color: var(--color-brand-accent);
  color: var(--color-brand-accent);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.btn-icon:hover {
  background: var(--bg-surface-hover);
  color: var(--color-brand-accent);
}

/* Hero Section */
.hero-section {
  position: relative;
  padding: 5rem 2rem 4rem;
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-content h1 {
  font-size: 3.2rem;
  letter-spacing: -1px;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, #ffffff 30%, var(--color-brand-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .hero-content h1 {
  background: linear-gradient(135deg, #0f172a 30%, var(--color-brand-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 580px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-brand-accent);
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-brand-accent);
  font-family: var(--font-display);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-visual {
  position: relative;
}

.hero-image-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border: 1px solid var(--bg-card-border);
}

.hero-image-wrapper img {
  width: 100%;
  height: 440px;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-normal);
}

.hero-image-wrapper:hover img {
  transform: scale(1.03);
}

.hero-floating-card {
  position: absolute;
  bottom: -20px;
  left: -20px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  padding: 1.2rem 1.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-accent);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Catalog Filter Bar */
.section-title-wrapper {
  text-align: center;
  max-width: 750px;
  margin: 0 auto 3rem;
}

.section-tag {
  color: var(--color-brand-accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  display: block;
}

.section-title-wrapper h2 {
  font-size: 2.3rem;
  margin-bottom: 0.8rem;
}

.section-title-wrapper p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.catalog-controls {
  max-width: 1300px;
  margin: 0 auto 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search-box {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.9rem 1.2rem 0.9rem 3rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 1rem;
  transition: all var(--transition-fast);
  outline: none;
}

.search-input:focus {
  border-color: var(--color-brand-accent);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.pill-btn {
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-btn:hover,
.pill-btn.active {
  background: var(--color-brand-primary);
  color: #fff;
  border-color: var(--color-brand-primary);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

/* Products Grid */
.products-grid {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 2rem;
  padding: 0 2rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.product-card-image {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.product-card:hover .product-card-image img {
  transform: scale(1.06);
}

.product-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: var(--color-brand-accent);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border-accent);
}

.product-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-card-title {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}

.product-card-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  flex-grow: 1;
}

.product-specs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.spec-tag {
  font-size: 0.78rem;
  background: var(--bg-surface-hover);
  color: var(--text-main);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

/* Technical Specs & Fiber Tables */
.tech-guide-section {
  max-width: 1300px;
  margin: 6rem auto;
  padding: 0 2rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
}

.tech-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.tech-table th {
  background: var(--bg-surface);
  color: var(--color-brand-accent);
  font-family: var(--font-display);
  font-weight: 700;
  padding: 1rem 1.2rem;
  border-bottom: 2px solid var(--border-light);
  white-space: nowrap;
}

.tech-table td {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
}

.tech-table tbody tr {
  transition: background-color var(--transition-fast);
}

.tech-table tbody tr:hover {
  background-color: var(--bg-surface-hover);
}

.star-rating {
  color: #f59e0b;
  font-weight: bold;
}

/* Industry Solutions Matrix */
.industry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
}

.industry-card {
  padding: 1.4rem;
  text-align: center;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.industry-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  background: rgba(2, 132, 199, 0.15);
  color: var(--color-brand-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.4rem;
}

/* Calculator & Quote Wizard */
.calculator-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-top: 3rem;
  box-shadow: var(--shadow-lg);
}

.calc-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-control {
  padding: 0.75rem 1rem;
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  border-color: var(--color-brand-accent);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.25s ease-out;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  max-width: 750px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem;
  position: relative;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--color-brand-accent);
}

/* Footer */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  padding: 4rem 2rem 2rem;
  margin-top: 6rem;
}

.footer-container {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 1rem;
  max-width: 320px;
  font-size: 0.92rem;
}

.footer-col h4 {
  margin-bottom: 1.2rem;
  font-size: 1.05rem;
  color: var(--color-brand-accent);
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: var(--color-brand-accent);
}

.footer-bottom {
  max-width: 1300px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-subtitle {
    margin: 0 auto 2rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .footer-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .navbar-container {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .nav-links {
    display: none;
    /* Can toggle on mobile */
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .footer-container {
    grid-template-columns: 1fr;
  }
}