/* Google Fonts Import */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

:root {
  --font-primary: "Poppins", sans-serif;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-bg-light: #f8f9fa;
  --color-white: #ffffff;
  --color-dark: #1a1a1a;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: all 0.3s ease;
}

/* Global Reset & Base */
body {
  font-family: var(--font-primary);
  color: var(--color-text);
  background-color: var(--color-bg-light);
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  transition: var(--transition);
  text-decoration: none;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* === Utility Classes === */
.section-padding {
  padding: 80px 0;
}

.text-theme {
  color: var(--theme-color);
}

.bg-theme {
  background-color: var(--theme-color);
}

.bg-black {
  background-color: #000 !important;
}

.top-bar {
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-bar i {
  color: var(--theme-color);
}

.btn-theme {
  background-color: hsl(0, 0%, 5%);
  color: hsl(0, 0%, 95%);
  border: none;
  padding: 10px 24px;
  border-radius: 50px;
  font-weight: 500;
  transition: var(--transition);
}

.btn-theme:hover {
  background-color: #333;
  color: #fff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--color-dark);
}

.section-header p {
  color: var(--color-text-light);
  font-size: 1.1rem;
}

/* === Navbar === */
.navbar-custom {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  padding: 15px 0;
  transition: var(--transition);
}

.navbar-brand img {
  height: 45px;
}

.nav-link {
  color: var(--color-dark) !important;
  font-weight: 500;
  margin: 0 10px;
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--theme-color);
  transition: var(--transition);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-icons .icon-btn {
  position: relative;
  color: var(--color-dark);
  font-size: 1.2rem;
  margin-left: 20px;
  transition: var(--transition);
}

.nav-icons .icon-btn:hover {
  color: var(--theme-color);
}

.badge {
  position: absolute;
  top: -5px;
  right: -8px;
  background-color: #ff0000;
  color: #fff;
  border-radius: 50%;
  padding: 3px 6px;
  font-size: 0.7rem;
}

.nav-icons .badge {
  position: absolute;
  top: -5px;
  right: -8px;
  background-color: #ff0000;
  color: #fff;
  border-radius: 50%;
  padding: 3px 6px;
  font-size: 0.7rem;
}

/* Mobile Navbar Optimization */
@media (max-width: 991px) {
  .navbar-custom {
    padding: 10px 0;
  }

  .navbar-brand img {
    height: 40px;
  }

  .navbar-toggler {
    border: none;
    box-shadow: none;
    padding: 0 5px;
    font-size: 1.3rem;
  }

  .navbar-toggler:focus {
    box-shadow: none;
    outline: none;
  }

  /* Hide search on small mobile */
  .navbar-collapse .d-flex {
    margin: 15px 0 !important;
  }

  .navbar-collapse .form-control {
    font-size: 0.9rem;
    height: 38px;
  }

  .nav-link {
    margin: 8px 0;
    padding: 8px 0;
    text-align: center;
  }

  .nav-link::after {
    display: none;
  }

  .navbar-nav {
    text-align: center;
  }

  .nav-icons {
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
  }

  .nav-icons .icon-btn {
    margin-left: 0;
    font-size: 1.1rem;
  }
}

@media (max-width: 576px) {
  .navbar-custom {
    padding: 8px 0;
  }

  .navbar-brand img {
    height: 35px;
  }

  .container {
    padding: 0 10px;
  }

  .navbar-collapse {
    background: white;
    margin-top: 10px;
    border-radius: 8px;
    padding: 15px 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .navbar-collapse .d-flex {
    margin: 10px 0 !important;
    max-width: 100% !important;
    width: 100%;
  }

  .navbar-collapse .form-control {
    font-size: 0.85rem;
    padding: 8px 12px;
    height: 36px;
  }

  .navbar-collapse .btn {
    padding: 0 8px;
    font-size: 0.9rem;
  }

  .nav-link {
    font-size: 0.95rem;
    padding: 10px 0;
    margin: 0;
  }

  .nav-icons {
    gap: 12px;
    margin-top: 12px;
  }

  .nav-icons .icon-btn {
    font-size: 1rem;
  }

  .nav-icons .badge {
    font-size: 0.6rem;
    padding: 2px 4px;
  }
}

/* === Hero Slider === */
.slider-section {
  position: relative;
  overflow: hidden;
}

.slider-item {
  position: relative;
  height: 600px;
  width: 100%;
}

.slider-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slider-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
  display: flex;
  align-items: center;
}

.slider-content {
  color: #fff;
  max-width: 600px;
}

.slider-content h1 {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  animation: fadeInUp 0.8s ease forwards;
}

.slider-content p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.9;
  animation: fadeInUp 1s ease forwards;
}

/* === Services / Features === */
.features-section {
  margin-top: -50px;
  position: relative;
  z-index: 10;
}

.feature-box {
  background: #fff;
  padding: 30px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: var(--transition);
  height: 100%;
}

.feature-box:hover {
  transform: translateY(-10px);
}

.feature-icon {
  font-size: 2.5rem;
  color: var(--theme-color);
  margin-bottom: 15px;
}

.feature-title {
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

/* === Categories === */
.category-card {
  display: block;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 300px;
}

.category-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.category-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: #fff;
}

.category-card:hover .category-img {
  transform: scale(1.1);
}

/* === Product Card === */
.product-card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  position: relative;
  border: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.product-thumb {
  position: relative;
  height: 280px;
  overflow: hidden;
  background-color: #f5f5f5;
  flex-shrink: 0;
  margin: 10px;
  border-radius: var(--radius-md);
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.8s cubic-bezier(0.2, 0, 0.2, 1);
}

.product-card:hover .product-img {
  transform: scale(1.1);
}

.wishlist-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 35px;
  height: 35px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  z-index: 5;
}

