/* ============================================
   KHERRATA WORK — Responsive + Mobile Menu
   ============================================ */

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.45rem;
  width: 42px;
  height: 42px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  z-index: 1002;
  border-radius: 10px;
  transition: background 0.2s;
}

.menu-toggle:hover {
  background: var(--light, #f8fafc);
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--dark, #0f172a);
  border-radius: 2px;
  transition: all 0.28s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 92vw);
  height: 100%;
  height: 100dvh;
  background: #fff;
  box-shadow: -12px 0 40px rgba(15, 23, 42, 0.14);
  z-index: 1001;
  padding: 0;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.15rem;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}

.mobile-menu-title {
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
}

.mobile-menu-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 0.75rem 0.85rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.mobile-menu-list li.mobile-sep {
  height: 1px;
  background: #e2e8f0;
  margin: 0.65rem 0.35rem;
  padding: 0;
  border: none;
}

.mobile-link {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.9rem 1rem !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  border-radius: 12px !important;
  text-align: right;
  background: transparent !important;
  border: none !important;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
  box-sizing: border-box;
}

.mobile-link:hover,
.mobile-link:active {
  background: #f1f5f9 !important;
  color: #2563eb !important;
}

.mobile-link-primary {
  background: #2563eb !important;
  color: #fff !important;
  justify-content: center !important;
  font-weight: 600 !important;
  margin-top: 0.25rem;
}

.mobile-link-primary:hover {
  background: #1d4ed8 !important;
  color: #fff !important;
}

.mobile-link-outline {
  border: 1.5px solid #2563eb !important;
  color: #2563eb !important;
  justify-content: center !important;
  font-weight: 600 !important;
}

.mobile-link-danger {
  color: #dc2626 !important;
  justify-content: center !important;
}

.mobile-link-danger:hover {
  background: #fef2f2 !important;
  color: #b91c1c !important;
}

.mobile-user {
  padding: 0.35rem 1rem 0.55rem !important;
}

.mobile-user-name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
}

.mobile-menu .messages-badge {
  margin-inline-start: 0.4rem;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.25s;
  backdrop-filter: blur(3px);
}

.mobile-overlay.show {
  display: block;
  opacity: 1;
}

@media (max-width: 900px) {
  .auctions-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.1rem;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    display: none !important;
  }

  .mobile-menu {
    display: block;
  }

  .hero {
    padding: 3.25rem 0 2.75rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 0.95rem;
    margin-bottom: 1.4rem;
  }

  .section {
    padding: 2.25rem 0;
  }

  .section-title {
    font-size: 1.15rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.15rem;
  }

  .auctions-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
  }

  .auction-card .image-wrapper {
    height: 140px;
  }

  .auction-card .content {
    padding: 0.85rem;
  }

  .auction-card .title {
    font-size: 0.88rem;
    min-height: 2.4em;
  }

  .auction-card .price {
    font-size: 1.05rem;
  }

  .auction-card .meta {
    font-size: 0.72rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .container {
    padding: 0 1rem;
  }

  .categories {
    gap: 0.4rem;
    margin-bottom: 1.15rem;
  }

  .category-btn {
    padding: 0.42rem 0.85rem;
    font-size: 0.82rem;
  }

  .auth-card {
    padding: 1.75rem 1.25rem;
  }

  .footer {
    padding: 2.25rem 0 1.25rem;
    margin-top: 1.5rem;
  }

  .footer-grid {
    gap: 1.5rem;
  }

  .search-bar {
    flex-direction: column;
  }

  .search-bar input,
  .search-bar .btn {
    width: 100%;
  }

  .filters-row {
    flex-direction: column;
    align-items: stretch !important;
  }

  .filters-row select {
    width: 100%;
  }

  .listing-detail {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .form-row {
    grid-template-columns: 1fr !important;
  }

  .comment-form {
    flex-direction: column;
  }

  .comment-form .btn {
    width: 100%;
  }
}

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

  .auction-card .image-wrapper {
    height: 200px;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
    max-width: 280px;
    margin: 0 auto;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  .logo {
    font-size: 1.05rem;
  }
}
