:root {
  --primary: #2874f0;
  --accent: #fb641b;
  --bg: #f1f3f6;
  --white: #ffffff;
  --muted: #878787;
  --dark: #212121;
  --border: #e0e0e0;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.12),
            0 1px 2px rgba(0,0,0,0.24);
  --shadow-hover: 0 4px 14px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', Roboto, Arial;
  background: var(--bg);
  color: var(--dark);
  line-height: 1.4;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* -------------------------
    HEADER
-------------------------- */
.site-header {
  background: var(--primary);
  color: var(--white);
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.search {
  display: flex;
  background: #fff;
  padding: 3px;
  border-radius: 6px;
  width: 450px;
}

.search input {
  flex: 1;
  padding: 9px 12px;
  border: none;
  outline: none;
}

.search button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 9px 16px;
  cursor: pointer;
  border-radius: 6px;
}

.header-links {
  display: flex;
  gap: 18px;
}

.header-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

/* -------------------------
    NAV BAR
-------------------------- */
.nav {
  display: flex;
  background: var(--white);
  padding: 10px;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.nav a {
  color: var(--dark);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 4px;
}

.nav a:hover {
  background: #e8f0ff;
}

/* -------------------------
    HERO SECTION
-------------------------- */
.hero {
  display: flex;
  gap: 20px;
  padding: 20px 0;
}

.hero-left { width: 250px; }

.box {
  background: var(--white);
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

/* Slider */
.slider {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  height: 320px;
}

.slider .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .5s;
}

.slider .slide.active { opacity: 1; }

.slider img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slider-prev, .slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #ffffffcc;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 50%;
}

.slider-prev { left: 12px; }
.slider-next { right: 12px; }

/* -------------------------
    SECTIONS
-------------------------- */
.section {
  padding: 20px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: 20px;
  font-weight: 700;
}

.view-all {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

/* -------------------------
  PRODUCT GRID
-------------------------- */
.grid, .featured-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

/* -------------------------
  PRODUCT CARD
-------------------------- */
.product-card {
  background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e3e8ee;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    transition: all .25s ease;
    display: flex;
    flex-direction: column;
    height: 380px;
}

.product-image {
  background: #f8f9ff;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
    border-color: #d0d7ff;
}
.product-image img {
  max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.product-info {
 padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.product-title a {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--dark);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
}

.short {
  color: var(--muted);
  font-size: 13px;
  height: 34px;
  overflow: hidden;
}

/* BUTTON */
.add-to-cart {
  margin-top: auto;
  background: var(--primary);
  padding: 10px;
  color: #fff;
  text-align: center;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
}

.add-to-cart:hover {
  background: #1c65e0;
}

/* -------------------------
 RESPONSIVE
-------------------------- */

@media (max-width: 1050px) {
  .grid, .featured-grid {
    grid-template-columns: repeat(3,1fr);
  }
}

@media (max-width: 800px) {
  .hero { flex-direction: column; }
  .grid, .featured-grid {
    grid-template-columns: repeat(2,1fr);
  }
}

@media (max-width: 480px) {
  .grid, .featured-grid {
    grid-template-columns: repeat(2,1fr);
  }
  .product-card { height: 330px; }
  .product-image { height: 150px; }
}

@media (max-width: 360px) {
  .grid, .featured-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- MOBILE TOPBAR FIX ---------- */
@media (max-width: 480px) {

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
  }

  /* Search bar full width */
  .search {
    width: 100% !important;
    max-width: 100%;
  }

  /* Login / Wishlist / Cart row fix */
  .topbar .icons,
  .topbar .right-links {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 14px;
  }

  .topbar a,
  .icon-link {
    font-size: 14px;
    display: flex;
    align-items: center;
  }

  /* Navigation menu full width + scroll */
  .nav {
    overflow-x: auto;
    white-space: nowrap;
    width: 100%;
  }

  .nav a {
    flex: 0 0 auto;
  }
}

/* Extra small device fix */
@media (max-width: 360px) {
  .topbar {
    gap: 6px;
  }

  .topbar .right-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}
