/* Base overrides and helpers */
:root {
  --brand-primary: #007bff;
  --brand-success: #28a745;
  --brand-warning: #ffc107;
  --brand-danger: #dc3545;
}

body { 
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background-color: #f8f9fa;
  line-height: 1.6;
}

.navbar-brand { 
  letter-spacing: .5px; 
  text-decoration: none !important;
}

.card { 
  border-radius: .75rem;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Hero Slider */
.hero-slider {
  position: relative;
}

.hero-slide {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  position: relative;
}

.hero-slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
}

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

.hero-indicator {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0,0,0,0.5);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
}

/* Product Cards */
.product-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #e9ecef;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-card .card-img-top {
  height: 180px;
  object-fit: contain;
  padding: 20px;
  background: #fff;
}

.product-card .price {
  font-weight: 700;
}

/* Feature Cards */
.feature-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
}

.feature-icon {
  background: #f8f9fa;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* Brand Logos */
.brand-logo {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  border: 1px solid #e9ecef;
}

.brand-logo:hover {
  transform: scale(1.05);
  border-color: var(--brand-primary);
}

/* Header Styles */
.bg-primary {
  background-color: var(--brand-primary) !important;
}

/* Sticky Header System - Clean Solution */
.header-top {
  position: sticky;
  top: 0;
  z-index: 1030;
}

/* Header and Navbar Container - Stick Together */
.sticky-header-container {
  position: sticky;
  top: 0px; /* Below top header */
  z-index: 1025;
}

header.bg-white {
  border-bottom: none;
  background-color: white !important;
  position: relative; /* Remove individual sticky */
}

/* Navigation - part of sticky container */
.navbar {
  position: relative; /* Remove individual sticky */
  z-index: 1024;
  background-color: white !important;
  border-bottom: 1px solid #e9ecef;
  margin-top: -1px; /* Remove gap between header and navbar */
}

/* Dropdown Menu z-index fix */
.dropdown-menu {
  z-index: 1040 !important; /* Higher than all header elements */
}

/* User dropdown button should have proper positioning context */
.dropdown {
  position: relative;
  z-index: 1041; /* Ensure dropdown button is above navbar */
}

/* Mobile navbar collapse z-index fix */
.navbar-collapse {
  z-index: 1035; /* Above navbar but below dropdowns */
}

/* Navbar toggler should be clickable */
.navbar-toggler {
  z-index: 1042; /* Above everything for mobile menu button */
}

/* Navigation */
.navbar-nav .nav-link {
  font-weight: 600;
  padding: 12px 16px !important;
  transition: color 0.2s ease;
}

.navbar-nav .nav-link:hover {
  color: var(--brand-primary) !important;
}

/* Buttons */
.btn {
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 20px;
  transition: all 0.2s ease;
}

.btn-success {
  background-color: var(--brand-success);
  border-color: var(--brand-success);
}

.btn-success:hover {
  background-color: #218838;
  border-color: #1e7e34;
  transform: translateY(-1px);
}

.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-primary:hover {
  background-color: #0056b3;
  border-color: #004085;
  transform: translateY(-1px);
}

/* Search Box */
.form-control-lg {
  border-radius: 25px;
  padding: 12px 20px;
  border: 2px solid #e9ecef;
  transition: border-color 0.2s ease;
}

.form-control-lg:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Carousel */
.carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 4px;
}

.carousel-control-prev,
.carousel-control-next {
  width: 5%;
}

/* Tyre Product Cards - Ultra Compact Design */
.tyre-product-card {
  border: 1px solid #e9ecef;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  max-height: 380px; /* Further reduced height */
}

.tyre-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.brand-logo-container {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 10;
}

.brand-logo {
  background: rgba(255,255,255,0.95);
  color: #333;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: bold;
}

.brand-logo-img {
  background: rgba(255,255,255,0.95);
  padding: 3px 5px;
  border-radius: 4px;
  max-width: 60px;
  max-height: 20px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: brightness(1.1) contrast(1.1);
}

.product-image-container {
  position: relative;
  height: 140px; /* Further reduced height */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
}

.product-image {
  max-width: 100%;
  max-height: 120px; /* Further reduced image size */
  object-fit: contain;
}