.wishlist-btn:hover {
  background: #fff;
  color: #ff3366;
  transform: scale(1.1);
}

.thumb-indicators {
  position: absolute;
  bottom: 15px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 6px;
  opacity: 0.8;
}

.thumb-indicators .dot {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transition: var(--transition);
}

.thumb-indicators .dot.active {
  background: #fff;
  width: 12px;
  border-radius: 10px;
}

.product-details {
  padding: 15px 20px 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-brand {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 2px;
}

.rating-badge {
  background: #f0fdf9;
  color: #2e7d32;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.rating-badge i {
  font-size: 0.7rem;
  color: #2e7d32;
}

.product-title {
  font-size: 0.9rem;
  font-weight: 400;
  margin-bottom: 10px;
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
  color: #666;
}

.product-title a {
  color: #666;
}

.product-pricing {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.current-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
}

.old-price {
  font-size: 0.9rem;
  color: #aaa;
  text-decoration: line-through;
}

.discount-tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: #ff9800;
}

.btn-add-cart {
  display: block;
  width: 100%;
  padding: 12px;
  background: hsl(0, 0%, 10%);
  color: #fff;
  text-align: center;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  border: none;
  box-shadow: 0 4px 15px hsla(0, 0%, 50%, 0.3);
}

.btn-add-cart:hover {
  background: hsl(0, 0%, 30%);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px hsla(0, 0%, 30%, 0.3);
}

.product-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.btn-view-product {
  flex: 1;
  display: inline-block;
  text-align: center;
  padding: 10px 12px;
  background: hsl(0, 0%, 10%);
  color: #fff;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: 0 4px 15px hsla(0, 0%, 50%, 0.3);
}

.btn-view-product:hover {
  background: hsl(0, 0%, 30%);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px hsla(0, 0%, 30%, 0.3);
}

.btn-cart-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background-color: var(--color-white);
  border: 2px solid hsl(0, 0%, 10%);
  color: hsl(0, 0%, 10%);
  font-size: 0.95rem;
  text-decoration: none;
  transition: var(--transition);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.btn-cart-circle:hover {
  background: hsl(0, 0%, 10%);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px hsla(0, 0%, 50%, 0.3);
}

/* Mobile Optimization */
@media (max-width: 576px) {
  .product-thumb {
    height: 200px;
    margin: 8px;
  }

  .product-details {
    padding: 10px 15px 15px;
  }

  .product-brand {
    font-size: 0.9rem;
  }

  .current-price {
    font-size: 1.1rem;
  }

  .btn-add-cart,
  .btn-view-product {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .btn-cart-circle {
    width: 34px;
    height: 34px;
    min-width: 34px;
    font-size: 0.85rem;
  }
}

/* === Vendor / Shop Card === */
.vendor-card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.vendor-card:hover {
  box-shadow: var(--shadow-md);
}
.vendor-banner {
  height: 120px;
  background-color: #eee;
}
.vendor-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vendor-info {
  padding: 60px 20px 20px;
  text-align: center;
  position: relative;
}
.vendor-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
}
.vendor-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.vendor-status {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
}
.vendor-status.online {
  background-color: #28a745;
}
.vendor-status.offline {
  background-color: #dc3545;
}

/* === Footer === */
.footer-dark {
  background-color: #111;
  color: #bbb;
  padding-top: 80px;
  padding-bottom: 40px;
}
.footer-dark h5 {
  color: #fff;
  margin-bottom: 25px;
  font-weight: 600;
}
.footer-links li {
  margin-bottom: 12px;
}
.footer-links a {
  color: #bbb;
  transition: 0.3s;
}
.footer-links a:hover {
  color: var(--theme-color);
  padding-left: 5px;
}
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 50%;
  margin-right: 10px;
  transition: 0.3s;
}
.social-links a:hover {
  background: var(--theme-color);
}

/* === Responsive === */
@media (max-width: 991px) {
  .slider-item {
    height: 400px;
  }
  .slider-content h1 {
    font-size: 2.5rem;
  }
  .hero-features {
    margin-top: 30px;
  }
}
@media (max-width: 768px) {
  .slider-item {
    height: 350px;
  }
  .slider-content h1 {
    font-size: 2rem;
  }
  .section-padding {
    padding: 50px 0;
  }
}

