/* Modern Premium E-commerce Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #fbbf24;
  --bg-color: #f3f4f6;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --card-bg: rgba(255, 255, 255, 0.85);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, html {
  overflow-x: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex-grow: 1;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Glassmorphism Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 101;
}

.menu-toggle .bar {
  height: 3px;
  width: 100%;
  background-color: var(--primary);
  border-radius: 3px;
  transition: all 0.3s ease-in-out;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  transition: var(--transition);
  position: relative;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.btn {
  padding: 0.6rem 1.2rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: white;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.product-img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: white;
  padding: 1rem;
}

.product-info {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  font-weight: 700;
}

.product-category {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.price-container {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: auto;
  margin-bottom: 1rem;
}

.price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
}

.offer {
  color: #16a34a;
  font-weight: 600;
  font-size: 0.9rem;
  background: #dcfce7;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

/* Favorite Button */
.favorite-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #9ca3af;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.favorite-btn:hover {
  color: #ef4444;
  transform: scale(1.1);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.1);
}

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

.favorite-btn.active svg {
  fill: #ef4444;
}

/* Forms */
.auth-container {
  max-width: 400px;
  margin: 4rem auto;
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Admin Dashboard Layout */
.admin-layout {
  display: flex;
  gap: 2rem;
}

.admin-sidebar {
  width: 250px;
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  height: fit-content;
}

.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  color: var(--text-main);
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: var(--transition);
  font-weight: 600;
}

.admin-sidebar a:hover {
  background: var(--primary);
  color: white;
}

.admin-content {
  flex-grow: 1;
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th,
td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-muted);
}

.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Shop Listing Layout */
.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.shop-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.filter-sidebar {
  width: 260px;
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  flex-shrink: 0;
  position: sticky;
  top: 100px;
}

.filter-title {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group h4 {
  font-size: 1rem;
  margin-bottom: 0.8rem;
  color: var(--text-main);
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: var(--transition);
}

.filter-checkbox:hover {
  color: var(--primary);
}

.price-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.price-inputs .form-control {
  padding: 0.5rem;
  font-size: 0.9rem;
  width: 100%;
}

.price-separator {
  color: var(--text-muted);
}

/* Dual Range Slider */
.range-slider-container {
  position: relative;
  width: 100%;
  height: 6px;
  margin: 15px 0 25px 0;
  background-color: #e5e7eb;
  border-radius: 6px;
}
.slider-track {
  height: 100%;
  position: absolute;
  background-color: var(--primary);
  border-radius: 6px;
  z-index: 1;
}
.range-slider-container input[type="range"] {
  position: absolute;
  width: 100%;
  height: 6px;
  top: 0;
  left: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  outline: none;
  z-index: 2;
  margin: 0;
}
.range-slider-container input[type="range"]::-webkit-slider-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--primary);
  pointer-events: auto;
  -webkit-appearance: none;
  cursor: pointer;
  margin-top: -7px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.range-slider-container input[type="range"]::-moz-range-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--primary);
  pointer-events: auto;
  -moz-appearance: none;
  cursor: pointer;
  margin-top: -7px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.product-list-container {
  flex-grow: 1;
}

.mobile-only-btn {
  display: none !important;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  backdrop-filter: blur(2px);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  background: white;
  margin-top: auto;
  color: var(--text-muted);
}

/* Product Detail Page */
.detail-container {
  display: flex;
  gap: 3rem;
  background: white;
  border-radius: var(--border-radius);
  padding: 3rem;
  box-shadow: var(--shadow);
  margin-top: 2rem;
}

.detail-img {
  flex: 1;
  max-width: 400px;
}

