/* ============================================
   ShopWise - Bootstrap 5 with Original Design + Theme Support
   ============================================ */

/* Theme Variables - Light Mode */
[data-bs-theme="light"] {
  --bg:#f3f4f6;
  --card:#ffffff;
  --border:#d6d7db;
  --text:#1f2937;
  --muted:#6b7280;
  --shadow: 0 8px 24px rgba(0,0,0,0.06);
  --radius: 10px;
}

/* Theme Variables - Dark Mode */
[data-bs-theme="dark"] {
  --bg:#1a1d23;
  --card:#2d3748;
  --border:#4a5568;
  --text:#f7fafc;
  --muted:#a0aec0;
  --shadow: 0 8px 24px rgba(0,0,0,0.3);
  --radius: 10px;
}

/* Base Styles */
*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

a{ color:inherit; text-decoration:none; }
.container{ width:min(1100px, 92%); margin:0 auto; }

/* Theme Toggle Button */
#themeToggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1050;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #0d6efd;
  color: white;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#themeToggle:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Top Navigation */
.topbar{
  background: var(--card);
  border-bottom:1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color 0.3s, border-color 0.3s;
}
.topbar-inner{
  display:flex;
  align-items:center;
  gap:16px;
  padding: 14px 0;
}

.logo-box{
  width:44px;height:28px;
  border:1px solid var(--border);
  border-radius:6px;
  background: var(--border);
  opacity: 0.5;
}

.search-wrap input{
  width: 260px;
  padding: 10px 12px;
  border:1px solid var(--border);
  border-radius: 999px;
  outline:none;
  background: var(--bg);
  color: var(--text);
  transition: all 0.3s;
}

.search-wrap input:focus{
  border-color: #0d6efd;
}

.navlinks{
  display:flex;
  gap: 18px;
  margin-left:auto;
}
.navlinks a{
  font-size:14px;
  color: var(--text);
  transition: opacity 0.2s;
}
.navlinks a:hover{ opacity: 0.7; }

.cart-btn{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  background:#111827;
  color:#fff;
  border-radius:8px;
  font-size:14px;
  transition: all 0.3s;
}

[data-bs-theme="dark"] .cart-btn{
  background:#0d6efd;
}

.cart-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.cart-badge{
  background:#fff;
  color:#111827;
  padding:2px 8px;
  border-radius:999px;
  font-weight:700;
}

/* Hero Section */
.hero{
  padding: 28px 0 18px;
}
.hero-card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 18px;
  text-align:center;
  transition: all 0.3s;
}
.hero-card h1{ margin:0 0 10px; font-size: 22px; font-weight: 700; }
.muted{ color: var(--muted); }
.small{ font-size: 12px; }

/* Buttons - Original Style */
.btn{
  border: 1px solid transparent;
  padding: 10px 14px;
  border-radius: 8px;
  cursor:pointer;
  font-weight:600;
  transition: all 0.2s;
}
.btn.primary{
  background:#111827;
  color:#fff;
}

[data-bs-theme="dark"] .btn.primary{
  background:#0d6efd;
}

.btn.outline{
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn:hover{ 
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Sections */
.section{ padding: 22px 0; }
.section-title{
  text-align:center;
  margin: 0 0 14px;
  font-size: 18px;
}

/* Carousel */
.carousel{
  display:flex;
  align-items:center;
  gap:14px;
  position: relative;
}
.carousel-btn{
  width:38px;height:38px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: var(--card);
  cursor:pointer;
  font-size: 20px;
  transition: all 0.3s;
  flex-shrink: 0;
  z-index: 10;
}
.carousel-btn:hover{
  border-color: var(--text);
  transform: scale(1.1);
}
.carousel-track{
  display:flex;
  gap:16px;
  overflow-x: auto;
  overflow-y: visible;
  width:100%;
  transition: transform .25s ease;
  min-height: 300px;
  padding: 10px 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.carousel-track::-webkit-scrollbar {
  height: 8px;
}

.carousel-track::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}

.carousel-track::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.carousel-track::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* Cards */
.featured-card{
  min-width: 320px;
  max-width: 320px;
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.featured-card:hover{
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}

.img-box{
  width:100%;
  height: 140px;
  border:1px solid var(--border);
  border-radius: 8px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-box:not(:has(img))::before {
  content: '📦';
  font-size: 48px;
  opacity: 0.3;
}

[data-bs-theme="dark"] .img-box{
  background: #4b5563;
}

.img-box.small{ height: 90px; }
.meta{ margin-top:10px; flex-grow: 1; }
.name{ font-size:13px; text-transform: uppercase; letter-spacing:.02em; font-weight: 600; color: var(--text); }
.price{ font-size:16px; color: var(--text); margin-top:4px; font-weight: 700; }
.stars{ color:#ffc107; font-size:12px; margin-top:6px; }

/* Newsletter */
.newsletter{
  background: var(--card);
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
  transition: all 0.3s;
}
.newsletter-inner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 18px 0;
  gap: 14px;
}
.newsletter-form{
  display:flex;
  gap:10px;
  align-items:center;
}
.newsletter-form input{
  width: 280px;
  padding: 10px 12px;
  border:1px solid var(--border);
  border-radius: 6px;
  outline:none;
  background: var(--bg);
  color: var(--text);
  transition: all 0.3s;
}

/* Product Grid */
.grid-wrap{
  display:grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items:start;
}
.big-card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}
.img-big{
  width:100%;
  height: 250px;
  border:1px solid var(--border);
  border-radius: 8px;
  background: var(--border);
  opacity: 0.3;
}

.product-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.product-card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}
.product-card:hover{
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}

/* About */
.about{ padding: 18px 0 28px; }
.about-card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align:center;
  transition: all 0.3s;
}

/* Footer */
.footer{
  background: var(--card);
  border-top:1px solid var(--border);
  padding: 22px 0;
  transition: all 0.3s;
}
.footer-grid{
  display:grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 16px;
}
.footer h4{ margin:0 0 10px; font-size:12px; text-transform: uppercase; letter-spacing:.04em; }
.footer a{ display:block; color: var(--muted); font-size:13px; margin: 6px 0; transition: color 0.2s; }
.footer a:hover{ color: var(--text); }
.footer-logo{ width:56px; height:34px; margin-bottom: 10px; }

/* Cart */
.spacer{ flex:1; }
.cart-pill{
  padding: 8px 10px;
  border:1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
}

.cart-list{ margin-top: 14px; }
.cart-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 12px;
  background: var(--card);
  border:1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  transition: all 0.3s;
}

/* Responsive */
@media (max-width: 980px){
  .navlinks{ display:none; }
  .grid-wrap{ grid-template-columns: 1fr; }
  .product-grid{ grid-template-columns: repeat(2, 1fr); }
  .search-wrap input{ width: 200px; }
}
@media (max-width: 560px){
  .product-grid{ grid-template-columns: 1fr; }
  .newsletter-inner{ flex-direction:column; align-items:flex-start; }
  .newsletter-form input{ width: 100%; }
}
