/* ============================================
   JOULE E-Commerce — Homepage Styles
   Font: Poppins | Primary: #FF6040 | BG: #fff
   ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #FF6040;
  --primary-dk: #e04e30;
  --lime: #C0E040;
  --lime-dk: #a8c835;
  --dark: #202020;
  --text: #404040;
  --text-sec: #606060;
  --text-muted: #A0A0A0;
  --border: #E0E0E0;
  --bg: #FFFFFF;
  --bg-mint: #E8FFF4;
  --bg-light: #F7F7F7;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 1px 6px rgba(0, 0, 0, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 24px;
  --font: 'Poppins', sans-serif;
  --nav-h: 64px;
  --header-h: 56px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-light);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Mobile-first: full width */
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font);
}

img {
  display: block;
  max-width: 100%;
}

ul {
  list-style: none;
}

/* ============================================
   LAYOUT WRAPPER — centers on desktop
   ============================================ */
.header,
.main-content,
.bottom-nav {
  max-width: 480px;
  margin: 0 auto;
}

/* On desktop, show as a phone-like card */
@media (min-width: 768px) {
  body {
    background: #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
  }

  .header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    max-width: 480px;
  }
}

/* ============================================
   HEADER
   ============================================ */
.header {
  background: var(--bg);
  height: var(--header-h);
  box-shadow: 0 1px 0 var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark);
  font-size: 16px;
  transition: background 0.2s;
  position: relative;
}

.icon-btn:hover {
  background: var(--bg-light);
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  background: var(--bg);
  padding-bottom: calc(var(--nav-h) + 36px);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* ============================================
   SECTION COMMON
   ============================================ */
.section {
  padding: 16px 16px 8px;
}

@media (min-width: 768px) {
  .section {
    padding: 30px 16px;
  }
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
}

.view-all-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 3px;
}

.view-all-link i {
  font-size: 10px;
}

/* ============================================
   HERO BANNER SLIDER
   ============================================ */
.hero-section {
  padding: 12px 16px 8px;
  position: relative;
}

.hero-slider {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}

.hero-slide {
  display: none;
}

.hero-slide.active {
  display: block;
}

/* Full-width banner image style */
.hero-banner-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

.hero-card {
  border-radius: var(--radius);
  padding: 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 130px;
  overflow: hidden;
  position: relative;
}

.hero-text {
  flex: 1;
  z-index: 1;
}

.hero-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sec);
  margin-bottom: 2px;
}

.hero-discount {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}

.hero-percent {
  color: var(--primary);
}

.hero-hurry {
  font-size: 18px;
  font-weight: 800;
  color: var(--lime-dk);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hero-img-wrap {
  width: 130px;
  height: 110px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

/* Slider Dots */
.hero-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.3s;
}

.hero-dot.active {
  background: var(--primary);
  width: 20px;
  border-radius: 4px;
}

/* ============================================
   CATEGORIES
   ============================================ */
.categories-section {
  padding-bottom: 4px;
}

.categories-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 8px;
  padding-left: 2px;
  padding-right: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* allow items to be fully visible on desktop */
  flex-wrap: nowrap;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}


.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  cursor: pointer;
}

.category-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-light);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.category-icon-wrap img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.category-item span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-sec);
  text-align: center;
  white-space: nowrap;
}

.category-item.active .category-icon-wrap {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 96, 64, 0.15);
}

.category-item.active span {
  color: var(--primary);
  font-weight: 600;
}

/* ============================================
   TRENDING — HORIZONTAL PRODUCT CARDS
   ============================================ */
.trending-section {
  padding-top: 12px;
}

/* Card wrapper */
.product-card-h {
  display: flex;
  align-items: stretch;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  /* big rounded corners like image */
  padding: 12px 10px 12px 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  gap: 10px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

/* ---- LEFT COLUMN: heart + image ---- */
.pcard-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  width: 88px;
}

.wishlist-btn {
  font-size: 18px;
  color: var(--text-muted);
  padding: 0;
  line-height: 1;
  transition: color 0.2s, transform 0.2s;
  align-self: center;
}

.wishlist-btn.active,
.wishlist-btn:hover {
  color: var(--primary);
  transform: scale(1.15);
}

