html, body {
  width: 100%;
  overflow-x: hidden;
}

*, *::before, *::after {
  box-sizing: border-box;
}
section,
.banner,
.products,
.product-details,
.category-grid {
  max-width: 100%;
  overflow-x: hidden;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =====================
   BASE
===================== */
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #fdf3f5;

  color: #3a1c1c;
}


/* =====================
   HEADER
===================== */
.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e0d6d6;
}

.header-left img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}

.header-center {
  text-align: center;
}

.header-center h1 {
  margin: 0;
  font-size: 24px;
  color: #7a1f1f;
}

.header-right input {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

/* =====================
   MOBILE HEADER FIX
===================== */
@media (max-width: 768px) {
  .site-header {
    grid-template-columns: auto 1fr;
    row-gap: 10px;
  }

  .header-center {
    grid-column: 1 / -1;
    text-align: center;
  }

  .header-center h1 {
    font-size: 20px;
    white-space: nowrap;
  }

  .header-right {
    grid-column: 1 / -1;
  }

  .header-right input {
    width: 100%;
  }
}

/* =====================
   MOBILE SEARCH OVERFLOW FIX
===================== */
@media (max-width: 768px) {
  .header-right {
    width: 100%;
    padding-right: 0;
  }

  .header-right input {
    box-sizing: border-box;
    max-width: 100%;
  }

  body {
    overflow-x: hidden;
  }
}

/* =====================
   PRICE SORT DROPDOWN
===================== */
#priceSort {
  display: block;
  margin: 10px 16px 0 auto;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  color: #3a1c1c;
  width: 150px;
  cursor: pointer;
}

@media (max-width: 768px) {
  #priceSort {
    width: 140px;
    margin: 8px 12px 0 auto;
    font-size: 12px;
    padding: 6px 8px;
  }
}

/* =====================
   BANNER
===================== */
.banner {
  width: 90%;
  max-width: 1200px;
  height: 280px;
  margin: 20px auto;
  border-radius: 14px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #000;
  overflow: hidden;
}

.banner-overlay {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 40px;
  color: #fff;
}

.banner-overlay h1 {
  font-size: 36px;
  font-weight: 700;
  margin: 0;
}

.banner-overlay p {
  font-size: 15px;
  margin-top: 6px;
  opacity: 0.85;
  text-align: center;
}

@media (max-width: 768px) {
  .banner {
    height: 200px;
    margin: 12px auto;
  }

  .banner-overlay {
    padding: 0 20px;
  }

  .banner-overlay h1 {
    font-size: 22px;
  }

  .banner-overlay p {
    font-size: 13px;
  }
}

/* =====================
   SECTION
===================== */
section {
  background: #fff;
  margin: 16px;
  padding: 20px;
  border-radius: 12px;
}

.section-title {
  margin-bottom: 14px;
  color: #7a1f1f;
}

/* =====================
   CATEGORY GRID
===================== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 18px;
}

.category-card {
  text-align: center;
  cursor: pointer;
}

.category-card img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
}

/* =====================
   PRODUCTS GRID
===================== */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.product-card {
  background: transparent;
  padding: 0;
  cursor: pointer;
}

/* IMAGE FIT (NO CUTTING) */
.product-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #f3f3f3;
  border-radius: 10px;
}

.product-card h3 {
  margin: 6px 0 2px;
  font-size: 14px;
  text-align: center;
}

.price {
  text-align: center;
  font-size: 14px;
}

.strike {
  text-decoration: line-through;
  color: #888;
}

.final {
  font-weight: bold;
  color: #8b0000;
}

.offer {
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  color: #006400;
}

/* MOBILE → 2 PRODUCTS PER ROW */
@media (max-width: 768px) {
  .products {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .product-card img {
    height: 100px;
  }

  .product-card h3 {
    font-size: 13px;
  }

  .price {
    font-size: 13px;
  }
}

/* =====================
   SPECIAL OFFERS
===================== */
.special-offer-track {
  display: flex;
  gap: 16px;
  width: max-content;
  animation: scrollOffers 25s linear infinite;
}

.special-offer-wrapper {
  overflow: hidden;
}

@keyframes scrollOffers {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* =====================
   PRODUCT PAGE – RESTORE OLD LOOK
===================== */

.product-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px;
  background: #fff;
  border-radius: 16px;
}

/* IMAGE SIDE */
.product-images img {
  width: 100%;
  max-height: 420px;   /* reduced size */
  border-radius: 16px;
  object-fit: contain;
  background: #f5f5f5;
}


/* TEXT SIDE */
.product-info {
  text-align: center;
  padding: 10px 20px;
}

.product-info h2 {
  font-size: 26px;
  margin-bottom: 10px;
  color: #5d1f1f;
}

/* PRICE */
.price-box {
  font-size: 22px;
  margin: 12px 0;
}

.price-box .strike {
  color: #999;
  margin-right: 8px;
}

.price-box .final {
  color: #8b0000;
  font-weight: bold;
}

/* OFFER */
.offer {
  margin-bottom: 14px;
  font-weight: bold;
  color: #006400;
}


/* OLD BUY NOW BUTTON */
.buy-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #8b0000, #b71c1c);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin: 16px 0;
}

