/* ============ SHOPPING REDESIGN - CSS MODERNO E PROFISSIONAL ============ */

/* ============ 1. HERO SEARCH SECTION ============ */
.nm-hero-search {
  background: linear-gradient(135deg, #00b7b8, #2980b9);
  padding: 40px 24px;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.nm-hero-search::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.nm-hero-search::after {
  content: '';
  position: absolute;
  bottom: -50%;
  left: -5%;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite reverse;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-search-form {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  border-radius: 12px;
  overflow: hidden;
}

.hero-search-form input {
  box-shadow: none !important;
  transition: all 0.3s ease;
}

.hero-search-form input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,183,184,0.1) !important;
}

.hero-search-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2) !important;
}

.hero-categories a {
  transition: all 0.3s ease;
}

.hero-categories a:hover {
  background: rgba(255,255,255,0.25) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ============ 2. ANIMAÇÕES ============ */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(30px);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0,183,184,0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(0,183,184,0);
  }
}

/* ============ 3. ACTIVE FILTERS BAR ============ */
.nm-active-filters {
  animation: fadeInUp 0.4s ease;
}

.filter-pill {
  animation: slideInFromLeft 0.3s ease forwards;
  transition: all 0.3s ease;
}

.filter-pill:hover {
  background: #e6f7ff;
  transform: translateY(-2px);
}

.filter-pill a:hover {
  transform: scale(1.2);
}

/* ============ 4. TOOLBAR ============ */
.nm-toolbar {
  animation: fadeInUp 0.4s ease 0.1s backwards;
}

#sortSelect {
  transition: all 0.3s ease;
  cursor: pointer;
}

#sortSelect:hover,
#sortSelect:focus {
  border-color: #00b7b8;
  box-shadow: 0 0 0 3px rgba(0,183,184,0.1);
  outline: none;
}

/* ============ 5. FILTERS SIDEBAR ============ */
.nm-filters-sidebar {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  height: fit-content;
  position: sticky;
  top: calc(var(--hdr) + 20px);
  animation: slideInFromLeft 0.4s ease 0.2s backwards;
}

.filter-sidebar-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
}

.filter-sidebar-header i {
  animation: pulse 2s infinite;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group label {
  font-weight: 700;
  color: #1a202c;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  font-size: 13px;
  color: #1a202c;
  transition: all 0.3s ease;
  cursor: pointer;
}

.filter-group select:hover,
.filter-group select:focus,
.filter-group input:hover,
.filter-group input:focus {
  border-color: #00b7b8;
  box-shadow: 0 0 0 3px rgba(0,183,184,0.1);
  outline: none;
}

.filter-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2300b7b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
  padding-right: 40px;
}

/* ============ 6. VEHICLE CARDS ============ */
.nm-vehicle-card {
  animation: fadeInUp 0.4s ease;
  transition: all 0.3s ease;
}

.nm-vehicle-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.nm-carousel-container {
  position: relative;
  background: #f8f9fa;
  overflow: hidden;
}

.nm-carousel-track {
  display: flex;
  transition: transform 0.3s ease;
  height: 100%;
}

.nm-carousel-track img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
}

.carousel-btn {
  opacity: 0;
  transition: all 0.3s ease;
}

.nm-carousel-container:hover .carousel-btn {
  opacity: 1;
}

.carousel-btn:hover {
  background: rgba(0,0,0,0.7) !important;
  transform: translateY(-50%) scale(1.1);
}

.carousel-dot {
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot:hover {
  transform: scale(1.3);
}

.favorite-btn {
  transition: all 0.3s ease;
}

.favorite-btn:hover {
  transform: scale(1.1);
  background: rgba(0,183,184,0.1) !important;
}

.favorite-btn.active {
  color: #f56565;
}

.favorite-btn.active i {
  animation: pulse 0.6s ease;
}

/* ============ 7. CARD CONTENT ============ */
.nm-vehicle-card > div:last-child {
  padding: 14px;
}

.nm-vehicle-card a[href*="Ver Detalhes"],
.nm-vehicle-card button[type="submit"] {
  transition: all 0.3s ease;
}

.nm-vehicle-card a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,183,184,0.3);
}

/* ============ 8. PAGINATION ============ */
.nm-pagination {
  animation: fadeInUp 0.5s ease;
}

.nm-pagination a,
.nm-pagination button {
  transition: all 0.3s ease;
}

.nm-pagination a:hover {
  border-color: #00b7b8;
  color: #00b7b8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,183,184,0.1);
}

/* ============ 9. RESPONSIVE DESIGN ============ */

/* Tablet: 1024px - 768px */
@media (max-width: 1024px) {
  .nm-shopping-layout {
    grid-template-columns: 280px 1fr;
    gap: 16px;
  }

  .nm-filters-sidebar {
    position: sticky;
    top: calc(var(--hdr) + 16px);
  }

  .nm-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
  }
}

/* Small tablets: 768px */
@media (max-width: 768px) {
  .nm-shopping-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .nm-filters-sidebar {
    position: relative;
    top: auto;
    margin-bottom: 16px;
    order: 2;
  }

  .nm-shopping-content {
    order: 1;
  }

  .nm-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .nm-hero-search {
    padding: 32px 20px;
  }

  .nm-hero-search h1 {
    font-size: 24px !important;
  }

  .hero-search-form {
    flex-direction: column;
  }

  .hero-search-form input,
  .hero-search-form button {
    width: 100%;
  }

  .filter-sidebar-header {
    font-size: 13px;
  }

  .nm-toolbar {
    flex-direction: column;
  }

  .nm-toolbar > div:last-child {
    width: 100%;
  }

  .nm-toolbar select {
    width: 100%;
  }
}

