:root{
  --bg:#ffffff;
  --text:#0d1625;
  --muted:rgba(13,22,37,.68);
  --stroke:rgba(13,22,37,.12);
  --card:#ffffff;
  --shadow: 0 18px 45px rgba(13,22,37,.08);
  --radius: 18px;
  --brand:#ff4a2d;
  --brand2:#ff7a2d;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family:"Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

a{ color:inherit; text-decoration:none; }
.container{ width:min(1180px, calc(100% - 40px)); margin-inline:auto; }
.muted{ color: var(--muted); }

.btn{
  border:1px solid var(--stroke);
  background:#fff;
  color:var(--text);
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 900;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
}
.btn--primary{
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border-color: transparent;
  color:#fff;
}
.btn--ghost{ background:#fff; }
.btn--block{ width:100%; }
.btn--sm{ padding:8px 10px; border-radius: 12px; font-size: 12px; }

.icon-btn{
  border:1px solid var(--stroke);
  background:#fff;
  border-radius: 14px;
  padding: 10px 12px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:10px;
}

.badge{
  background: var(--brand);
  color:#fff;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 900;
}

/* Header */
.header{
  position:sticky;
  top:0;
  z-index:1000;
  background:#fff;
  border-bottom:1px solid var(--stroke);
}
.header__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 0;
  gap: 12px;
}
.brand__logo{
  font-weight: 1000;
  letter-spacing: .06em;
  padding: 10px 14px;
  border: 3px solid var(--brand);
  border-radius: 10px;
  color: var(--brand);
  line-height:1;
}
.header__right{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }

.search{ display:flex; align-items:center; border:1px solid var(--stroke); border-radius: 14px; overflow:hidden; }
.search input{
  border:none; outline:none;
  padding: 10px 12px;
  min-width: 240px;
}
.search__btn{ border:none; background:#fff; cursor:pointer; padding: 10px 12px; }

/* Hero Slider */
.hero{ padding: 18px 0 10px; }
.hero__slider{
  position:relative;
  border-radius: 10px;
  overflow:hidden;
  border:1px solid var(--stroke);
  box-shadow: var(--shadow);
  min-height: clamp(250px, 100vh, 600px);
}
.hero__slide{
  position:absolute;
  inset:0;
  opacity:0;
  transform: translateX(12px);
  transition: opacity .35s ease, transform .35s ease;
  display:flex;
  align-items:center;
}
.hero__slide.is-active{ opacity:1; transform: translateX(0); }
.hero__bg{ position:absolute; inset:0; }
.hero__bg--orange{
  background: url("../img/logorici1.png") center/cover no-repeat;
}
.hero__bg--dark{
  background: url("../img/logorici.png") center/cover no-repeat;
}
.hero__content{
  position:relative;
  padding: 36px;
  max-width: 760px;
  color:#fff;
}
.hero__content h1{
  margin:0 0 10px;
  font-size: clamp(24px, 3.5vw, 44px);
  letter-spacing: -0.02em;
}
.hero__content p{ margin:0 0 14px; opacity:.92; }

.hero__actions{ display:flex; gap:10px; flex-wrap:wrap; }
.hero__nav{
  position:absolute;
  left:16px; right:16px; bottom:16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.hero__arrow{
  width:42px; height:42px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.30);
  background: rgba(0,0,0,.15);
  color:#fff;
  cursor:pointer;
  font-size: 24px;
}
.hero__dots{ display:flex; gap:8px; align-items:center; justify-content:center; flex:1; }
.dot{
  width: 10px; height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.25);
  cursor:pointer;
}
.dot.is-active{ background:#fff; }

/* Sections */
.section{ padding: 34px 0; }
.section--alt{ background: #fafafa; border-top:1px solid rgba(0,0,0,.03); border-bottom:1px solid rgba(0,0,0,.03); }
.section__head{ margin-bottom: 14px; }
.section__head--row{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.section__head h2{ margin:0; font-size: 28px; }
.section__head p{ margin: 6px 0 0; }

/* Category bar (icons) */
.catbar{
  display:grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.cat{
  border:1px solid var(--stroke);
  border-radius: 18px;
  background:#fff;
  padding: 16px 14px;
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  cursor:pointer;
  transition: transform .15s ease;
}
.cat:hover{ transform: translateY(-2px); }
.cat__icon{ font-size: 28px; }
.cat__name{ font-weight: 900; text-align:center; }

/* Products grid (Products Page) */
.grid-products{
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.grid-products--wide{ grid-template-columns: repeat(4, 1fr); }

/* Product Card */
.product{
  border:1px solid var(--stroke);
  border-radius: 18px;
  background:#fff;
  box-shadow: var(--shadow);
  overflow:hidden;
  height: 100%;
  display:flex;
  flex-direction:column;
}
.product__img{
  height: 150px;
  background: linear-gradient(135deg, rgba(255,74,45,.18), rgba(255,122,45,.18));
  display:grid;
  place-items:center;
  font-weight: 1000;
  color: rgba(13,22,37,.35);
}
.product__body{
  padding: 12px;
  display:flex;
  flex-direction:column;
  gap:8px;
  flex: 1;
}

/* ===== FIX FINAL: Nama Produk 1 BARIS + Tooltip ===== */
.product__name{
  position: relative;
  font-weight: 800;
  font-size: 13px;
  line-height: 16px;
  display:block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 16px;
}

/* Tooltip pakai attribute title default browser + custom */
.product__name[title]{
  cursor: help;
}

/* Custom tooltip (lebih cantik) */
.product__name:hover::after{
  content: attr(title);
  position:absolute;
  left:0;
  top: calc(100% + 8px);
  background: #0d1625;
  color: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
  max-width: 240px;
  z-index: 9999;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}
.product__name:hover::before{
  content:"";
  position:absolute;
  left:14px;
  top: calc(100% + 2px);
  width:0; height:0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #0d1625;
  z-index: 9999;
}

.product__price{ color: var(--brand); font-weight: 1000; font-size: 16px; }
.product__meta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-top: auto;
}
.product__tag{
  font-size: 12px;
  font-weight: 1000;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,74,45,.22);
  background: rgba(255,74,45,.08);
}

/* Subhero */
.subhero{
  background: #f6f6f6;
  border-bottom:1px solid var(--stroke);
}
.subhero__inner{ padding: 18px 0; }
.breadcrumbs{ color: var(--muted); font-weight: 800; display:flex; gap:8px; align-items:center; }
.breadcrumbs a{ color: var(--muted); }
.breadcrumbs a:hover{ color: var(--text); }
.subhero h1{ margin: 10px 0 6px; }

/* Products page layout */
.products-layout{
  display:grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items:start;
}
.sidebar{
  border:1px solid var(--stroke);
  border-radius: 18px;
  background:#fff;
  box-shadow: var(--shadow);
  padding: 14px;
  position: sticky;
  top: 86px;
}
.sidebar__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
}
.sidebar__box{ display:grid; gap:10px; }
.chk{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid rgba(13,22,37,.08);
  background:#fff;
}
.chk input{ width:16px; height:16px; }

.products-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap:wrap;
}
.products-toolbar select{
  border:1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  background:#fff;
  font-weight: 900;
}

/* Drawer (cart) */
.drawer{ position:fixed; inset:0; display:none; z-index:2000; }
.drawer.show{ display:block; }
.drawer__overlay{ position:absolute; inset:0; background: rgba(0,0,0,.50); }
.drawer__panel{
  position:absolute; right:0; top:0;
  width:min(420px, 92vw); height:100%;
  background:#fff;
  border-left:1px solid var(--stroke);
  box-shadow: var(--shadow);
  display:flex; flex-direction:column;
}
.drawer__head{ padding: 14px; border-bottom:1px solid var(--stroke); display:flex; justify-content:space-between; align-items:center; }
.drawer__content{ padding: 14px; overflow:auto; flex:1; }
.drawer__foot{ padding: 14px; border-top:1px solid var(--stroke); }

.cart-empty{ display:none; }
.cart-list{ display:grid; gap:10px; }
.cart-item{
  display:grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(13,22,37,.10);
  border-radius: 16px;
}
.cart-item strong{ display:block; }
.cart-actions{ display:flex; gap:8px; align-items:center; margin-top: 8px; }
.qty-btn{
  width:34px; height:34px;
  border-radius: 12px;
  border:1px solid var(--stroke);
  background:#fff;
  cursor:pointer;
  font-weight:1000;
}
.remove{ border:none; background:transparent; cursor:pointer; font-weight:1000; color: var(--brand); }

.totals{ display:grid; gap:8px; margin-bottom: 12px; }
.row{ display:flex; justify-content:space-between; color: var(--muted); font-weight: 900; }
.row strong{ color: var(--text); }
.row--total{ border-top:1px dashed var(--stroke); padding-top: 10px; }
.row--total span{ color: var(--text); }
.row--total strong{ color: var(--brand); font-size: 18px; }
.checkout-row{ display:grid; gap:10px; }
.checkout-row input{
  border:1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px 12px;
}

/* Mini cart (home) */
.mini-cart{ position:fixed; inset:0; display:none; z-index:2000; }
.mini-cart.show{ display:block; }
.mini-cart__overlay{ position:absolute; inset:0; background: rgba(0,0,0,.45); }
.mini-cart__panel{
  position:absolute;
  right: 18px; top: 86px;
  width: min(380px, 92vw);
  background:#fff;
  border:1px solid var(--stroke);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow:hidden;
}
.mini-cart__head{
  padding: 12px 12px;
  border-bottom:1px solid var(--stroke);
  display:flex; justify-content:space-between; align-items:center;
}
.mini-cart__body{ padding: 12px; max-height: 320px; overflow:auto; display:grid; gap:10px; }
.mini-cart__foot{ padding: 12px; border-top:1px solid var(--stroke); }

/* Footer */
.footer{ border-top:1px solid var(--stroke); padding: 26px 0; }
.footer__inner{ display:flex; justify-content:space-between; align-items:flex-start; gap:14px; flex-wrap:wrap; }
.footer__links{ display:grid; gap:8px; }
.brand--footer .brand__logo{ display:inline-block; }

@media (max-width: 1020px){
  .grid-products{ grid-template-columns: repeat(3, 1fr); }
  .grid-products--wide{ grid-template-columns: repeat(3, 1fr); }
  .catbar{ grid-template-columns: repeat(3, 1fr); }
  .products-layout{ grid-template-columns: 1fr; }
  .sidebar{ position:relative; top:0; }
}
@media (max-width: 640px){
  .grid-products{ grid-template-columns: repeat(2, 1fr); }
  .grid-products--wide{ grid-template-columns: repeat(2, 1fr); }
  .search input{ min-width: 160px; }
  .hero__content{ padding: 22px; }
}

/* ===== Home Product Slider (PAGED STRUCTURE) ===== */
.product-slider{ position: relative; }

.product-slider__viewport{
  overflow: hidden;
  border-radius: 18px;
}

.product-slider__track{
  display: flex;
  transition: transform .45s ease;
  will-change: transform;
}

/* 1 slide = 1 page, always full width */
.product-slide{
  flex: 0 0 100%;
  padding-bottom: 6px;
}

.product-slide__grid{
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1020px){
  .product-slide__grid{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px){
  .product-slide__grid{ grid-template-columns: repeat(2, 1fr); }
}

.product-slider__dots{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.product-slider__dot{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(255,74,45,.45);
  background: transparent;
  cursor: pointer;
}
.product-slider__dot.is-active{
  background: var(--brand);
  border-color: var(--brand);
}

/* ===== HOME: Product Slider 1 ROW (horizontal) ===== */
.product-slide__grid{
  display: flex;
  gap: 14px;
  overflow: hidden;          /* biar tetap 1 baris */
}

/* Lebar kartu per item di slider (home) */
.product-slide__grid .product{
  flex: 0 0 calc((100% - 14px * 4) / 5); /* default 5 item per slide */
}

.product-slide__grid{
  display: flex;
  gap: 14px;
  overflow: hidden;
}

.product-slide__grid .product{
  flex: 0 0 calc((100% - 14px * 4) / 5);
}

@media (max-width: 1020px){
  .product-slide__grid .product{
    flex: 0 0 calc((100% - 14px * 2) / 3);
  }
}

@media (max-width: 640px){
  .product-slide__grid .product{
    flex: 0 0 calc((100% - 14px * 1) / 2);
  }
}

.user-chip{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 8px 10px;
  border:1px solid var(--stroke);
  border-radius: 14px;
  background:#fff;
  font-weight: 900;
}

.brand__logo-img{
  height: 80px;   /* atur sesuai selera */
  width: auto;
  display:block;
}

.cat__icon-img{
  width: 82px;
  height: 82px;
  object-fit: contain;
  display: block;
}

.product__img{
  height: 150px;
  background: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.product__img-tag{
  width:100%;
  height:100%;
  object-fit:cover; /* biar nggak gepeng */
}

.footer__about{
  display:flex;
  gap:16px;
  align-items:flex-start;
  max-width:420px;
}

.footer__logo{
  width:70px;
  height:auto;
}

.footer__desc h3{
  margin:0 0 6px;
  font-size:18px;
}

/* ===== DEFAULT (PC/DESKTOP): tetap 1 baris seperti semula ===== */
.header__right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;           /* biar tetap rapih */
}

.header__actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.header__searchRow{
  display:flex;
  align-items:center;
}

/* search default */
.header__searchRow .search input{
  min-width: 240px;         /* sesuai style lama kamu */
}

/* ===== MOBILE ONLY: jadi 2 baris (search turun) ===== */
@media (max-width: 640px){
  .header__right{
    width:100%;
    flex-direction:column;
    align-items:stretch;
    gap:10px;
  }

  .header__actions{
    width:100%;
    justify-content:space-between;
  }

  .header__searchRow{
    width:100%;
  }

  .header__searchRow .search{
    width:100%;
  }

  .header__searchRow .search input{
    width:100%;
    min-width:0;            /* penting: biar gak maksa lebar */
  }
}

/* ===== MOBILE HERO FIX ===== */
@media (max-width: 640px){

  .hero__slider{
    min-height: 300px;   /* lebih kecil di HP */
  }

  .hero__bg{
    background-size: contain !important; 
    background-position: center;
  }

  .hero__content{
    padding: 16px;
  }

  .hero__content h1{
    font-size: 20px;
  }
}

/* =========================
   GLOBAL RESPONSIVE HEADER
   Works for HOME + PRODUCTS
   ========================= */

/* Desktop default: 1 baris rapih */
.header__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.header__right{
  display:flex;
  align-items:center;
  gap:12px;
}

/* Actions (tombol) tetap rapih */
.header__actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

/* Search row default (desktop) */
.header__searchRow{
  display:flex;
  align-items:center;
}

.header__searchRow .search input{
  min-width:240px;
}

/* Biar tombol/search gak ketiban */
.header__right, .header__actions, .header__searchRow { min-width: 0; }
.search input{ width: 100%; }

/* =========================
   MOBILE: jadi 2 baris
   (actions atas, search turun)
   ========================= */
@media (max-width: 640px){
  .container{ width: calc(100% - 24px); } /* lebih lega di hp */

  .header__inner{
    align-items:flex-start;
    gap:10px;
  }

  .brand__logo-img{
    height:52px; /* logo lebih pas di mobile */
  }

  .header__right{
    width:100%;
    flex-direction:column;
    align-items:stretch;
    gap:10px;
  }

  .header__actions{
    width:100%;
    justify-content:space-between;
  }

  .header__searchRow{
    width:100%;
  }

  .header__searchRow .search{
    width:100%;
  }

  .header__searchRow .search input{
    min-width:0;
    width:100%;
  }
}

/* =========================
   HOME: hero tinggi responsif
   ========================= */
.hero__slider{
  min-height: 420px;
}
@media (max-width: 640px){
  .hero__slider{ min-height: 320px; }
}

/* =========================
   PRODUCTS: layout responsif
   sidebar pindah ke atas di mobile
   ========================= */
.products-layout{
  display:grid;
  grid-template-columns: 280px 1fr;
  gap:16px;
}

@media (max-width: 1020px){
  .products-layout{
    grid-template-columns: 1fr; /* sidebar jadi atas */
  }
  .sidebar{
    position:relative;
    top:0;
  }
}

/* =========================
   GRID PRODUK responsif
   ========================= */
.grid-products{
  display:grid;
  gap:14px;
  grid-template-columns: repeat(5, 1fr);
}
.grid-products--wide{
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1020px){
  .grid-products{ grid-template-columns: repeat(3, 1fr); }
  .grid-products--wide{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px){
  .grid-products{ grid-template-columns: repeat(2, 1fr); }
  .grid-products--wide{ grid-template-columns: repeat(2, 1fr); }
}