.buy-btn:hover {
  opacity: 0.95;
}

/* DESCRIPTION */
#productDesc {
  font-size: 15px;
  line-height: 1.6;
  color: #4a2a2a;
}

/* =====================
   PRODUCT PAGE – MOBILE
===================== */
@media (max-width: 768px) {
  .product-details {
    grid-template-columns: 1fr;
  }

  .product-info h2 {
    font-size: 22px;
  }
}
@media (max-width: 768px) {
  .product-images img {
    max-height: 300px;
  }
}


/* =====================
   FOOTER
===================== */
.site-footer {
  background: #653838;
  color: #fff;
  padding: 15px;
  text-align: center;
}

.footer-links a {
  color: #fff;
  margin: 0 10px;
  text-decoration: none;
}

/* =====================
   POPUP – FORCE MODAL ONLY (ADDED)
===================== */
.popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.popup-box {
  background: #fff;
  width: 90%;
  max-width: 380px;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

/* show popup ONLY when JS sets display:flex */
.popup[style*="display: flex"] {
  display: flex !important;
}
/* ======================
   ORDER POPUP (RESTORED)
====================== */
.popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.popup.show {
  display: flex;
}

.popup-box {
  background: #fff;
  width: 90%;
  max-width: 380px;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
  animation: popupFade 0.25s ease;
}

@keyframes popupFade {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.popup-box h3 {
  margin: 0;
  font-size: 22px;
  text-align: center;
  color: #5d4037;
}

.popup-sub {
  text-align: center;
  font-size: 14px;
  color: #777;
  margin: 10px 0 18px;
}

.popup-box input,
.popup-box textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 14px;
}

.popup-box textarea {
  resize: vertical;
  min-height: 80px;
}

.popup-buy {
  width: 100%;
  background: linear-gradient(135deg, #8b0000, #b71c1c);
  color: #fff;
  padding: 14px;
  border-radius: 12px;
  border: none;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
}

.popup-buy:hover {
  opacity: 0.95;
}

.popup-cancel {
  width: 100%;
  background: transparent;
  border: none;
  color: #555;
  margin-top: 10px;
  cursor: pointer;
  font-size: 14px;
}
/* =====================
   POPUP INPUT FIX
===================== */
.popup-box {
  box-sizing: border-box;
}

.popup-box input,
.popup-box textarea {
  width: 100%;
  box-sizing: border-box;
}

.popup-box textarea {
  resize: none;
  min-height: 90px;
}

/* =====================
   GLOBAL WATERMARK
===================== */

body::before {
  content: "";
  position: fixed;
  inset: 0;

  background-image: var(--site-watermark);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 280px;

  opacity: 0.04;   /* very light */
  pointer-events: none;
  z-index: 0;
}

/* keep content above watermark */
body > * {
  position: relative;
  z-index: 1;
}

/* =====================
   WOW DEALS – FINAL FIX
===================== */

/* override products grid ONLY for wow deals */
.products.horizontal-scroll {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 16px;
  width: max-content;
  overflow: visible;
}

/* product card sizing */
.products.horizontal-scroll .product-card {
  flex: 0 0 170px;
}

/* auto scroll animation */
.products.horizontal-scroll.auto-scroll {
  animation: wowScroll 28s linear infinite;
}

/* animation */
@keyframes wowScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* =====================
   MOBILE FIX (CRITICAL)
===================== */
@media (max-width: 768px) {

  .products.horizontal-scroll {
    gap: 12px;
  }

  .products.horizontal-scroll .product-card {
    flex: 0 0 150px;
  }

  /* STOP PAGE CUTTING */
  section {
    overflow-x: hidden;
  }
}
/* =====================
   HEADER NAV (HOME / CONTACT)
===================== */
.header-nav {
  margin-top: 4px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.header-nav a {
  font-size: 13px;
  color: #7a1f1f;
  text-decoration: none;
  font-weight: 500;
}

.header-nav a:hover {
  text-decoration: underline;
}

/* MOBILE */
@media (max-width: 768px) {
  .header-nav {
    gap: 12px;
  }
}
/* =====================
   FOOTER ADDRESS
===================== */
.footer-address {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #fff;
}