.detail-img img {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.detail-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.detail-info h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.detail-info p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.desktop-thumbnails {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.mobile-thumbnails {
  display: none;
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* Image Carousel Banner */
.carousel-container {
  width: 100%;
  margin: 1.5rem 0;
  position: relative;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 1.5rem;
  padding: 0 1rem 1rem 1rem;
  /* Hide scrollbar */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-card {
  flex: 0 0 calc(100% - 2rem);
  height: 300px;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  scroll-snap-align: center;
  box-shadow: var(--shadow);
}

@media (min-width: 768px) {
  .carousel-card {
    flex: 0 0 95%;
  }
}

@media (min-width: 1024px) {
  .carousel-card {
    flex: 0 0 90%;
  }
}

.carousel-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.carousel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.1) 100%);
  z-index: 2;
}

.carousel-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2.5rem;
  z-index: 3;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.carousel-category {
  color: #fbbf24;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.carousel-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  line-height: 1.2;
}

.carousel-desc {
  font-size: 1.05rem;
  color: #e5e7eb;
  margin-bottom: 1.5rem;
  max-width: 90%;
}

.carousel-btn {
  background-color: #fbbf24;
  color: #000;
  padding: 0.7rem 1.5rem;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.carousel-btn:hover {
  background-color: #f59e0b;
  transform: translateY(-2px);
}

.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 1rem;
}

.carousel-indicators .dot {
  width: 25px;
  height: 4px;
  background-color: #e5e7eb;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.carousel-indicators .dot.active {
  background-color: #4b5563;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .carousel-card {
    height: 180px;
    border-radius: 12px;
  }

  .carousel-content {
    padding: 1.2rem;
  }

  .carousel-title {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
  }

  .carousel-desc {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .carousel-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .navbar {
    padding: 1rem 1.5rem;
  }

  .nav-header {
    width: 100%;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 250px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding-top: 5rem;
    padding-left: 2rem;
    padding-right: 2rem;
    gap: 1.5rem;
    transition: right 0.4s cubic-bezier(0.77, 0.2, 0.05, 1);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
  }

  .nav-links li {
    width: 100%;
    text-align: left;
  }

  .nav-links a {
    display: inline-block;
  }

  .nav-links.active {
    right: 0;
  }

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

  .menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
  }

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

  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1rem 0;
    gap: 1rem;
    width: 100%;
    margin-bottom: 1rem;
    overflow: visible;
  }

  .admin-sidebar::-webkit-scrollbar {
    display: none;
  }

  .admin-sidebar h3,
  .admin-sidebar br,
  .admin-sidebar hr {
    display: none;
  }

  .admin-sidebar a {
    display: inline-flex;
    margin-bottom: 0;
    padding: 0.6rem 1.2rem;
    background: #ffffff;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #6b7280;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
  }

  .admin-sidebar a i {
    color: #9ca3af;
    font-size: 1rem;
  }

  .admin-sidebar a:hover,
  .admin-sidebar a:active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.4);
    transform: translateY(-2px);
  }

  .admin-sidebar a:hover i,
  .admin-sidebar a:active i {
    color: #ffffff;
  }

  .dashboard-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .detail-container {
    flex-direction: column;
    padding: 1.5rem;
  }

  .detail-img {
    max-width: 100%;
  }

  .desktop-thumbnails {
    display: none !important;
  }

  .mobile-thumbnails {
    display: flex !important;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Shop Layout Mobile Adjustments */
  .shop-layout {
    flex-direction: column;
  }
  
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
  }
  
  .product-card .product-img {
    height: 180px; /* Make images a bit smaller so 2 fit better */
  }
  
  .product-card .product-title {
    font-size: 1rem;
  }
  
  .mobile-only-btn {
    display: block !important;
  }
  
  .filter-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 300px;
    height: 100vh;
    max-width: 85vw;
    z-index: 1000;
    background: white;
    box-shadow: 2px 0 15px rgba(0,0,0,0.2);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    margin: 0 !important;
    border-radius: 0;
  }

  .filter-sidebar.active {
    left: 0;
  }
  
  .sidebar-overlay.active {
    display: block;
  }

  main {
    padding: 1rem;
  }

  /* Responsive Typography to override inline styles */
  h1 {
    font-size: 2rem !important;
  }
  
  h2 {
    font-size: 1.5rem !important;
  }
}