*{box-sizing:border-box} :root{--orange:#e87522;--orange-dark:#b94f0d;--ink:#252525;--muted:#6b7280;--line:#f0dfd1;--bg:#fff8f1;--white:#fff;--green:#16794b}body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;background:var(--bg);color:var(--ink)}a{color:inherit;text-decoration:none}button,input,select,textarea{font:inherit}button,.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--orange);color:white;border:0;border-radius:10px;padding:11px 15px;font-weight:700;cursor:pointer}.btn.secondary,button.secondary{background:#fff;color:var(--ink);border:1px solid var(--line)}.btn.danger,button.danger{background:#b42318}.wrap{width:min(1180px,calc(100% - 32px));margin:auto}.topbar{background:#fff;border-bottom:1px solid var(--line)}.nav{min-height:72px;display:flex;align-items:center;gap:18px;justify-content:space-between}.brand{display:flex;align-items:center;gap:10px;font-size:1.35rem;font-weight:900;color:var(--orange-dark)}.brandmark{display:grid;place-items:center;width:42px;height:42px;background:#fff0df;border-radius:13px}.navlinks{display:flex;gap:14px;align-items:center;flex-wrap:wrap}.search{display:flex;gap:8px;flex:1;max-width:460px}.search input{width:100%}.hero{margin:26px 0;background:linear-gradient(120deg,#ffeddc,#fff 60%,#fff5e9);border:1px solid var(--line);border-radius:22px;padding:clamp(24px,5vw,54px);display:flex;gap:28px;align-items:center;justify-content:space-between}.hero h1{font-size:clamp(2rem,5vw,3.5rem);line-height:1.08;margin:0 0 12px;max-width:650px}.hero p{max-width:620px;color:var(--muted);line-height:1.65}.hero-emoji{font-size:clamp(4rem,12vw,8rem)}.section-head{display:flex;justify-content:space-between;align-items:end;gap:12px;margin:28px 0 14px}.section-head h2{margin:0}.muted{color:var(--muted)}.categories{display:flex;gap:10px;overflow:auto;padding:2px 0 8px}.chip{background:white;border:1px solid var(--line);padding:9px 13px;border-radius:999px;white-space:nowrap}.chip.active{background:#fff0df;border-color:#f3bd91;color:var(--orange-dark)}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.product{background:white;border:1px solid var(--line);border-radius:16px;overflow:hidden;display:flex;flex-direction:column;min-width:0}.product img,.product .placeholder{width:100%;aspect-ratio:1.15;object-fit:cover;background:#fff0df}.product .placeholder{display:grid;place-items:center;font-size:3rem}.product-body{padding:13px;display:flex;flex-direction:column;gap:7px;flex:1}.product h3{font-size:1rem;line-height:1.35;margin:0}.price{font-weight:850;color:var(--orange-dark);font-size:1.08rem}.old-price{text-decoration:line-through;color:#8b8b8b;font-size:.85rem;font-weight:400;margin-left:5px}.small{font-size:.88rem}.layout{display:grid;grid-template-columns:230px minmax(0,1fr);gap:24px;margin:24px auto}.sidebar,.panel,.form-card{background:white;border:1px solid var(--line);border-radius:16px;padding:18px}.side-links{display:grid;gap:7px}.side-links a{padding:10px 12px;border-radius:9px}.side-links a:hover,.side-links a.active{background:#fff0df;color:var(--orange-dark)}.page{padding:26px 0}.page-title{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:20px}.page-title h1{margin:0;font-size:1.8rem}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.field{display:grid;gap:6px}.field.full{grid-column:1/-1}.field label{font-size:.9rem;font-weight:700}.field input,.field select,.field textarea,.search input{border:1px solid #d8d8d8;border-radius:9px;padding:11px 12px;background:#fff;width:100%;min-width:0}.field textarea{min-height:105px;resize:vertical}.help{font-size:.82rem;color:var(--muted)}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;background:white}th,td{padding:12px 10px;text-align:left;border-bottom:1px solid #eee;vertical-align:middle}th{font-size:.83rem;color:#555;background:#fffaf6}td{font-size:.93rem}.thumb{width:52px;height:52px;object-fit:cover;border-radius:8px;background:#fff0df}.badge{display:inline-block;background:#f4f4f5;border-radius:999px;padding:4px 8px;font-size:.78rem}.badge.green{background:#e8f7ee;color:#146c43}.badge.red{background:#feeceb;color:#a61b1b}.alert{padding:12px 14px;border-radius:10px;background:#fff3cd;margin:14px 0}.alert.success{background:#e8f7ee;color:#146c43}.alert.error{background:#feeceb;color:#a61b1b}.footer{margin-top:45px;background:white;border-top:1px solid var(--line);padding:26px 0;color:var(--muted)}.empty{padding:40px 18px;text-align:center;background:white;border:1px dashed #e8cdb7;border-radius:15px}.detail{display:grid;grid-template-columns: minmax(0,1fr) minmax(0,1fr);gap:28px;background:#fff;border:1px solid var(--line);border-radius:20px;padding:22px}.detail img{width:100%;max-height:520px;object-fit:contain;background:#fff7ef;border-radius:14px}.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.stat{background:white;border:1px solid var(--line);border-radius:14px;padding:18px}.stat strong{display:block;font-size:1.6rem;margin-top:6px}.actions{display:flex;gap:8px;flex-wrap:wrap}.inline-form{display:inline}.admin-header{background:#2e251f;color:white}.admin-header .brand{color:white}.admin-header .brandmark{color:var(--orange-dark)}.admin-header a{color:white}.pagination{display:flex;gap:8px;justify-content:center;margin:24px 0}.notice{font-size:.9rem;color:var(--muted);line-height:1.6} @media(max-width:900px){.grid{grid-template-columns:repeat(3,minmax(0,1fr))}.layout{grid-template-columns:1fr}.sidebar{padding:12px}.side-links{display:flex;overflow:auto}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:640px){.nav{padding:12px 0;align-items:flex-start;flex-wrap:wrap}.navlinks{width:100%;justify-content:space-between}.search{order:3;max-width:none;flex-basis:100%}.hero{margin:18px 0}.hero-emoji{display:none}.grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.product-body{padding:10px}.form-grid,.detail{grid-template-columns:1fr}.page-title{align-items:flex-start;flex-direction:column}.stats{grid-template-columns:1fr 1fr}.wrap{width:min(100% - 22px,1180px)}th,td{padding:10px 8px}.hide-mobile{display:none}}


/* PALUGADA category cards — desktop and mobile */
.category-section{margin:26px 0 34px}
.category-section-head{margin:0 0 14px}
.category-all-link{display:inline-flex;align-items:center;gap:7px;color:var(--orange-dark);font-weight:750;font-size:.92rem}
.category-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}
.category-card{position:relative;display:flex;flex-direction:column;align-items:flex-start;min-width:0;min-height:145px;padding:16px;background:linear-gradient(145deg,#fff 0%,#fffaf5 100%);border:1px solid #f0dfd1;border-radius:17px;box-shadow:0 4px 14px rgba(75,43,20,.035);transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.category-card:hover{transform:translateY(-3px);border-color:#efb17f;box-shadow:0 9px 22px rgba(115,63,23,.09)}
.category-icon{display:grid;place-items:center;width:53px;height:53px;margin-bottom:13px;border-radius:16px;background:#fff0df;font-size:1.8rem;line-height:1}
.category-card-name{font-size:.96rem;font-weight:800;line-height:1.35;overflow-wrap:anywhere}
.category-card-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;margin-top:auto;padding-top:10px;color:#8a7464;font-size:.78rem}
.category-card-meta span{font-size:1.1rem;color:var(--orange-dark)}
.category-card-more{border:1px dashed #e7a875;background:#fff7ed}
.category-more-icon{background:#ffe4c7;color:#b94f0d;font-weight:800}
.category-empty{padding:18px;background:#fff;border:1px dashed var(--line);border-radius:14px;color:var(--muted)}
.categories-page{padding-top:18px;padding-bottom:18px}
.breadcrumb{display:flex;align-items:center;gap:9px;margin:8px 0 24px;color:var(--muted);font-size:.9rem}
.breadcrumb a{color:var(--orange-dark);font-weight:700}
.categories-page-intro{padding:26px 28px;margin-bottom:22px;border:1px solid var(--line);border-radius:20px;background:linear-gradient(120deg,#ffeddc,#fff 72%)}
.categories-page-intro h1{font-size:clamp(1.8rem,4vw,2.6rem);line-height:1.12;margin:10px 0}
.categories-page-intro p{margin:0}
.category-grid-all{grid-template-columns:repeat(4,minmax(0,1fr))}
.categories-page-actions{margin-top:26px}
@media(max-width:1000px){.category-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.category-grid-all{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:640px){
  .category-section{margin:22px 0 28px}
  .category-section-head{align-items:flex-start}
  .category-section-head h2{font-size:1.25rem}
  .desktop-category-all{display:none}
  .category-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .category-grid-home .category-card:nth-child(n+5){display:none}
  .category-grid-home .category-card-more{display:flex!important;min-height:125px}
  .category-card{min-height:132px;padding:12px;border-radius:14px}
  .category-icon{width:46px;height:46px;margin-bottom:10px;border-radius:14px;font-size:1.55rem}
  .category-card-name{font-size:.88rem}
  .category-card-meta{font-size:.75rem;padding-top:8px}
  .categories-page-intro{padding:21px 18px;border-radius:16px}
  .category-grid-all{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(prefers-reduced-motion:reduce){.category-card{transition:none}.category-card:hover{transform:none}}


/* Mobile homepage: five compact circular category icon buttons */
@media(max-width:640px){
  .category-grid-home{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:5px;
    align-items:start;
  }
  .category-grid-home .category-card,
  .category-grid-home .category-card:nth-child(n+5){
    display:flex!important;
    align-items:center;
    justify-content:flex-start;
    min-width:0;
    min-height:0;
    padding:2px 0 4px;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
    text-align:center;
    transform:none;
  }
  .category-grid-home .category-icon{
    display:grid;
    place-items:center;
    width:clamp(42px,12vw,56px);
    height:clamp(42px,12vw,56px);
    flex:0 0 auto;
    margin:0 auto 7px;
    border:1px solid #f3d4b9;
    border-radius:50%;
    background:linear-gradient(145deg,#fff5e9,#ffe5c8);
    box-shadow:0 2px 7px rgba(95,54,21,.07);
    font-size:1.45rem;
  }
  .category-grid-home .category-card-name{
    display:block;
    width:100%;
    font-size:.65rem;
    line-height:1.2;
    font-weight:700;
    overflow-wrap:anywhere;
    text-align:center;
  }
  .category-grid-home .category-card-meta{display:none}
  .category-grid-home .category-card-more .category-icon{
    color:#b94f0d;
    background:#fff0df;
    border:1px dashed #e7a875;
    font-size:1.35rem;
  }
  .category-grid-home .category-card-more .category-card-name{
    font-size:.65rem;
  }
}


/* Beranda HP: tampilkan 6 produk terlebih dahulu, lalu muat 6 berikutnya. */
.home-products-more-wrap { display: flex; justify-content: center; margin: 20px 0 8px; }
.home-products-more-wrap[hidden] { display: none !important; }
.home-product-item[hidden] { display: none !important; }
@media (min-width: 641px) {
  .home-products-more-wrap { display: none !important; }
  .home-product-item[hidden] { display: revert !important; }
}

/* Checkout and cart */
.add-cart-form { margin-top: 8px; }
.add-cart-form .btn { width: 100%; }
.table-wrap { width: 100%; overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap th, .table-wrap td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border, #e8e8e8); }
@media (max-width: 640px) {
  .table-wrap table { min-width: 620px; }
  .cart-checkout-actions { display: grid; gap: 10px; }
}


/* PALUGADA: lebarkan sedikit kolom formulir Identitas Website */
@media (min-width: 901px) {
  .settings-layout {
    grid-template-columns: 290px minmax(0, 1fr) !important;
    align-items: start;
  }
}
@media (max-width: 900px) {
  .settings-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}


/* PATCH: desktop beranda hanya menampilkan 4 kategori; kategori lain melalui tautan "Lihat semua kategori". */
@media (min-width: 1001px) {
  .category-grid-home > .category-card:nth-child(n+5) {
    display: none !important;
  }
}

/* PATCH: sejajarkan tombol tambah keranjang dengan kolom jumlah pada halaman detail produk. */
.detail form.form-grid {
  align-items: end;
}
.detail form.form-grid .field .btn {
  width: 100%;
  min-height: 40px;
}

/* PALUGADA mobile navigation: keep desktop header unchanged */
.mobile-bottom-nav { display:none; }
@media (max-width:640px) {
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .topbar:not(.admin-header) .navlinks { display:none !important; }
  .topbar:not(.admin-header) .nav { align-items:center; }
  .topbar:not(.admin-header) .brand { flex:1 1 100%; }
  .topbar:not(.admin-header) .search { order:3; flex:1 1 100%; max-width:none; }
  .mobile-bottom-nav {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    position:fixed;
    z-index:9999;
    left:0; right:0; bottom:0;
    padding:8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    background:#fff;
    border-top:1px solid var(--line);
    box-shadow:0 -4px 16px rgba(60,35,15,.08);
  }
  .mobile-bottom-nav a {
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    min-height:48px;
    color:var(--orange-dark);
    font-size:.78rem;
    font-weight:750;
  }
  .mobile-bottom-nav .mobile-nav-icon {
    display:block;
    font-size:1.25rem;
    line-height:1.2;
  }
}


/* PALUGADA mobile polish: compact, consistent product actions; desktop unchanged */
@media (max-width: 640px) {
  .home-product-item .btn,
  .product-card .btn,
  .product-item .btn,
  .add-cart-form .btn,
  .product-actions .btn {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.92rem;
    line-height: 1.25;
    font-weight: 650;
    white-space: normal;
    box-shadow: none;
  }
  .home-product-item .btn + .btn,
  .product-card .btn + .btn,
  .product-item .btn + .btn {
    margin-top: 8px;
  }
  .home-product-item .btn-primary,
  .product-card .btn-primary,
  .product-item .btn-primary,
  .add-cart-form .btn {
    padding-left: 10px;
    padding-right: 10px;
  }
  .home-product-item .btn:hover,
  .product-card .btn:hover,
  .product-item .btn:hover,
  .add-cart-form .btn:hover {
    transform: none;
  }
}


/* PALUGADA: admin navigation collapses to a burger menu on phones only. */
.admin-menu-toggle { display:none; }
@media (max-width:640px) {
  .admin-header .nav { flex-wrap:wrap; gap:10px; padding-top:10px; padding-bottom:10px; }
  .admin-header .brand { flex:1 1 auto; min-width:0; }
  .admin-menu-toggle {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:42px;
    padding:9px 13px;
    border:1px solid #4a382c;
    border-radius:10px;
    background:#30251e;
    color:#fff;
    font-size:.92rem;
    font-weight:700;
    white-space:nowrap;
  }
  .admin-header .admin-mobile-menu { display:none !important; }
  .admin-header .admin-mobile-menu.is-open {
    display:flex !important;
    flex:1 0 100%;
    flex-direction:column;
    align-items:stretch;
    gap:0;
    width:100%;
    padding:6px;
    border:1px solid #ead7c7;
    border-radius:12px;
    background:#fff;
    box-shadow:0 8px 22px rgba(40,25,12,.10);
  }
  .admin-header .admin-mobile-menu a {
    display:block;
    padding:12px 10px;
    border-bottom:1px solid #f1e6dc;
    color:var(--ink);
    font-size:.95rem;
    line-height:1.3;
  }
  .admin-header .admin-mobile-menu a:last-child { border-bottom:0; }
}

/* PALUGADA preset theme selector — compact and readable inside the admin settings column */
.theme-palette-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin-top:10px;
  width:100%;
}
.theme-palette-option{
  display:grid;
  grid-template-columns:16px 28px minmax(0,1fr);
  align-items:center;
  gap:7px;
  min-width:0;
  min-height:54px;
  padding:8px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  cursor:pointer;
  overflow:hidden;
}
.field .theme-palette-option input{
  display:block;
  width:15px;
  min-width:15px;
  height:15px;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  accent-color:var(--orange);
}
.theme-palette-preview{
  display:block;
  width:28px;
  height:28px;
  min-width:28px;
  border-radius:8px;
  background:linear-gradient(135deg,var(--palette-primary) 0 50%,var(--palette-bg) 50%);
  border:1px solid rgba(0,0,0,.12);
}
.theme-palette-name{
  display:block;
  min-width:0;
  overflow-wrap:anywhere;
  font-size:.78rem;
  font-weight:750;
  line-height:1.2;
}
.theme-palette-option:has(input:checked){
  border-color:var(--orange);
  box-shadow:0 0 0 2px color-mix(in srgb,var(--orange) 22%,transparent);
  background:#fffaf6;
}
@media(max-width:760px){
  .theme-palette-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .theme-palette-option{padding:7px;grid-template-columns:15px 24px minmax(0,1fr);gap:5px;min-height:50px}
  .theme-palette-preview{width:24px;height:24px;min-width:24px}
  .theme-palette-name{font-size:.76rem}
}
@media(min-width:1001px){.category-grid-home .category-card:nth-child(n+5):not(.category-card-more){display:none!important}.category-grid-home{grid-template-columns:repeat(4,minmax(0,1fr))}}
body.theme-dark-premium{color:var(--ink)}
body.theme-dark-premium .topbar,body.theme-dark-premium .form-card,body.theme-dark-premium .product-card,body.theme-dark-premium .category-card,body.theme-dark-premium .detail-card,body.theme-dark-premium .cart-card,body.theme-dark-premium .order-card,body.theme-dark-premium .settings-card{background:#252832;color:var(--ink);border-color:var(--line)}
body.theme-dark-premium input,body.theme-dark-premium textarea,body.theme-dark-premium select{background:#202229;color:var(--ink);border-color:var(--line)}
body.theme-dark-premium .hero{background:linear-gradient(120deg,#252832,#1b1d24);border-color:var(--line)}
body.theme-dark-premium .brand,body.theme-dark-premium .navlinks a{color:var(--ink)}


/* PALUGADA checkout: prioritize the customer input form over the shopping summary */
.layout:has(> section.panel form[action="/checkout-submit.php"]) {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .9fr);
  align-items: start;
  gap: 20px;
}
.layout:has(> section.panel form[action="/checkout-submit.php"]) > section.panel {
  min-width: 0;
}
.layout:has(> section.panel form[action="/checkout-submit.php"]) > aside.panel {
  min-width: 0;
  padding: 20px;
}
.layout:has(> section.panel form[action="/checkout-submit.php"]) .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.layout:has(> section.panel form[action="/checkout-submit.php"]) .field label {
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.layout:has(> section.panel form[action="/checkout-submit.php"]) .field input,
.layout:has(> section.panel form[action="/checkout-submit.php"]) .field select,
.layout:has(> section.panel form[action="/checkout-submit.php"]) .field textarea {
  box-sizing: border-box;
  min-width: 0;
}
@media (max-width: 900px) {
  .layout:has(> section.panel form[action="/checkout-submit.php"]) {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .layout:has(> section.panel form[action="/checkout-submit.php"]) .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Account entry added without removing existing mobile navigation items */
@media (max-width:640px){.mobile-bottom-nav{grid-template-columns:repeat(4,minmax(0,1fr));}}

/* Minimal regression fix: restore the approved compact cart label on the mobile homepage only. */
@media (max-width: 640px) {
  .home-product-item .add-cart-form > button[type="submit"] {
    font-size: 0;
    white-space: nowrap;
    min-height: 44px;
  }
  .home-product-item .add-cart-form > button[type="submit"]::after {
    content: "+ Keranjang";
    font-size: 14px;
    line-height: 1.2;
  }
}


/* PALUGADA: overlay diskon dan favorit hanya pada gambar card produk beranda. */
.product-image-wrap{position:relative;width:100%;background:#fff0df;overflow:hidden;aspect-ratio:1.15}
.product-image-wrap .product-image-link{display:block;width:100%;height:100%}
.product-image-wrap .product-image-link img,
.product-image-wrap .product-image-placeholder{display:block;width:100%;height:100%;aspect-ratio:auto;object-fit:cover;background:#fff0df}
.product-discount-badge{position:absolute;z-index:2;top:10px;left:10px;background:#e84b2c;color:#fff;padding:5px 8px;border-radius:7px;font-size:.78rem;font-weight:800;line-height:1}
.product-favorite-btn{position:absolute;z-index:3;top:8px;right:8px;width:34px;height:34px;display:grid;place-items:center;border:1px solid #eee;background:rgba(255,255,255,.96);border-radius:50%;color:#df3b3b;font-size:24px;line-height:1;cursor:pointer;padding:0}
.product-favorite-btn[aria-pressed="true"]{background:#fff0f0;border-color:#f2a0a0}
.product-favorite-btn[aria-pressed="true"] span{font-weight:800}
