/* Kuskuskuy VPS Final UI Patch v1.0.0
   Scope: typography, rounded brand logos, homepage categories, floating WhatsApp,
   centered footer, product-detail mobile precision, premium QRIS invoice page,
   and small admin-brand consistency tweaks. No database or runtime-secret changes. */

:root {
  --kky-font: "Plus Jakarta Sans", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --kky-bronze: #a96839;
  --kky-bronze-dark: #80502f;
  --kky-bronze-soft: #f5e9dd;
  --kky-success: #198754;
  --kky-success-soft: #edf9f1;
  --kky-ink: #171717;
  --kky-muted: #726b65;
  --kky-line: #e9e2da;
}

html,
body,
button,
input,
textarea,
select {
  font-family: var(--kky-font);
}

body {
  font-weight: 400;
}

.brand strong,
.admin-brand strong {
  font-weight: 700;
}

h1,
h2,
h3,
.product-body h3,
.detail-price,
.product-price-row strong {
  font-family: var(--kky-font);
}

.brand img,
.footer-brand img,
.admin-brand img,
.payment-brand-logo {
  border-radius: 22%;
  overflow: hidden;
  background: #fff;
}

/* Homepage: compact modern category chips */
.category-chip-section {
  margin-top: 48px;
}

.category-chip-heading {
  margin-bottom: 18px;
}

.category-chip-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.category-chip {
  min-width: 0;
  min-height: 66px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(142, 100, 62, .13);
  border-radius: 16px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 8px 24px rgba(64, 40, 21, .045);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

.category-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(166, 107, 63, .28);
  background: #fff;
  box-shadow: 0 12px 28px rgba(64, 40, 21, .08);
}

.category-chip-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #f8eee5, #f4e4d5);
  color: var(--kky-bronze-dark);
}

.category-chip-icon .icon {
  width: 19px;
  height: 19px;
}

.category-chip-copy {
  min-width: 0;
  flex: 1;
}

.category-chip-copy strong,
.category-chip-copy small {
  display: block;
}

.category-chip-copy strong {
  overflow: hidden;
  color: #28231f;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-chip-copy small {
  margin-top: 3px;
  color: #948a81;
  font-size: 9px;
  font-weight: 500;
}

.category-chip-arrow {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #a4866d;
}

.category-chip-arrow .icon {
  width: 13px;
  height: 13px;
}

.category-chip-all {
  border-color: rgba(166, 107, 63, .22);
  background: linear-gradient(145deg, #fffaf5, #f8eee5);
}

.category-chip-all .category-chip-icon {
  background: var(--kky-bronze);
  color: #fff;
}

/* Floating WhatsApp: clean brand button, label appears on desktop hover */
.floating-wa {
  width: 58px;
  height: 58px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  box-shadow: 0 14px 34px rgba(18, 128, 68, .32);
  transition: width .26s ease, transform .2s ease, box-shadow .2s ease;
}

.floating-wa:hover {
  width: 178px;
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(18, 128, 68, .38);
}

.floating-wa-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
}

.floating-wa-icon svg {
  width: 29px;
  height: 29px;
}

.floating-wa-label {
  padding-right: 17px;
  opacity: 0;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  transition: opacity .16s ease .05s;
}

.floating-wa:hover .floating-wa-label {
  opacity: 1;
}

/* Footer: centered and symmetrical */
.site-footer .shell {
  width: min(1240px, calc(100% - 56px));
  margin-inline: auto;
}

.site-footer .footer-grid {
  align-items: start;
  grid-template-columns: minmax(0, 1.65fr) minmax(150px, .7fr) minmax(180px, .8fr);
  gap: clamp(38px, 6vw, 82px);
}

.site-footer .footer-grid > div {
  min-width: 0;
}

.site-footer .footer-bottom {
  justify-content: center;
  align-items: center;
  gap: 14px 24px;
  flex-wrap: wrap;
  text-align: center;
}