.product-title {
  color: #333;
  font-size: 13px; /* Smaller font */
  line-height: 1.2;
}

.product-specs {
  color: #333;
  font-size: 11px; /* Smaller specs */
}

.production-year {
  color: #6c757d;
  font-size: 10px; /* Smaller production year */
}

.rating .stars {
  font-size: 11px; /* Smaller stars */
}

.rating small {
  font-size: 9px; /* Smaller rating text */
}

.energy-labels {
  display: flex;
  justify-content: center;
  gap: 2px;
  flex-wrap: wrap;
}

.energy-badge {
  display: inline-block;
  padding: 1px 3px; /* Tighter padding */
  border-radius: 2px;
  font-size: 8px; /* Smaller badge font */
  font-weight: bold;
  color: white;
  min-width: 14px; /* Smaller min-width */
  text-align: center;
}

.energy-badge.energy-a {
  background-color: #28a745;
}

.energy-badge.energy-noise {
  background-color: #007bff;
}

.energy-badge.energy-db {
  background-color: #6c757d;
}

.stock-info {
  font-size: 10px; /* Smaller stock info */
}

.price-section .price {
  color: #333;
  font-size: 15px; /* Smaller price */
}

.cart-section .btn-success {
  background-color: #28a745;
  border-color: #28a745;
  font-weight: 600;
  padding: 4px 8px; /* Smaller padding */
  font-size: 11px; /* Smaller button text */
}

.cart-section .form-select-sm {
  font-size: 10px; /* Smaller select font */
  padding: 2px 4px; /* Tighter padding */
}

/* Ultra compact spacing for tyre cards */
.tyre-product-card .card-body {
  padding: 10px !important; /* Further reduced padding */
}

.tyre-product-card .mb-2 {
  margin-bottom: 4px !important; /* Tighter margins */
}

.tyre-product-card .mb-3 {
  margin-bottom: 6px !important; /* Tighter margins */
}

/* Home Page Product Cards - Ultra Compact Design */
.home-product-card {
  border: 1px solid #e9ecef;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  max-height: 380px; /* Further reduced height */
}

.home-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.home-product-card .brand-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 10;
}

.home-product-card .brand-name {
  background: rgba(255,255,255,0.95);
  color: #333;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: bold;
  text-shadow: none;
}

.home-product-card .brand-logo-img {
  background: rgba(255,255,255,0.95);
  padding: 3px 5px;
  border-radius: 4px;
  max-width: 50px;
  max-height: 18px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: brightness(1.1) contrast(1.1);
}