.product-card-h-img {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.product-card-h-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---- MIDDLE COLUMN: info ---- */
.product-card-h-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.4;
  margin: 0;
}

.product-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
}

.price-current {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
}

.price-current sup {
  font-size: 10px;
  font-weight: 600;
}

.price-original {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.price-original sup {
  font-size: 9px;
}

.price-discount {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.product-dv {
  font-size: 12px;
  font-weight: 600;
  color: var(--dark);
}

.btn-buy {
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.2px;
  transition: background 0.2s, transform 0.1s;
  align-self: flex-start;
  border: none;
}

.btn-buy:hover {
  background: var(--primary-dk);
  transform: scale(1.03);
}

.product-seller {
  font-size: 11px;
  font-style: italic;
  color: var(--text-muted);
  margin: 0;
}

/* ---- RIGHT COLUMN: + / 0 / - ---- */
.pcard-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  width: 34px;
  padding: 2px 0;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s;
  border: none;
}

.add-btn {
  background: var(--bg-light);
  color: var(--dark);
  border: 1.5px solid var(--border);
}

.add-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.minus-btn {
  background: var(--bg-light);
  color: var(--dark);
  border: 1.5px solid var(--border);
}

.minus-btn:hover {
  background: #f0f0f0;
}

.qty-count {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  text-align: center;
}

/* Load More */
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 16px;
}

.btn-load-more {
  background: var(--bg-light);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 32px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.btn-load-more:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ============================================
   PROMO CARDS — New Menu
   ============================================ */
.promo-section {
  padding: 8px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.promo-card {
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 110px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.promo-left {
  background: linear-gradient(135deg, #fff8f0 0%, #ffe8d8 100%);
  flex-direction: row;
}

.promo-right {
  background: linear-gradient(135deg, #f0fff8 0%, #d8ffe8 100%);
  flex-direction: row-reverse;
}

.promo-text {
  flex: 1;
  z-index: 1;
}

.promo-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.promo-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 10px;
  line-height: 1.2;
}

.btn-promo {
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  transition: background 0.2s, transform 0.1s;
  display: inline-block;
}

.btn-promo:hover {
  background: var(--primary-dk);
  transform: scale(1.03);
}

.promo-img-wrap {
  width: 110px;
  height: 90px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.promo-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.12));
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 95px 20px 24px;
  text-align: center;
  margin-bottom: 82px;
}

/* Logo block */
.footer-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
}

.footer-logo-neo {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  font-style: italic;
  color: var(--dark);
  letter-spacing: 0.5px;
  line-height: 1;
  margin-bottom: 0px;
}

.footer-logo-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-logo-joule {
  font-family: var(--font);
  font-size: 28px;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: 1px;
  line-height: 1.1;
}

.footer-logo-icon {
  width: 150px;

  object-fit: contain;
}

/* Info lines */
.footer-line {
  font-size: 13px;
  font-weight: 400;
  color: var(--dark);
  margin-bottom: 4px;
  line-height: 1.7;
}

.footer-line a {
  color: var(--dark);
  text-decoration: none;
}

.footer-links {
  font-size: 13px;
  color: var(--dark);
  margin-bottom: 14px;
}

/* Disclaimer — left aligned, bold */
.footer-disclaimer {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.75;
  text-align: left;
  margin-top: 6px;
}

/* ============================================
   BOTTOM NAVIGATION — Dark pill style
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 456px;
  z-index: 200;
  pointer-events: none;
  /* allow clicks to pass through nav wrapper to elements behind */
}


.bottom-nav-inner {
  background: #1a1a1a;
  border-radius: 50px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
  pointer-events: all;
  /* re-enable clicks on the actual nav bar */
}

.bnav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  text-decoration: none;
  position: relative;
}

.bnav-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.65);
  font-size: 20px;
  position: relative;
  transition: color 0.2s;
}

/* Active item — lime green circle */
.bnav-item.active .bnav-icon-wrap,
.bnav-icon-wrap.active-wrap {
  background: #9AE000;
  color: #1a1a1a;
  box-shadow: 0 2px 10px rgba(154, 224, 0, 0.45);
}