/* Mobile: < 480px */
@media (max-width: 480px) {
  .container {
    padding: 0 12px !important;
  }

  .nm-hero-search {
    padding: 24px 16px;
    margin-top: 12px;
  }

  .nm-hero-search h1 {
    font-size: 20px !important;
    margin-bottom: 16px !important;
  }

  .hero-search-form {
    flex-direction: column;
  }

  .hero-search-form input,
  .hero-search-form button {
    width: 100%;
  }

  .hero-categories {
    margin-top: 12px !important;
  }

  .nm-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .nm-vehicle-card {
    display: grid;
    grid-template-columns: 120px 1fr;
  }

  .nm-carousel-container {
    aspect-ratio: auto;
    height: 120px;
  }

  .nm-vehicle-card > div:last-child {
    padding: 10px;
    font-size: 12px;
  }

  .carousel-btn {
    display: none !important;
  }

  .carousel-dot {
    width: 6px !important;
    height: 6px !important;
  }

  .nm-active-filters {
    padding: 10px 12px !important;
    gap: 8px !important;
  }

  .filter-pill {
    font-size: 12px !important;
    padding: 4px 8px !important;
  }

  .nm-toolbar {
    padding: 12px !important;
    font-size: 12px;
  }

  .nm-toolbar label {
    display: none;
  }

  .nm-toolbar select {
    padding: 6px 8px !important;
    font-size: 12px !important;
  }

  .nm-filters-sidebar {
    padding: 16px;
  }

  .nm-pagination a,
  .nm-pagination button {
    padding: 6px 10px !important;
    font-size: 12px;
  }
}

/* ============ 10. QUICK VIEW BUTTON ============ */
.quickview-btn {
  opacity: 0;
  transition: all 0.3s ease;
}

.nm-carousel-container:hover .quickview-btn {
  opacity: 1;
}

.quickview-btn:hover {
  background: white !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

/* ============ 11. FILTER LOADING STATE ============ */
.filter-group.loading {
  position: relative;
}

.filter-group.loading select {
  opacity: 0.6;
  pointer-events: none;
}

.filter-group.loading::after {
  content: '';
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 16px;
  height: 16px;
  border: 2px solid #e2e8f0;
  border-top-color: #00b7b8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============ 12. UTILITY CLASSES ============ */

/* Hover effects */
.nm-vehicle-card:active {
  transform: translateY(-4px);
}

/* Loading states */
.nm-carousel-container.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Focus states for accessibility */
.nm-vehicle-card:focus-within {
  outline: 2px solid #00b7b8;
  outline-offset: 2px;
}

/* ============ 13. ACCESSIBILITY ============ */

/* Focus visible states */
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid #00b7b8;
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ 14. RESPONSIVE ADDITIONS ============ */

/* Mobile: Quick view button always visible on touch devices */
@media (hover: none) {
  .quickview-btn {
    opacity: 1 !important;
  }

  .carousel-btn {
    opacity: 0.7 !important;
    width: 28px !important;
    height: 28px !important;
  }

  .nm-mobile-filter-btn {
    display: flex !important;
  }
}

/* Mobile card horizontal layout */
@media (max-width: 480px) {
  .nm-vehicle-card {
    display: grid;
    grid-template-columns: 130px 1fr;
  }

  .nm-carousel-container {
    aspect-ratio: auto;
    height: 100%;
    min-height: 140px;
  }

  .nm-vehicle-card > div:last-child {
    padding: 10px;
    font-size: 12px;
  }

  .carousel-btn {
    display: none !important;
  }

  .carousel-dots {
    display: none !important;
  }

  .quickview-btn {
    display: none !important;
  }

  .nm-active-filters {
    padding: 10px 12px !important;
    gap: 6px !important;
  }

  .filter-pill {
    font-size: 11px !important;
    padding: 4px 8px !important;
  }

  .nm-toolbar {
    padding: 10px 12px !important;
    font-size: 12px;
  }

  .nm-toolbar label {
    display: none;
  }

  .nm-toolbar select {
    padding: 6px 8px !important;
    font-size: 12px !important;
  }

  .nm-pagination a,
  .nm-pagination button {
    padding: 6px 10px !important;
    font-size: 12px;
  }

  /* Pagination bottom spacing for mobile filter button */
  .nm-pagination {
    padding-bottom: 60px !important;
  }
}

/* Print styles */
@media print {
  .nm-hero-search,
  .nm-toolbar,
  .nm-filters-sidebar,
  .nm-pagination,
  .nm-mobile-filter-btn,
  .nm-mobile-filter-overlay,
  .nm-quickview-overlay {
    display: none !important;
  }

  .nm-shopping-layout {
    grid-template-columns: 1fr !important;
  }

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

  .nm-vehicle-card {
    page-break-inside: avoid;
  }
}

/* ============ 15. PRICE RANGE INPUTS ============ */
.price-range-wrapper {
  width: 100%;
}

.price-range-inputs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.price-range-inputs input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  font-size: 13px;
  color: #1a202c;
  transition: all 0.3s ease;
  cursor: pointer;
  box-sizing: border-box;
}

.price-range-inputs input:hover,
.price-range-inputs input:focus {
  border-color: #00b7b8;
  box-shadow: 0 0 0 3px rgba(0,183,184,0.1);
  outline: none;
}

.price-range-inputs span {
  display: none;
}