/* Brand Slider Styles */
.brand-slider-wrapper {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.brand-slider {
  display: inline-block;
}

.brand-slide-track {
  display: inline-flex;
  animation: slide 30s linear infinite;
  gap: 2rem;
}

.brand-slide-track:hover {
  animation-play-state: paused;
}

.brand-slide-item {
  display: inline-block;
  flex-shrink: 0;
}

.brand-card {
  background: white;
  padding: 1.5rem 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
}

.brand-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.brand-slider-logo {
  max-width: 120px;
  max-height: 50px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: brightness(0.8) contrast(1.2);
  transition: filter 0.3s ease;
}

.brand-card:hover .brand-slider-logo {
  filter: brightness(1) contrast(1.3);
}

.brand-name-fallback {
  font-weight: 600;
  font-size: 14px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@keyframes slide {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .brand-slide-track {
    gap: 1rem;
  }
  
  .brand-card {
    padding: 1rem 1.5rem;
    min-width: 120px;
    height: 70px;
  }
  
  .brand-slider-logo {
    max-width: 100px;
    max-height: 40px;
  }
}

/* Modern Tyre Card Styles */
.modern-tyre-card {
  border-radius: 16px;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.modern-tyre-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Season Badge */
.season-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
}

.season-icon {
  background: rgba(255,255,255,0.95);
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: inline-block;
}

.season-summer { background: rgba(255, 193, 7, 0.15) !important; }
.season-winter { background: rgba(13, 202, 240, 0.15) !important; }
.season-all { background: rgba(25, 135, 84, 0.15) !important; }

/* SVG Season Icon */
.season-svg-icon {
  width: 16px;
  height: 16px;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

/* Other Sellers Section */
.other-sellers-content .table {
  font-size: 14px;
}

.other-sellers-content .seller-avatar {
  flex-shrink: 0;
}

.other-sellers-content .price-current {
  font-size: 16px;
  line-height: 1.2;
}

.other-sellers-content .price-diff {
  margin-top: 2px;
  font-weight: 500;
}

.other-sellers-content .table tbody tr:hover {
  background-color: rgba(0, 123, 255, 0.05);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.other-sellers-content .badge {
  font-size: 11px;
  font-weight: 500;
}

.other-sellers-content .btn-sm {
  font-size: 12px;
  padding: 0.25rem 0.5rem;
}

.other-sellers-content .card {
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.other-sellers-content .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .season-svg-icon {
    width: 14px;
    height: 14px;
  }
}

/* Modern Product Image */
.modern-product-image-container {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  position: relative;
  overflow: hidden;
}

.modern-product-image {
  max-width: 85%;
  max-height: 85%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.modern-tyre-card:hover .modern-product-image {
  transform: scale(1.05);
}

/* Modern Card Body */
.modern-card-body {
  background: white;
  text-align: center;
}

.product-specs-modern .tyre-size {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  background: #f8f9fa;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

.brand-model-info .model-name {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  line-height: 1.3;
  margin-bottom: 2px;
}

.brand-model-info .brand-code {
  font-size: 12px;
  line-height: 1.2;
}

.brand-name-blue {
  color: #0066cc;
  font-weight: 600;
}

.model-code {
  color: #666;
  font-weight: 400;
}

.price-section-modern .price-modern {
  font-size: 18px;
  font-weight: 700;
  color: #333;
}

.sellers-info {
  color: #666;
  font-size: 11px;
}

/* Modern Buttons */
.modern-btn-outline {
  background: white;
  border: 1px solid #e9ecef;
  color: #666;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.modern-btn-outline:hover {
  background: #f8f9fa;
  border-color: #dee2e6;
  color: #495057;
  transform: translateY(-1px);
}

.modern-btn-primary {
  background: #ff8c00;
  border: 1px solid #ff8c00;
  color: white;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.modern-btn-primary:hover {
  background: #ff7a00;
  border-color: #ff7a00;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
}

.modern-btn-primary:disabled {
  background: #ccc;
  border-color: #ccc;
  color: #666;
}

.modern-buttons .btn {
  font-size: 12px;
  padding: 8px 12px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .modern-product-image-container {
    height: 140px;
  }
  
  .modern-card-body {
    padding: 1rem !important;
  }
  
  .product-specs-modern .tyre-size {
    font-size: 12px;
  }
  
  .brand-model-info .model-name {
    font-size: 12px;
  }
  
  .price-section-modern .price-modern {
    font-size: 16px;
  }
  
  .modern-buttons .btn {
    font-size: 11px;
    padding: 6px 8px;
  }
  
  .season-icon {
    font-size: 14px;
    padding: 4px 6px;
  }
}


.home-product-card .product-image-wrapper {
  height: 140px; /* Further reduced height */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  position: relative;
}

.home-product-card .product-image {
  max-width: 100%;
  max-height: 120px; /* Further reduced image size */
  object-fit: contain;
}

.home-product-card .product-title {
  color: #333;
  font-size: 13px; /* Smaller font */
  line-height: 1.2;
}

.home-product-card .product-specs {
  color: #333;
  font-size: 11px; /* Smaller specs */
}

.home-product-card .production-info {
  color: #6c757d;
  font-size: 10px; /* Smaller production info */
}

.home-product-card .rating-section .stars {
  font-size: 11px; /* Smaller stars */
}

.home-product-card .rating-section small {
  font-size: 9px; /* Smaller rating text */
}

.home-product-card .energy-labels {
  display: flex;
  justify-content: center;
  gap: 2px;
  flex-wrap: wrap;
}

.home-product-card .energy-badge {
  display: inline-block;
  padding: 1px 3px; /* Tighter padding */
  border-radius: 2px;
  font-size: 8px; /* Smaller badge font */
  font-weight: bold;
  min-width: 14px; /* Smaller min-width */
  text-align: center;
}

.home-product-card .stock-info {
  font-size: 10px; /* Smaller stock info */
}

.home-product-card .price-section .price {
  color: #333;
  font-size: 15px; /* Smaller price font */
}

.home-product-card .cart-actions .btn-success {
  background-color: #28a745;
  border-color: #28a745;
  font-weight: 600;
  padding: 4px 8px; /* Smaller padding */
  font-size: 11px; /* Smaller button text */
}

.home-product-card .form-select-sm {
  font-size: 10px; /* Smaller select font */
  padding: 2px 4px; /* Tighter padding */
}

/* Ultra compact spacing */
.home-product-card .card-body {
  padding: 10px !important; /* Further reduced padding */
}

.home-product-card .mb-2 {
  margin-bottom: 4px !important; /* Tighter margins */
}

.home-product-card .mb-3 {
  margin-bottom: 6px !important; /* Tighter margins */
}

/* Sticky Sidebar */
.filters-sidebar.sticky-top {
  top: 142px; /* Top header (42px) + Header+Navbar container height (approx 100px) */
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-slide {
    height: 300px !important;
  }
  
  .hero-slide h1 {
    font-size: 2rem !important;
  }
  
  .feature-card {
    margin-bottom: 2rem;
  }
  
  .product-card .card-img-top {
    height: 150px;
  }
  
  .brand-logo {
    height: 50px;
  }
  
  /* Home page cards mobile adjustments */
  .home-product-card {
    max-height: 340px; /* Even smaller on mobile */
  }
  
  .home-product-card .product-image-wrapper {
    height: 120px; /* Smaller image area */
  }
  
  .home-product-card .product-image {
    max-height: 100px; /* Smaller image */
  }
  
  .home-product-card .product-title {
    font-size: 12px; /* Smaller title */
  }
  
  .home-product-card .product-specs {
    font-size: 10px; /* Smaller specs */
  }
  
  .home-product-card .price-section .price {
    font-size: 14px; /* Smaller price */
  }
  
  .home-product-card .card-body {
    padding: 8px !important; /* Even smaller padding */
  }
  
  /* Tyre page cards mobile adjustments */
  .tyre-product-card {
    max-height: 340px; /* Even smaller on mobile */
  }
  
  .tyre-product-card .product-image-container {
    height: 120px; /* Smaller image area */
  }
  
  .tyre-product-card .product-image {
    max-height: 100px; /* Smaller image */
  }
  
  .tyre-product-card .product-title {
    font-size: 12px; /* Smaller title */
  }
  
  .tyre-product-card .product-specs {
    font-size: 10px; /* Smaller specs */
  }
  
  .tyre-product-card .price-section .price {
    font-size: 14px; /* Smaller price */
  }
  
  .tyre-product-card .card-body {
    padding: 8px !important; /* Even smaller padding */
  }
  
  /* Sticky header adjustments for mobile */
  .header-top {
    display: none; /* Hide top header on mobile */
  }
  
  .sticky-header-container {
    top: 0; /* Header container starts from top on mobile */
  }
  
  /* Ensure dropdowns work properly on mobile too */
  .dropdown-menu {
    z-index: 1040 !important;
  }
  
  .dropdown {
    z-index: 1041 !important;
  }
  
  .filters-sidebar.sticky-top {
    top: 120px; /* Header container height on mobile */
  }
}

@media (max-width: 576px) {
  .hero-slide {
    height: 250px !important;
  }
  
  .hero-slide h1 {
    font-size: 1.5rem !important;
  }
  
  .hero-slide p {
    font-size: 0.9rem;
  }
  
  .btn-lg {
    padding: 8px 16px;
    font-size: 1rem;
  }
  
  .feature-icon {
    width: 60px;
    height: 60px;
  }
  
  .feature-icon i {
    font-size: 2rem !important;
  }
  
  /* Extra small mobile header improvements */
  .navbar-brand {
    font-size: 1.3rem !important;
  }
  
  /* Hide cart text completely on very small screens */
  .d-none.d-lg-block {
    display: none !important;
  }
  
  /* Compact user dropdown */
  .dropdown-toggle {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }
  
  .dropdown-toggle .badge {
    font-size: 0.6rem;
  }
  
  /* Compact cart badge */
  .cart-badge-header {
    font-size: 0.6rem !important;
  }
  
  /* Mobile search improvements */
  .d-lg-none input.form-control {
    font-size: 16px; /* Prevent zoom on iOS */
  }
}