.bnav-item:hover .bnav-icon-wrap {
  color: #fff;
}

/* Badge (red pill) */
.bnav-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: #FF3B30;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  border: 2px solid #1a1a1a;
}

/* ============================================
   DESKTOP RESPONSIVE — Tablet & Desktop
   ============================================ */
@media (min-width: 768px) {

  /* Center the app like a phone on desktop */
  .header {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    position: fixed;
    top: 0;
    width: 100%;
    box-shadow: var(--shadow);
  }

  .main-content {
    margin-top: var(--header-h);
    max-width: 480px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
    min-height: calc(100vh - var(--header-h));
    overflow-x: hidden;
  }

  .bottom-nav {
    max-width: 456px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    width: calc(100% - 24px);
  }

  /* Slightly larger text on desktop */
  .section-title {
    font-size: 17px;
  }

  .product-name {
    font-size: 13px;
  }

  .hero-discount {
    font-size: 26px;
  }

  .hero-hurry {
    font-size: 20px;
  }

  .promo-title {
    font-size: 22px;
  }
}

/* Wide desktop — show multiple columns beside the phone */
@media (min-width: 1024px) {
  body {
    padding: 20px 0;
  }

  .main-content {
    border-radius: 0 0 var(--radius) var(--radius);
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-slide.active {
  animation: fadeIn 0.4s ease;
}

.product-card-h {
  animation: fadeIn 0.3s ease both;
}

.product-card-h:nth-child(1) {
  animation-delay: 0.05s;
}

.product-card-h:nth-child(2) {
  animation-delay: 0.10s;
}

.product-card-h:nth-child(3) {
  animation-delay: 0.15s;
}

.product-card-h:nth-child(4) {
  animation-delay: 0.20s;
}

.product-card-h:nth-child(5) {
  animation-delay: 0.25s;
}

/* ============================================
   SCROLLBAR (desktop)
   ============================================ */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* ============================================
   GLOBAL PRINT — hide site chrome
   ============================================ */
@media print {

  .header,
  .bottom-nav,
  .site-footer,
  nav,
  footer {
    display: none !important;
  }
}

/* ============================================
   SIDEBAR DRAWER
   ============================================ */

/* Overlay — full screen dim */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* Drawer — mobile: full left edge */
.sidebar-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 80vw;
  max-width: 300px;
  height: 100%;
  background: var(--bg);
  z-index: 400;
  transform: translateX(-110%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.32s;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}

.sidebar-drawer.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: all;
}

body.sidebar-open {
  overflow: hidden;
}

/* ---- User Card ---- */
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 16px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.sidebar-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.sidebar-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--bg-light);
  padding: 3px;
}

.sidebar-avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 22px;
  height: 22px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  border: 2px solid var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  text-decoration: none;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-id {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0;
}

.sidebar-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-light);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-sec);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.sidebar-close-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---- Menu ---- */
.sidebar-menu {
  flex: 1;
  padding: 6px 0;
  background: var(--bg-light);
}

.sidebar-menu-card {
  background: var(--bg);
  border-radius: 14px;
  margin: 12px 12px 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  color: var(--dark);
  text-decoration: none;
  background: var(--bg);
  transition: background 0.15s;
}

.sidebar-menu-item:hover {
  background: var(--bg-light);
}

.sidebar-menu-icon {
  width: 26px;
  text-align: center;
  font-size: 17px;
  color: var(--dark);
  flex-shrink: 0;
}

.sidebar-menu-icon-empty {
  width: 26px;
  display: inline-block;
}

.sidebar-menu-label {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
}

.sidebar-menu-arrow {
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 0 16px;
}

.sidebar-logout-item {}

.sidebar-logout-icon {
  color: var(--primary) !important;
}

.sidebar-logout-label {
  color: var(--primary) !important;
  font-weight: 700 !important;
}

/* ============================================
   DESKTOP — sidebar inside 480px phone frame
   ============================================ */
@media (min-width: 768px) {

  /* Overlay clipped to phone frame — JS sets exact position */
  .sidebar-overlay {
    /* JS will set left/width dynamically */
  }

  /* Drawer anchored via JS */
  .sidebar-drawer {
    width: 280px;
    max-width: 280px;
  }
}