/* Product detail mobile precision */
@media (max-width: 800px) {
  body[data-page="product"] {
    overflow-x: hidden;
  }

  body[data-page="product"] main {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
  }

  body[data-page="product"] .shell {
    width: calc(100% - 32px);
    max-width: calc(100% - 32px);
    margin-inline: 16px;
  }

  body[data-page="product"] .product-detail {
    width: auto;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding-top: 18px;
  }

  body[data-page="product"] .gallery,
  body[data-page="product"] .product-info,
  body[data-page="product"] .detail-content,
  body[data-page="product"] .detail-content article {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body[data-page="product"] .gallery-main {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    overflow: hidden;
  }

  body[data-page="product"] .gallery-main img {
    width: 100%;
    height: 100%;
    padding: 10px;
    object-fit: contain;
  }

  body[data-page="product"] .gallery-thumbs {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 10px;
    margin-top: 12px;
    padding: 2px 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body[data-page="product"] .gallery-thumbs::-webkit-scrollbar {
    display: none;
  }

  body[data-page="product"] .gallery-thumbs button {
    flex: 0 0 80px;
    width: 80px;
    min-width: 80px;
    height: 80px;
    padding: 4px;
    border-radius: 12px;
    scroll-snap-align: start;
  }

  body[data-page="product"] .gallery-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
  }

  body[data-page="product"] .product-info h1 {
    max-width: 100%;
    margin: 13px 0;
    font-size: clamp(29px, 8.6vw, 38px);
    line-height: 1.12;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
  }

  body[data-page="product"] .lead,
  body[data-page="product"] .detail-content p,
  body[data-page="product"] .detail-content li,
  body[data-page="product"] .detail-facts span {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  body[data-page="product"] .detail-content {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-top: 38px;
  }

  body[data-page="product"] .detail-content article {
    overflow: hidden;
  }

  body[data-page="product"] .product-mobile-bar {
    width: 100%;
    max-width: 100vw;
    grid-template-columns: minmax(76px, .72fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 7px;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  body[data-page="product"] .product-mobile-bar .button {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  body[data-page="product"] .product-mobile-bar .button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Simple QRIS invoice page */
body[data-page="payment"] {
  min-height: 100vh;
  padding: 0;
  overflow-x: hidden;
  background: #f7f3ef;
}

.payment-main {
  min-height: 100vh;
  display: grid;
  place-items: start center;
}

.payment-invoice-wrap {
  width: min(560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.payment-invoice-card {
  width: 100%;
  padding: 28px;
  border: 1px solid #e8ded5;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(72, 45, 24, .08);
}

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

.payment-invoice-brand {
  width: max-content;
  max-width: 100%;
  margin: 0 auto 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.payment-brand-logo {
  width: 46px;
  height: 46px;
  object-fit: cover;
}

.payment-invoice-brand span,
.payment-invoice-brand strong,
.payment-invoice-brand small { display: block; }

.payment-invoice-brand strong {
  color: #17130f;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.payment-invoice-brand small {
  margin-top: 2px;
  color: #8d857e;
  font-size: 10px;
  font-weight: 500;
}

.payment-invoice-header h1 {
  margin: 0;
  color: #17130f;
  font-size: clamp(25px, 6vw, 31px);
  font-weight: 800;
  letter-spacing: -.035em;
}

.payment-invoice-number {
  margin-top: 8px;
  display: inline-block;
  color: #8f5e3b;
  font-size: 11px;
  font-weight: 700;
}

.payment-total-hero {
  margin-top: 22px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 15px;
  background: #f7efe8;
}

.payment-total-hero span {
  color: #5d5148;
  font-size: 12px;
  font-weight: 700;
}

.payment-total-hero strong {
  color: #a76233;
  font-size: clamp(25px, 6vw, 32px);
  font-weight: 800;
  letter-spacing: -.04em;
}

.payment-state-panel {
  margin-top: 12px;
  padding: 13px 15px;
  border: 1px solid #e2ded9;
  border-radius: 14px;
  background: #faf9f7;
}

.payment-state-panel.pending { border-color: #d5e8dc; background: #f2faf5; }
.payment-state-panel.paid { border-color: #cce6d5; background: #eff9f2; }
.payment-state-panel.expired,
.payment-state-panel.failed { border-color: #f0d2ca; background: #fff6f3; }

.payment-state-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-state-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(25,135,84,.1);
  color: var(--kky-success);
}

.payment-state-icon .icon { width: 14px; height: 14px; }
.payment-state-panel.expired .payment-state-icon,
.payment-state-panel.failed .payment-state-icon { background: #fde7e0; color: #b64c32; }

.payment-state-line strong {
  color: var(--kky-success);
  font-size: 11px;
  font-weight: 700;
}

.payment-state-panel.expired .payment-state-line strong,
.payment-state-panel.failed .payment-state-line strong { color: #a4432e; }

.payment-deadline {
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #746d67;
  font-size: 9px;
}

.payment-deadline .icon { width: 13px; height: 13px; }

.payment-countdown {
  margin-top: 6px;
  color: #2d7650;
  font-size: 10px;
  font-weight: 700;
}

.payment-qris-stage {
  margin-top: 18px;
  text-align: center;
}

.payment-qr-frame {
  width: min(350px, 100%);
  margin: 0 auto;
  padding: 11px;
  border: 1px solid #e7ddd4;
  border-radius: 16px;
  background: #fff;
}

.payment-qr-frame img {
  width: 100%;
  height: auto;
  display: block;
  border: 0;
  border-radius: 6px;
}

.payment-qris-helper {
  width: min(390px, 100%);
  margin: 10px auto 0;
  color: #706861;
  font-size: 10px;
  line-height: 1.5;
}

.payment-qris-helper strong { color: #312922; }

.payment-quick-actions {
  width: min(430px, 100%);
  margin: 14px auto 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.payment-action-button,
.payment-support-button {
  min-height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}

.payment-action-button:hover,
.payment-support-button:hover { transform: translateY(-1px); }

.payment-action-button .icon,
.payment-support-button .icon,
.payment-support-button svg { width: 15px; height: 15px; }

.payment-action-button.secondary {
  border: 1px solid #b98259;
  background: #fff;
  color: #965c35;
}

.payment-action-button.primary {
  border: 1px solid #a86638;
  background: #a86638;
  color: #fff;
  box-shadow: 0 8px 18px rgba(155,96,55,.14);
}

.payment-action-button:disabled {
  opacity: .6;
  cursor: wait;
  transform: none;
}

.payment-invoice-summary {
  margin-top: 16px;
  padding: 15px 16px;
  border: 1px solid #e8ded5;
  border-radius: 14px;
  background: #fff;
}

.payment-summary-row,
.payment-summary-total {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.payment-summary-row + .payment-summary-row { margin-top: 9px; }

.payment-summary-row span {
  max-width: 70%;
  color: #544d47;
  font-size: 10px;
  line-height: 1.45;
}

.payment-summary-row strong {
  flex: 0 0 auto;
  color: #26211d;
  font-size: 10px;
  font-weight: 700;
}

.payment-summary-total {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid #ece4dd;
  align-items: center;
}

.payment-summary-total span {
  color: #201c19;
  font-size: 11px;
  font-weight: 700;
}

.payment-summary-total strong {
  color: #9c6037;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.025em;
}

.payment-howto {
  margin-top: 14px;
  border: 1px solid #e8ded5;
  border-radius: 13px;
  background: #fff;
  overflow: hidden;
}

.payment-howto summary {
  min-height: 46px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
}

.payment-howto summary::-webkit-details-marker { display: none; }

.payment-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #2b2521;
  font-size: 11px;
}

.payment-section-title .icon,
.payment-howto-chevron .icon { width: 15px; height: 15px; }

.payment-howto-chevron {
  display: inline-flex;
  color: #8a7d73;
  transition: transform .16s ease;
}

.payment-howto[open] .payment-howto-chevron { transform: rotate(90deg); }

.payment-howto-list {
  margin: 0;
  padding: 0 18px 14px 38px;
  color: #625a54;
  font-size: 10px;
  line-height: 1.7;
}

.payment-qris-unavailable {
  padding: 24px 18px;
  border: 1px solid #f0d2ca;
  border-radius: 15px;
  background: #fff6f3;
  color: #9b4935;
}

.payment-qris-unavailable > .icon {
  width: 26px;
  height: 26px;
  margin: 0 auto 8px;
}

.payment-qris-unavailable strong,
.payment-qris-unavailable p { display: block; }

.payment-qris-unavailable p {
  margin: 6px 0 0;
  font-size: 10px;
  line-height: 1.55;
}

.payment-result {
  margin-top: 18px;
  padding: 24px 18px;
  border-radius: 16px;
  text-align: center;
}

.payment-result-success { border: 1px solid #cfe8d8; background: #f1faf4; }
.payment-result-problem { border: 1px solid #f0d2ca; background: #fff6f3; }

.payment-result-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 11px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dff3e6;
  color: var(--kky-success);
}

.payment-result-problem .payment-result-icon { background: #fde7e0; color: #b64c32; }
.payment-result-icon .icon { width: 25px; height: 25px; }

.payment-result h2 { margin: 0; font-size: 20px; font-weight: 800; }
.payment-result p {
  width: min(430px, 100%);
  margin: 7px auto 0;
  color: #6f6862;
  font-size: 10px;
  line-height: 1.6;
}

.payment-support-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.payment-support-button {
  border: 1px solid #ded6cf;
  background: #fff;
  color: #534b45;
}

.payment-support-button.whatsapp {
  border-color: #bfe8ce;
  background: #f3fbf6;
  color: #168449;
}

.payment-support-button:disabled {
  opacity: .58;
  cursor: wait;
  transform: none;
}

.payment-auto-note {
  margin: 11px 0 0;
  color: #9a9189;
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 800px) {
  .payment-invoice-wrap { padding: 18px 0; }
}

@media (max-width: 560px) {
  .payment-invoice-wrap {
    width: calc(100% - 20px);
    padding: 10px 0 16px;
  }

  .payment-invoice-card {
    padding: 21px 15px 18px;
    border-radius: 18px;
  }

  .payment-invoice-brand { margin-bottom: 17px; }
  .payment-brand-logo { width: 43px; height: 43px; }
  .payment-invoice-brand strong { font-size: 16px; }

  .payment-total-hero {
    padding: 14px;
    gap: 10px;
  }

  .payment-total-hero strong { font-size: 25px; }
  .payment-state-panel { padding: 12px 13px; }
  .payment-qr-frame { width: min(325px, 100%); padding: 9px; }

  .payment-quick-actions,
  .payment-support-actions { gap: 7px; }

  .payment-action-button,
  .payment-support-button {
    min-height: 43px;
    padding-inline: 9px;
    font-size: 9.5px;
  }

  .payment-invoice-summary { padding: 14px 13px; }
  .payment-summary-row { gap: 10px; }
  .payment-summary-row span { max-width: 64%; }
}

@media (max-width: 360px) {
  .payment-quick-actions,
  .payment-support-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .payment-action-button,
  .payment-support-button,
  .payment-howto-chevron { transition: none; }
}

/* Admin consistency */
.admin-brand img {
  border-radius: 22%;
}

.admin-shell,
.admin-content,
.admin-form input,
.admin-form textarea,
.admin-form select,
.admin-button {
  font-family: var(--kky-font);
}

@media (max-width: 1120px) {
  .category-chip-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .category-chip-section {
    margin-top: 36px;
  }

  .category-chip-grid {
    display: flex;
    gap: 10px;
    margin-inline: -16px;
    padding: 2px 16px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .category-chip-grid::-webkit-scrollbar {
    display: none;
  }

  .category-chip {
    flex: 0 0 176px;
    min-height: 62px;
    scroll-snap-align: start;
  }

  .category-chip-copy strong {
    font-size: 11px;
  }

  .floating-wa,
  .floating-wa:hover {
    right: 15px;
    bottom: 102px;
    width: 54px;
    height: 54px;
    transform: none;
  }

  .floating-wa-icon {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
  }

  .floating-wa-icon svg {
    width: 27px;
    height: 27px;
  }

  .floating-wa-label {
    display: none;
  }

  .site-footer .shell {
    width: calc(100% - 32px);
  }

  .site-footer .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px 24px;
  }

  .site-footer .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }

}

@media (max-width: 560px) {
  .category-chip-heading p {
    max-width: 94%;
  }

  .category-chip {
    flex-basis: 166px;
  }

  .site-footer .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .site-footer .footer-grid > div:first-child {
    grid-column: auto;
  }


  body[data-page="product"] .gallery-thumbs button {
    flex-basis: 76px;
    width: 76px;
    min-width: 76px;
    height: 76px;
  }

  body[data-page="product"] .product-mobile-bar {
    grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
  }

  body[data-page="product"] .product-mobile-bar .button {
    padding-inline: 5px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .category-chip,
  .floating-wa,
  .floating-wa-label,
  .payment-action-button,
  .payment-support-button {
    transition: none;
  }
}
