/* ==========================================================================
   Perfect Bearing - Clean Industrial Design System
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Nuetral Palette (Light Mode) */
  --bg-body: #ffffff;
  --bg-surface: #f8f9fa;
  --bg-surface-hover: #e9ecef;

  --text-primary: #111827;
  /* Near Black */
  --text-secondary: #4b5563;
  /* Dark Gray */
  --text-muted: #9ca3af;

  --border-color: #d1d5db;
  /* Darker border for visibility */

  /* Brand Accent */
  --accent-color: #f97316;
  /* Industrial Orange */
  --accent-hover: #ea580c;

  /* Dimensions & Spacing */
  --container-width: 1200px;
  --header-height: 70px;
  --strip-height: 36px;
  --radius: 6px;

  /* Shadows (Minimal) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05);

  --transition: all 0.2s ease;
}

[data-theme="dark"] {
  --bg-body: #0f1115;
  --bg-surface: #181b21;
  --bg-surface-hover: #22262e;
  /* Brand Strip Dark Mode */
  --bg-strip: #ffffff;
  /* Logos likely need white bg if they are not transparent, or just keep strip white always */

  --text-primary: #f3f4f6;
  --text-secondary: #d1d5db;
  --text-muted: #6b7280;

  --border-color: #2d3139;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
  /* Offset for sticky header */
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   Brand Strip (Marquee)
   ========================================================================== */
.brand-strip {
  /* position: fixed; removed to allow scrolling */
  width: 100%;
  height: var(--strip-height);
  background: var(--bg-body);
  /* Matches theme */
  z-index: 1002;
  /* Above Header */
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
  /* Use var */
  display: flex;
  align-items: center;
}

.brand-track {
  display: flex;
  align-items: center;
  animation: scroll 40s linear infinite;
  white-space: nowrap;
  gap: 40px;
  padding: 0 20px;
}

.brand-track img {
  height: 24px;
  /* Fit within 36px strip */
  width: auto;
  object-fit: contain;
  /* Grayscale for subtle look, hover for color? User said "visible", let's keep color */
  mix-blend-mode: multiply;
  /* If logos have white bg */
}

/* Dark Mode Logo Handling */
[data-theme="dark"] .brand-track img {
  filter: invert(1);
  mix-blend-mode: screen;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* ==========================================================================
   Header & Navigation (Minimal)
   ========================================================================== */
.header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.8);
  /* Translucent */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  /* Softer border */
  position: sticky;
  /* Sticky to stick after strip scrolls */
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: var(--transition);
}

[data-theme="dark"] .header {
  background: rgba(15, 17, 21, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ... (brand/nav styles unchanged) ... */

/* ==========================================================================
   Catalog / Grid
   ========================================================================== */
.section {
  padding: 60px 0 60px;
  /* Standard padding, no longer clearing fixed header */
}

/* ==========================================================================
   Contact Section
   ========================================================================== */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Boxed Contact Items */
.contact-item {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  /* Curve Box */
  transition: var(--transition);
}

.contact-item:hover {
  border-color: var(--accent-color);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  background: var(--bg-body);
}

.contact-item i {
  color: var(--accent-color);
  margin-top: 4px;
  font-size: 1.2rem;
}

.contact-item h4 {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 1rem;
}

.contact-item p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.4;
}

.brand {
  font-size: 1.4rem;
  /* Increased from 1.25rem */
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand i {
  color: var(--accent-color);
}

.nav-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-link {
  font-size: 1.1rem;
  /* Increased from 0.95rem */
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-color);
}

/* Tools (Search + Theme) */
.nav-tools {
  display: flex;
  align-items: center;
  gap: 15px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* Search Bar (Compact) */
.search-wrapper {
  position: relative;
}

.search-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-primary);
  width: 200px;
  outline: none;
  transition: width 0.3s;
}

.search-input::placeholder {
  color: #6b7280;
  /* Neutral darker gray for better visibility */
  opacity: 1;
}

@media (max-width: 480px) {
  .search-input {
    width: 120px;
    /* Smaller on mobile */
    font-size: 0.85rem;
  }
}

.search-input:focus {
  border-color: var(--accent-color);
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-top: 5px;
  box-shadow: var(--shadow-md);
  display: none;
  max-height: 200px;
  overflow-y: auto;
}

.autocomplete-list li {
  padding: 8px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
}

.autocomplete-list li:hover {
  background: var(--bg-surface);
  color: var(--accent-color);
}

/* Hamburger */
.hamburger {
  display: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1.2rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding: 160px 0;
  /* Increased further to 160px */
  /* margin-top removed for sticky header flow */
  background: var(--bg-surface);
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  /* Ensure video doesn't overflow */
}

.back-video {
  position: absolute;
  right: 0;
  bottom: 0;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: 0;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  /* Slightly darker for better white text contrast */
  z-index: 1;
}