/* === Custom Owl Navigation & Dots === */
.slider-carousel .owl-nav,
.product-carousel .owl-nav {
  margin-top: 0;
}

.owl-theme .owl-nav [class*="owl-"] {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--color-dark) !important;
  border-radius: 50% !important;
  margin: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  font-size: 20px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

/* Specific positioning for prev/next with entry animation */
.owl-theme .owl-nav .owl-prev {
  left: -30px;
}
.owl-theme .owl-nav .owl-next {
  right: -30px;
}

/* On Carousel Hover, show arrows and move them to their final position */
.owl-carousel:hover .owl-nav [class*="owl-"] {
  opacity: 1;
}
.owl-carousel:hover .owl-nav .owl-prev {
  left: 15px;
}
.owl-carousel:hover .owl-nav .owl-next {
  right: 15px;
}

/* Hover state for arrows */
.owl-theme .owl-nav [class*="owl-"]:hover {
  background: var(--theme-color) !important;
  color: #fff !important;
  transform: translateY(-50%) scale(1.15);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.2),
    0 0 15px
      hsla(var(--theme-h, 0), var(--theme-s, 0%), var(--theme-l, 20%), 0.3);
  border-color: rgba(255, 255, 255, 0.6) !important;
}

/* Slider Specific - Keep arrows visible but subtle */
.slider-carousel.owl-carousel .owl-nav [class*="owl-"] {
  background: rgba(255, 255, 255, 0.4) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}
.slider-carousel.owl-carousel .owl-nav .owl-prev {
  left: 40px;
  opacity: 0.8;
}
.slider-carousel.owl-carousel .owl-nav .owl-next {
  right: 40px;
  opacity: 0.8;
}
.slider-carousel.owl-carousel:hover .owl-nav [class*="owl-"] {
  opacity: 1;
  background: rgba(255, 255, 255, 0.8) !important;
}

.owl-theme .owl-dots {
  position: absolute;
  bottom: 30px;
  width: 100%;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  z-index: 10;
}

.owl-theme .owl-dots .owl-dot {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

.owl-theme .owl-dots .owl-dot span {
  width: 1.25em;
  height: 0.875em;
  background: hsl(0, 0%, 20%) !important;
  margin: 0 !important;
  border-radius: 10px;
  transition: all 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

/* Progress filling for Hero Slider dots */
.slider-carousel .owl-dots .owl-dot.active span {
  background: rgba(255, 255, 255, 0.2) !important;
  width: 50px !important;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.slider-carousel .owl-dots .owl-dot.active span::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: hsl(0, 0%, 20%) !important;
  border-radius: inherit;
  animation: dotFillProgress 5s linear forwards; /* Matches autoplayTimeout */
}

/* Progress filling for Product Carousel dots (if they have autoplay) */
.product-carousel .owl-dots .owl-dot.active span {
  background: #eee !important;
  width: 40px;
}

/* Visual Progress Bar at bottom of Hero Slider */
.slider-section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--theme-color);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 100;
  animation: sliderBarProgress 5s linear infinite;
  box-shadow: 0 0 10px var(--theme-color);
  opacity: 0.8;
}

@keyframes dotFillProgress {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}

@keyframes sliderBarProgress {
  0% {
    transform: scaleX(0);
    opacity: 1;
  }
  94% {
    transform: scaleX(1);
    opacity: 1;
  }
  98% {
    transform: scaleX(1);
    opacity: 0;
  }
  100% {
    transform: scaleX(0);
    opacity: 0;
  }
}

.owl-theme .owl-dots .owl-dot:hover span {
  background: rgba(255, 255, 255, 0.6) !important;
}

/* Product Carousel Dots (Darker Theme) */
.product-carousel .owl-dots {
  position: relative;
  bottom: 0;
  margin-top: 45px;
}

.product-carousel .owl-dots .owl-dot span {
  background: #d1d1d1 !important;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.product-carousel .owl-dots .owl-dot.active span {
  background: var(--color-dark, #1a1a1a) !important;
  width: 40px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.product-carousel .owl-dots .owl-dot:hover span {
  background: #999 !important;
}

/* Mobile Optimization for Nav */
@media (max-width: 768px) {
  .owl-theme .owl-nav [class*="owl-"] {
    width: 40px;
    height: 40px;
    font-size: 16px !important;
  }
  .owl-carousel:hover .owl-nav .owl-prev {
    left: 5px;
  }
  .owl-carousel:hover .owl-nav .owl-next {
    right: 5px;
  }

  .owl-theme .owl-dots .owl-dot.active span {
    width: 30px !important;
  }

  .slider-carousel .owl-dots .owl-dot.active span::after {
    animation-duration: 5s;
  }
}

/* Animation for dot change */
.owl-dot.active span {
  animation: dotPulse 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dotPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
