:root {
  --max-width: 1100px;
  --accent: #000;
  --muted: #555;
  --bg: #fff;
  --bar-bg: #f8f8f8;
  --hero-img: url("https://images.unsplash.com/photo-1608571423903-8352b2b90f3c?auto=format&fit=crop&w=1500&q=80");
}

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #222;
  background: var(--bg);
  line-height: 1.5;
}

/* ===== Announcement Bar ===== */
.announcement {
  text-align: center;
  background: var(--bar-bg);
  font-size: 14px;
  padding: 8px 12px;
  color: var(--muted);
}

/* ===== Navbar ===== */
.navbar {
  border-bottom: 1px solid #eee;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 16px;
}

.brand {
  font-weight: 700;
  font-size: 18px;
}

.nav-links {
  display: flex;
  gap: 18px;
}

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

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

.nav-icons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon {
  font-size: 18px;
}

.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

/* ===== Hero Section ===== */
.hero {
  height: 70vh;
  background-image: var(--hero-img);
  background-size: cover;
  background-position: center;
  position: relative;
}

.hero-overlay {
  background: rgba(0, 0, 0, 0.45);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero h1 {
  color: #fff;
  font-size: clamp(28px, 5vw, 48px);
  text-align: center;
  font-weight: 700;
  max-width: 700px;
  margin: 0 16px;
}

/* ===== About Section ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 16px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.about-img img {
  width: 100%;
  border-radius: 10px;
}

.about-text h2 {
  font-size: clamp(20px, 3vw, 28px);
  margin-bottom: 12px;
}

.about-text p {
  font-size: 16px;
  color: var(--muted);
}

/* ===== Product Grid ===== */
.products {
  padding-top: 20px;
  padding-bottom: 60px;
}

.products h2 {
  font-size: clamp(20px, 3vw, 28px);
  margin-bottom: 30px;
  font-weight: 700;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.product-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
}

.product-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.5s ease-out;
}

.product-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.product-info {
  padding: 12px 10px 18px;
}

.product-info h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 6px 0;
}

.product-info p {
  font-size: 14px;
  color: #555;
}

/* ===== Modal (Product Details) ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 24px;
  animation: fadeInUp 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

/* ===== Product Detail Layout ===== */
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

.product-detail-img img {
  width: 100%;
  border-radius: 8px;
}

.product-detail-info h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.product-detail-info p {
  font-size: 16px;
  margin: 4px 0;
}

/* ===== Quantity Controls ===== */
.quantity-control {
  display: flex;
  align-items: center;
  margin: 16px 0;
}

.quantity-control button {
  width: 32px;
  height: 32px;
  border: 1px solid #ccc;
  background: #f9f9f9;
  font-size: 18px;
  cursor: pointer;
}

.quantity-control input {
  width: 50px;
  text-align: center;
  margin: 0 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

/* ===== Buttons ===== */
.btn {
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  margin-top: 10px;
  cursor: pointer;
  font-weight: 500;
}

.add-to-cart {
  background: #000;
  color: #fff;
}

.open-cart {
  background: #f6f6f6;
}

.detail-desc {
  margin-top: 20px;
  color: #555;
  line-height: 1.5;
}

/* ===== Related Products ===== */
.related-products {
  margin-top: 50px;
}

.related-products h3 {
  margin-bottom: 16px;
  font-size: 18px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.related-item {
  cursor: pointer;
}

.related-item img {
  width: 100%;
  border-radius: 8px;
}

.related-item h4 {
  font-size: 15px;
  margin: 8px 0 2px;
}

.related-item p {
  color: #666;
  font-size: 14px;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    background: #fff;
    position: absolute;
    top: 60px;
    right: 16px;
    border: 1px solid #eee;
    padding: 12px;
    border-radius: 8px;
  }

  .nav-links.show {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .product-detail-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    padding: 16px;
  }
}


/* === CART PANEL === */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  z-index: 99;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 380px;
  max-width: 90%;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 12px rgba(0,0,0,0.1);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: right 0.35s ease;
}

.cart-panel.show {
  right: 0;
}

.cart-overlay.show {
  display: block;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #eee;
}

.cart-close {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px solid #f0f0f0;
  padding: 10px 0;
}

.cart-item img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
}

.cart-item-info {
  flex: 1;
}

.cart-item-info h4 {
  font-size: 15px;
  margin-bottom: 4px;
}

.cart-item-info p {
  font-size: 13px;
  color: #777;
  margin-bottom: 8px;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-qty button {
  width: 28px;
  height: 28px;
  border: 1px solid #ccc;
  background: #f9f9f9;
  cursor: pointer;
}

.cart-qty input {
  width: 40px;
  text-align: center;
  border: 1px solid #ccc;
  height: 28px;
}

.cart-delete {
  background: transparent;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 16px;
}

.cart-footer {
  padding: 16px;
  border-top: 1px solid #eee;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.total-label {
  color: #666;
}

.total-value {
  font-weight: 700;
  font-size: 16px;
}

.checkout-btn {
  background: #000;
  color: #fff;
  border-radius: 8px;
}
/* Button Group for Modal */
.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn-group .btn {
  flex: 1;
  margin-top: 0;
  text-align: center;
  padding: 10px 0;
}

/* Adjust buy-now style */
.btn.buy-now {
  background: #f6f6f6;
  color: #000;
  border: 1px solid #ddd;
}

.btn.buy-now:hover {
  background: #e9e9e9;
}
/* ===== Product Carousel ===== */
.product-carousel {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
}

.carousel-track-wrapper {
  overflow: hidden;
  flex: 1;
  border-radius: 8px;
}

.carousel-track {
  display: flex;
  gap: 16px;
  padding: 12px;
  transition: transform 0.35s ease;
  will-change: transform;
}

/* Ensure product-card doesn't shrink inside carousel */
.product-card {
  min-width: 260px; /* same as your grid min */
  flex: 0 0 auto;
}

/* Arrow buttons */
.carousel-prev,
.carousel-next {
  background: #fff;
  border: 1px solid #eee;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.carousel-prev[disabled],
.carousel-next[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Responsive tweak: show smaller cards on small screens */
@media (max-width: 480px) {
  .product-card { min-width: 200px; }
  .carousel-prev, .carousel-next { width: 36px; height: 36px; font-size: 18px; }
}


/* subtle edge gradients to show list boundaries */
.carousel-track-wrapper {
  position: relative;
}

.carousel-track-wrapper::before,
.carousel-track-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  pointer-events: none;
  z-index: 5;
}

.carousel-track-wrapper::before {
  left: 0;
  background: linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0));
}

.carousel-track-wrapper::after {
  right: 0;
  background: linear-gradient(to left, rgba(255,255,255,1), rgba(255,255,255,0));
}

/* reduce gradient on dark hero/background variants if needed */
.product-carousel { background: transparent; }