/* Ensure content sits above video */
.hero-content {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: 2.8rem;
  /* Slightly smaller for 'zoom out' feel */
  font-weight: 800;
  margin-bottom: 10px;
  color: #ffffff;
  /* Force white text on video */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
  font-size: 1.35rem;
  /* Slightly smaller */
  color: #ffffff;
  /* Changed from Yellow to White */
  font-weight: 600;
  margin-bottom: 15px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.hero-desc {
  font-size: 1rem;
  /* Slightly smaller */
  color: #f3f4f6;
  max-width: 700px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent-color);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

/* ==========================================================================
   Catalog / Grid
   ========================================================================== */
.section {
  padding: 40px 0 60px;
  /* Reduced from 100px */
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.section-subtitle {
  color: var(--text-secondary);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* Forced 4 Columns */
  gap: 30px;
  /* Increased gap */
}

@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  /* Flex to stack content */
  flex-direction: column;
  height: 100%;
  /* Ensure equal height in row */
}

.card>a {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.card:hover {
  border-color: var(--accent-color);
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.card-img {
  width: 100%;
  height: 220px;
  /* Fixed height for image area */
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
  padding: 20px;
}

.card-img img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  /* Ensure image fits */
  transition: transform 0.3s;
}

.card:hover .card-img img {
  transform: scale(1.05);
  /* Subtle zoom */
}

.card-body {
  padding: 20px;
  flex-grow: 1;
  /* Pushes footer down if needed */
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 15px;
  flex-grow: 1;
  /* Fill space */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-color);
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.feature-box {
  background: var(--bg-surface);
  padding: 24px;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--border-color);
}

.feature-icon {
  margin-bottom: 15px;
  font-size: 1.5rem;
  color: var(--accent-color);
}

.feature-title {
  font-weight: 600;
  margin-bottom: 5px;
}

.feature-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Contact Section (Duplicate Removed)
   ========================================================================== */
/* Form Styles follow... */

/* Form */
.form-group {
  margin-bottom: 15px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 5px;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
  background: var(--bg-body);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 60px 0 20px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h3 {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.footer-col p,
.footer-col a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: block;
  margin-bottom: 10px;
}

.footer-col a:hover {
  color: var(--accent-color);
}

.copyright {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   Bearing Detail Page
   ========================================================================== */
.detail-layout {
  display: flex;
  gap: 40px;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 30px;
  align-items: flex-start;
}

.detail-img {
  flex: 1;
  background: #fff;
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  text-align: center;
}

.detail-info {
  flex: 1.5;
}

.detail-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}

.spec-table tr {
  border-bottom: 1px solid var(--border-color);
}

.spec-table th {
  text-align: left;
  padding: 12px 0;
  color: var(--text-secondary);
  font-weight: 500;
  width: 40%;
}

.spec-table td {
  padding: 12px 0;
  color: var(--text-primary);
  font-weight: 600;
}

.btn-whatsapp {
  background: #25d366;
  color: white;
  border-radius: var(--radius);
  padding: 12px 24px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-whatsapp:hover {
  background: #1ebc57;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .nav-menu.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-body);
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
  }

  .about-grid,
  .contact-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .detail-layout {
    flex-direction: column;
  }

  /* Mobile-specific adjustments */
  @media (max-width: 480px) {
    .nav-container {
      padding: 0 15px;
      /* Ensure padding on small screens */
    }

    .brand {
      font-size: 1rem;
      /* Smaller logo text */
      gap: 5px;
    }

    .brand i {
      font-size: 1.1rem;
    }

    /* Fix Header Elements Overflow */
    .nav-tools {
      gap: 8px;
      /* Tighter spacing */
    }

    .theme-toggle {
      width: 28px;
      height: 28px;
      font-size: 0.9rem;
    }

    .hamburger {
      font-size: 1.1rem;
      margin-left: 5px;
    }

    /* Fix Grid Spacing */
    /* Fix Grid Spacing for 2-Column Layout */
    .grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
      /* Tighter gap for mobile */
    }

    /* Compact Card Styles for Mobile */
    .card {
      border-radius: 8px;
      /* Slightly reduced radius */
    }

    .card-img {
      height: 120px;
      /* Reduced height */
      padding: 10px;
    }

    .card-body {
      padding: 10px;
    }

    .card-title {
      font-size: 0.95rem;
      margin-bottom: 5px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .card-desc {
      font-size: 0.8rem;
      margin-bottom: 8px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      /* Show only 2 lines */
      -webkit-box-orient: vertical;
      overflow: hidden;
      line-height: 1.3;
    }

    .card-link {
      font-size: 0.85rem;
    }

    .container {
      padding-left: 15px;
      padding-right: 15px;
      /* Ensure cards don't touch edges, protect vertical padding */
    }

    /* Ensure Section Content clears Fixed Header on Mobile */
    .section,
    .container.section {
      /* Padding resets handled naturally by sticky flow/global padding */
      padding-bottom: 40px;
    }

    /* Fix Back to Catalog Link */
    .section a[href*="index.html#bearings"] {
      display: inline-block;
      margin-left: 2px;
      /* Prevent cutting off on left */
    }
  }
}

/* Floating Buttons */
.float-btn {
  position: fixed;
  bottom: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  z-index: 999;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.float-wa {
  right: 20px;
  background: #25d366;
}

.float-top {
  right: 80px;
  background: var(--text-secondary);
  font-size: 1.2rem;
}

/* Scroll Animation */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}