/* css/style.css */
:root {
  --bg: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --accent: #8b5cf6;
  --border: rgba(255, 255, 255, 0.1);
  --glass-blur: 15px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6, .logo {
  font-family: 'Outfit', sans-serif;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.logo i {
  color: var(--primary);
}

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

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

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

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

.cart-icon {
  position: relative;
}

.cart-icon .badge {
  position: absolute;
  top: -8px;
  right: -12px;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  height: 18px;
  min-width: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Main Layout */
main {
  flex: 1;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Hero Section */
.hero {
  padding: 8rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(56, 189, 248, 0.1) 40%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.hero h1 {
  font-size: 4.5rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fff 20%, var(--primary) 60%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
    .hero h1 { font-size: 3rem; }
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(56, 189, 248, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  margin-left: 1rem;
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* Category Grid */
.category-section {
    padding: 2rem 0;
}
.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.section-title i {
    color: var(--primary);
}
.category-grid {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.category-grid::-webkit-scrollbar {
    display: none;
}
.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-width: 240px;
    scroll-snap-align: start;
    flex: 0 0 auto;
}
.category-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-5px);
}
.category-card i {
    font-size: 2rem;
    color: var(--primary);
}

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

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card:hover {
  transform: translateY(-8px);
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.product-image {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  position: relative;
  background: #111827;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image img {
  transform: scale(1.08);
}

.category-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: var(--primary);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

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

.product-title {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.product-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s;
}
.product-title a:hover {
  color: var(--primary);
}

.product-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.product-stats i {
    color: #fbbf24;
}

.product-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 1.25rem;
  font-family: 'Outfit', sans-serif;
}

.add-to-cart {
  margin-top: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Category Filters */
.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.filter-btn {
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  border-radius: 30px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

/* Product Details */
.product-detail-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  padding: 4rem 0;
}
@media (max-width: 768px) {
  .product-detail-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
.detail-image {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 24px;
    border: 1px solid var(--border);
}
.detail-image img {
  width: 100%;
  border-radius: 16px;
  display: block;
}
.detail-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.detail-info h1 {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.detail-info .price {
  font-size: 2.2rem;
  color: var(--primary);
  font-weight: 800;
  margin-bottom: 1.5rem;
  font-family: 'Outfit', sans-serif;
}
.detail-info .description {
  color: var(--text-muted);
  font-size: 1.15rem;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}
.stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  color: var(--text);
  font-weight: 500;
}
.stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.stats span i {
  color: #fbbf24;
}
.detail-info .btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    max-width: 300px;
}

/* Cart Page */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.cart-container {
  max-width: 800px;
  margin: 0 auto;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 16px;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  transition: all 0.3s;
}
.cart-item:hover {
    border-color: rgba(255,255,255,0.2);
    transform: translateX(5px);
}
.cart-item img {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  object-fit: cover;
}
.cart-item-info {
  flex: 1;
}
.cart-item-info h4 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}
.cart-item-info p {
  color: var(--primary);
  font-weight: bold;
  font-size: 1.1rem;
}
.cart-controls {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: 1rem;
}
.cart-controls button {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-controls button:hover {
  background: rgba(255,255,255,0.2);
}
.cart-controls .remove-btn {
  background: transparent;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  margin-left: auto;
}
.cart-controls .remove-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}
.cart-summary {
  background: linear-gradient(135deg, var(--bg-card), rgba(15, 23, 42, 0.9));
  padding: 2.5rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-top: 3rem;
  text-align: right;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.cart-summary h3 {
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  font-weight: 300;
}
.cart-summary h3 span {
    font-weight: 800;
    color: var(--primary);
}
.checkout-btn {
  margin-top: 1rem;
  font-size: 1.1rem;
  padding: 1rem 3rem;
}
.empty-cart {
  text-align: center;
  padding: 4rem;
  color: var(--text-muted);
  font-size: 1.25rem;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px dashed var(--border);
}

/* Footer */
footer {
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--border);
  padding: 4rem 2rem 2rem;
  margin-top: 6rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 3rem;
}

.footer-brand {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Outfit';
}
.footer-brand i { color: var(--primary); }
.footer-brand p {
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-size: 1rem;
  font-family: 'Inter';
  font-weight: 400;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 2rem;
  font-size: 1rem;
  font-weight: 500;
  transition: 0.3s;
}
.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--primary);
  color: #fff;
  padding: 1.25rem 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(56, 189, 248, 0.2);
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform: translateX(120%);
  opacity: 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.toast::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary);
}
.toast.visible {
  transform: translateX(0);
  opacity: 1;
}
.toast.hidden {
  visibility: hidden;
}

/* Offcanvas Cart */
#cart-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
#cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

#offcanvas-cart {
    position: fixed;
    top: 0; right: -420px;
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    background: var(--bg);
    border-left: 1px solid var(--border);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(0,0,0,0.8);
}
#offcanvas-cart.open {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
}
.cart-header h3 { margin: 0; font-size: 1.3rem; }
.close-btn {
    background: transparent; border: none;
    color: var(--text-muted); font-size: 1.5rem; cursor: pointer;
    transition: transform 0.3s, color 0.3s;
    display: flex; align-items: center; justify-content: center;
}
.close-btn:hover { color: #ef4444; transform: rotate(90deg); }

#offcanvas-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.cart-total-row {
    display: flex; justify-content: space-between;
    font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem;
}
.total-price { color: var(--primary); }

.offcanvas-item {
    display: flex; gap: 1rem; align-items: center;
    margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border);
}
.offcanvas-item:last-child {
    border-bottom: none; margin-bottom: 0; padding-bottom: 0;
}
.offcanvas-item img {
    width: 60px; height: 60px; border-radius: 8px; object-fit: cover;
    border: 1px solid var(--border);
}
.offcanvas-item-info { flex: 1; min-width: 0; }
.offcanvas-item-info h4 { 
    margin: 0 0 0.25rem 0; font-size: 0.95rem; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.offcanvas-item-info p { margin: 0; color: var(--primary); font-weight: 600; font-size: 0.9rem; }
.offcanvas-qty-controls {
    display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem;
}
.qty-btn {
    background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--text);
    width: 26px; height: 26px; border-radius: 4px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.qty-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.remove-icon { 
    color: var(--text-muted); cursor: pointer; margin-left: auto; 
    background: none; border: none; font-size: 1.1rem;
    transition: color 0.2s;
}
.remove-icon:hover { color: #ef4444; }

/* Mobile Responsive Overrides */
@media (max-width: 900px) {
    .nav-container {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1rem;
    }
    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1.5rem;
    }
    #global-search-form {
        width: 100%;
    }
    #live-search-input {
        width: 100% !important;
        flex: 1;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 4rem 1rem;
    }
    .hero h1 {
        font-size: 2.2rem;
    }
    .footer-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .footer-links {
        align-items: center;
    }
    .footer-links a {
        margin-left: 0;
    }
    #offcanvas-cart {
        width: 100%;
        right: -100%;
    }
    .product-grid {
        grid-template-columns: 1fr;
    }
    .checkout-btn {
        width: 100%;
        text-align: center;
        padding: 1rem;
    }
}
