html {
  font-size: 14px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  line-height: 1.6;
}

/* Navbar Styles */
.navbar-light .navbar-brand {
  transition: color 0.3s ease;
}

.navbar-light .navbar-brand:hover {
  color: #0056b3 !important;
}

.navbar-light .navbar-nav .nav-link {
  color: #333;
  transition: color 0.3s ease, transform 0.2s ease;
  padding: 0.5rem 1rem;
}

.navbar-light .navbar-nav .nav-link:hover {
  color: #0056b3;
  transform: translateY(-2px);
}

.navbar-light .navbar-nav .nav-link.active {
  color: #0056b3;
  font-weight: 600;
}

.sticky-top {
  transition: box-shadow 0.3s ease;
}

/* Card Hover Effects */
.hover-lift {
  transition: all 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-10px);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

.category-card:hover {
  border-color: #0056b3 !important;
}

.category-card img {
  transition: transform 0.3s ease;
}

.category-card:hover img {
  transform: scale(1.05);
}

/* Product Card Styles */
.product-card {
  height: 100%;
}

.product-card .card {
  transition: all 0.3s ease;
  border-radius: 12px;
  overflow: hidden;
}

.product-card:hover .card {
  transform: translateY(-8px);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

.product-image-wrapper {
  position: relative;
  overflow: hidden;
  background: #f8f9fa;
}

.product-image-wrapper img {
  transition: transform 0.5s ease;
  object-fit: cover;
}

.product-card:hover .product-image-wrapper img {
  transform: scale(1.1);
}

.add-to-cart,
.add-to-favorites {
  transition: all 0.3s ease;
}

.add-to-cart:hover {
  transform: scale(1.05);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.add-to-favorites:hover {
  transform: scale(1.1);
}

.add-to-favorites:hover i {
  color: #dc3545 !important;
}

/* Carousel Styles */
.carousel-item {
  transition: opacity 0.6s ease-in-out;
}

.carousel-fade .carousel-item {
  opacity: 0;
  transition-duration: 0.6s;
  transition-property: opacity;
}

.carousel-fade .carousel-item.active,
.carousel-fade .carousel-item-next.carousel-item-start,
.carousel-fade .carousel-item-prev.carousel-item-end {
  opacity: 1;
}

.carousel-fade .active.carousel-item-start,
.carousel-fade .active.carousel-item-end {
  opacity: 0;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 3rem;
  height: 3rem;
  background-size: 100%;
}

/* Button Styles */
.btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: #0056b3;
  border-color: #0056b3;
}

.btn-primary:hover {
  background-color: #004494;
  border-color: #004494;
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 86, 179, 0.3);
}

.btn-outline-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 86, 179, 0.2);
}

.btn-outline-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(220, 53, 69, 0.2);
}

.rounded-pill {
  border-radius: 50rem !important;
}

/* Badge Styles */
.badge {
  font-weight: 500;
  padding: 0.35em 0.65em;
}

.bg-success-subtle {
  background-color: #d4edda !important;
}

.bg-danger-subtle {
  background-color: #f8d7da !important;
}

/* Footer Styles */
footer a:hover {
  color: #fff !important;
  text-decoration: underline !important;
}

.social-links a {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.social-links a:hover {
  transform: translateY(-3px);
  background-color: #0056b3 !important;
  border-color: #0056b3 !important;
}

/* Back to Top Button */
#backToTop {
  width: 50px;
  height: 50px;
  transition: all 0.3s ease;
  opacity: 0.7;
}

#backToTop:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Section Spacing */
section {
  padding: 4rem 0;
}

@media (max-width: 768px) {
  section {
    padding: 2rem 0;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Top Header Bar */
.top-header {
  font-size: 0.875rem;
}

.top-header a {
  transition: opacity 0.3s ease;
}

.top-header a:hover {
  opacity: 0.8;
}

/* Search Form */
.position-relative input[type="search"] {
  border-radius: 20px;
  padding-right: 2.5rem;
}

.position-relative button[type="submit"] {
  border: none;
  background: transparent;
  color: #6c757d;
}

.position-relative button[type="submit"]:hover {
  color: #0056b3;
}

/* Loading Spinner */
.spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Utility Classes */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.object-fit-cover {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* Focus Styles */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #0056b3;
  outline: none;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background-color: #fff;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  }

  .carousel-control-prev-icon,
  .carousel-control-next-icon {
    width: 2rem;
    height: 2rem;
  }
}

@media (max-width: 575.98px) {
  .display-3 {
    font-size: 2rem;
  }

  .display-4 {
    font-size: 1.75rem;
  }

  .fs-4 {
    font-size: 1rem !important;
  }

  .fs-5 {
    font-size: 0.875rem !important;
  }
}

/* Print Styles */
@media print {
  .navbar,
  .top-header,
  footer,
  #backToTop {
    display: none !important;
  }
}

/* Performance Optimizations */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
}

/* Accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Category Icon Styles */
.category-icon-card {
  width: 140px;
  height: 140px;
  padding: 15px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.category-icon-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

.category-icon-wrapper {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.category-icon-card:hover .category-icon-wrapper {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.category-icon-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.category-icon-card:hover .category-icon-img {
  transform: scale(1.1);
  filter: brightness(0) invert(1);
}

.category-icon-placeholder {
  font-size: 40px;
  color: #6c757d;
  transition: color 0.3s ease;
}

.category-icon-card:hover .category-icon-placeholder {
  color: white;
}

.category-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-top: 8px;
  transition: color 0.3s ease;
  text-align: center;
  line-height: 1.3;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-icon-card:hover .category-name {
  color: #667eea;
}
