/* AULA Iran - Driver Downloads */
:root {
  --blue: #1877f2;
  --blue-dark: #0d5dbf;
  --blue-light: #e8f1fe;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #e5e5e5;
  --card-bg: #f2f2f2;
  --white: #fff;
  --footer-bg: #111;
  --radius: 35px;
  --radius-pill: 999px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --header-h: 72px;
  --sidebar-w: 280px;
  --font: "Vazirmatn", Tahoma, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  direction: rtl;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input {
  font-family: inherit;
}

.container {
  width: min(1280px, 100% - 32px);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}

.logo img {
  height: 42px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--blue);
}

.nav-link.active {
  position: relative;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 2px;
  right: 14px;
  left: 14px;
  height: 2px;
  background: var(--blue);
  border-radius: 2px;
}

.nav-item.has-dropdown:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: 0.2s ease;
  z-index: 50;
}

.dropdown a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.dropdown a:hover {
  background: var(--blue-light);
  color: var(--blue);
}

.header-search {
  position: relative;
  width: 200px;
}

.header-search input {
  width: 100%;
  padding: 10px 40px 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: #fafafa;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.header-search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.12);
}

.header-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #999;
  pointer-events: none;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  border-radius: 2px;
}

/* Main layout */
.driver-page {
  padding: 32px 0 64px;
}

.driver-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 32px;
  align-items: start;
}

/* Content */
.driver-content {
  min-width: 0;
}

.content-search {
  position: relative;
  margin-bottom: 28px;
}

.content-search input {
  width: 100%;
  padding: 16px 52px 16px 20px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--card-bg);
  font-size: 1rem;
  outline: none;
  transition: box-shadow 0.2s;
}

.content-search input:focus {
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.15);
}

.content-search svg {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #888;
  pointer-events: none;
}

.search-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.web-drive-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
}

.web-drive-badge.live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

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

.product-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  transition: transform 0.25s, box-shadow 0.25s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.product-card__img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100% - 48px);
  padding: 16px;
}

.product-card__img {
  max-height: 100%;
  object-fit: contain;
}

.product-card__name {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  padding: 12px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  background: linear-gradient(transparent, rgba(242, 242, 242, 0.95));
}

.product-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.92);
  opacity: 0;
  transition: opacity 0.25s;
  padding: 16px;
}

.product-card:hover .product-card__overlay {
  opacity: 1;
}

.product-card__overlay h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.product-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 8px 18px;
  border: 1.5px solid var(--text);
  border-radius: var(--radius-pill);
  background: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-pill--web {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-pill--web:hover {
  background: var(--blue);
  color: var(--white);
}

.btn-pill--primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.btn-pill--primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 32px;
}

.pagination button {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--text);
}

.pagination button.active {
  background: var(--text);
  color: var(--white);
  border-color: var(--text);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Sidebar */
.driver-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.sidebar-nav {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.sidebar-nav h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 700;
}

.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-list button {
  width: 100%;
  text-align: right;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
}

.category-list button:hover {
  background: var(--blue-light);
  color: var(--blue);
}

.category-list button.active {
  background: var(--blue);
  color: var(--white);
}

.contact-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.contact-box h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 700;
}

.contact-item {
  margin-bottom: 16px;
}

.contact-item dt {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 4px;
}

.contact-item dd {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.contact-item a {
  color: var(--blue);
}

.contact-box .btn-contact {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  text-align: center;
  background: var(--blue);
  color: var(--white);
  border-radius: var(--radius-pill);
  font-weight: 600;
  transition: background 0.2s;
}

.contact-box .btn-contact:hover {
  background: var(--blue-dark);
}

/* CTA Section */
.cta-section {
  background: #fafafa;
  padding: 56px 0;
  text-align: center;
}

.cta-section h2 {
  margin: 0 0 24px;
  color: var(--blue);
  font-size: 1.5rem;
  font-weight: 700;
}

.subscribe-form {
  display: flex;
  max-width: 560px;
  margin: 0 auto 40px;
  background: var(--card-bg);
  border-radius: var(--radius-pill);
  overflow: hidden;
  padding: 4px;
}

.subscribe-form input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 20px;
  font-size: 0.95rem;
  outline: none;
}

.subscribe-form button {
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-pill);
  background: #333;
  color: var(--white);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.subscribe-form button:hover {
  background: #111;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.quick-link__icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: 50%;
  box-shadow: var(--shadow);
}

.quick-link__icon svg {
  width: 28px;
  height: 28px;
  color: var(--text);
}

.quick-link span {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.quick-link .btn-pill {
  background: #333;
  color: var(--white);
  border-color: #333;
}

.quick-link .btn-pill:hover {
  background: #111;
}

/* Footer */
.site-footer {
  background: var(--footer-bg);
  color: #ccc;
  padding: 56px 0 24px;
}

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

.footer-brand img {
  height: 48px;
  margin-bottom: 16px;
  filter: brightness(0) invert(1);
}

.footer-brand p {
  font-size: 0.875rem;
  line-height: 1.8;
  color: #999;
}

.footer-col h3 {
  color: var(--white);
  font-size: 0.95rem;
  margin: 0 0 16px;
  font-weight: 700;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  font-size: 0.875rem;
  color: #999;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 24px;
  text-align: center;
  font-size: 0.8rem;
  color: #666;
}

/* States */
.loading-state,
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1100px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

@media (max-width: 900px) {
  .driver-layout {
    grid-template-columns: 1fr;
  }

  .driver-sidebar {
    position: static;
    order: -1;
  }

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

  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    right: 0;
    left: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav.open {
    display: flex;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
  }

  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0 16px 8px;
  }

  .menu-toggle {
    display: block;
  }

  .header-search {
    display: none;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}
