/* =========================================================
   CSS VARIABLES
========================================================= */

:root {
  --header-height: 64px;
  --font-body: 'Manrope', Arial, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, serif;

  --primary: #d79fa7;
  --primary-light: #e6babf;
  --accent: #ecd0d4;
  --bg: #fbe7e8;
  --text: #5f3f46;
}


/* =========================================================
   BASE
========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background:
    linear-gradient(rgba(255,255,255,0.92), rgba(255,255,255,0.92)),
    repeating-linear-gradient(
      45deg,
      #f8dfe2,
      #f8dfe2 2px,
      #fbe7e8 2px,
      #fbe7e8 4px
    );
  color: var(--text);
}


footer {
  all: unset;
}

/* =========================================================
   HEADER (FIXED – SAFE)
========================================================= */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  background: var(--primary);
  color: #fff;
  padding: 10px 12px 10px 56px;
}

header,
.header-inner {
  overflow: visible;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-title {
  color: #fff;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
}

/* =========================================================
   TOOLBAR CATEGORY (STICKY)
========================================================= */

.toolbar {
  position: sticky;
  top: var(--header-height); /* 64px, pas di bawah header */
  z-index: 1100;
  background: #fff;
  margin: 0 -12px; /* align full width karena main pakai padding */
  border-bottom: 1px solid #eee;
}

/* category scroll horizontal */
.category-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px;
  position: relative;
  z-index: 1101;
}



/* =========================================================
   SEARCH
========================================================= */

.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  padding: 4px;
  border-radius: 8px;
}

.search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 8px 10px;
  font-size: 14px;
}

/* clear */
.search-clear {
  background: transparent;
  border: none;
  font-size: 14px;
  color: #999;
  cursor: pointer;
}

.search-clear:hover {
  color: #333;
}

/* search button */
.search-btn {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  border: none;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* spinner */
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* =========================================================
   CART
========================================================= */

.cart i {
  font-size: 20px;
  cursor: pointer;
  color: #fff;
}

.cart i:active {
  opacity: 0.8;
}

/* =========================================================
   MAIN (CONTENT OFFSET)
========================================================= */

main {
  padding:
    calc(var(--header-height) + 12px)
    12px
    24px;
}

/* =========================================================
   PRODUCT GRID
========================================================= */

.product-wrapper {
  position: relative;
  min-height: 300px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.product {
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #ddd;
}

/* =========================================================
   IMAGE SYSTEM (SHIMMER + BLUR + SPINNER)
========================================================= */

.img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

/* shimmer */
.img-shimmer {
  position: absolute;
  inset: 0;
  background: #eaeaea;
  z-index: 1;
}

.img-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,.7) 50%,
    rgba(255,255,255,0) 100%
  );
  animation: shimmer 1.3s infinite;
}

/* aktif kalau image error */
.img-wrap.image-error::after {
  opacity: 1;
}

.img-wrap.image-error {
  background:
    repeating-linear-gradient(
      45deg,
      #f4d7dc,
      #f4d7dc 3px,
      #fbe7e8 3px,
      #fbe7e8 6px
    );
}

/* image */
.product-img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
}

.product-img.blur {
  filter: blur(18px);
  transform: scale(1.05);
}

.product-img.blur.loaded {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
  transition:
    filter 0.6s ease,
    transform 0.6s ease,
    opacity 0.3s ease;
}

/* spinner */
.img-spinner {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-spinner::after {
  content: "";
  width: 28px;
  height: 28px;
  border: 3px solid rgba(0,0,0,.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* =========================================================
   PRODUCT BODY
========================================================= */

.product-body {
  padding: 8px;
}

.product-title {
  font-size: 15px;
  line-height: 1.3;
  font-weight: bold;
  height: 34px;
  overflow: hidden;
}

.detail-body h1,
.cart-header h2,
.auth-card h3 {
  font-family: var(--font-display);
  letter-spacing: 0.2px;
}

.sold-out {
  display: inline-block;
  font-weight: bold;
  color: #e53935;
  font-size: 14px;
}


.product-subtitle {
  font-size: 13px;
  line-height: 1.3;
  height: 34px;
  overflow: hidden;
}

.price-row {
  display: flex;
  gap: 6px;
  font-size: 13px;
  line-height: 1.4;
}

.price-label {
  flex: 1;
  color: #666;
}

.price-currency {
  width: 22px;
  text-align: right;
  color: var(--primary);
  font-weight: 500;
}

.price-value {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--primary);
}


.detail-body .detail-prices {
  margin: 8px 0 12px;
}

.detail-body .price-row {
  display: flex;
  gap: 6px;
  font-size: 14px;
  line-height: 1.5;
}

.detail-body .price-label {
  flex: 1;
  color: #555;
}

.detail-body .price-currency {
  width: 22px;
  text-align: right;
  color: var(--primary);
  font-weight: 500;
}

.detail-body .price-value {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}



/* =========================================================
   BUTTON
========================================================= */

.btn {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 6px;
  font-size: 13px;
  border-radius: 4px;
  cursor: pointer;
}

.btn:active {
  opacity: 0.9;
}

/* =========================================================
   GLOBAL SHIMMER (GRID LOADING)
========================================================= */

.product.shimmer {
  pointer-events: none;
}

.product.shimmer .img-wrap {
  background: #eee;
}

.shimmer-line,
.shimmer-btn {
  position: relative;
  overflow: hidden;
  background: #eee;
  border-radius: 6px;
}

.shimmer-line {
  height: 14px;
  margin: 8px 0;
}

.shimmer-line.w-80 { width: 80%; }
.shimmer-line.w-50 { width: 50%; }

.shimmer-btn {
  height: 36px;
  margin-top: 12px;
}

.shimmer-line::after,
.shimmer-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,.6) 50%,
    rgba(255,255,255,0) 100%
  );
  animation: shimmer 1.4s infinite;
}

/* =========================================================
   EMPTY STATE
========================================================= */

.empty-state {
  text-align: center;
  padding: 60px 0;
  color: #777;
}

.empty-state i {
  display: block;
  font-size: 48px;
  margin-bottom: 10px;
}

/* =========================================================
   BOTTOM NAV
========================================================= */

.app-menu-button {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 2100;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(95,63,70,0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.app-menu-button .bi {
  font-size: 24px;
}

.app-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2190;
  background: rgba(31, 18, 22, 0.35);
}

.app-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 2200;
  width: min(320px, 86vw);
  padding: 18px 16px 24px;
  background: #fffafb;
  box-shadow: 18px 0 40px rgba(95,63,70,0.18);
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.app-drawer.open {
  transform: translateX(0);
}

.app-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0dde0;
}

.app-drawer-brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.2px;
}

.app-drawer-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: #f7edef;
  color: var(--primary);
  cursor: pointer;
}

.app-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.app-drawer-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.app-drawer-nav a.active {
  background: #f8e6e8;
  color: var(--primary);
}

.app-drawer-nav .bi {
  font-size: 18px;
}

.app-drawer-actions {
  margin-top: auto;
}

.app-install-button {
  width: 100%;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.app-install-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.load-more {
  padding: 28px 0 16px;
  display: flex;
  justify-content: center;
}

.load-more-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #777;
}

/* spinner bulat */
.circle-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.detail-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(251, 231, 232, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-bottom: 1px solid rgba(95, 63, 70, 0.08);
  z-index: 1200;
}

.back-btn {
  position: absolute;
  left: 12px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  border: none;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-page {
  padding-top: 56px;
  padding-bottom: 40px;
  background: #f2f2f7;
}


.back-btn {
  font-size: 20px;
  border: none;
}

.detail-nav-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.detail-image {
  position: relative;
  margin: 0;
  max-width: none;
  width: 100%;
  background: #fff;
}

@media (max-width: 767px) {
  .detail-image,
  .carousel-wrapper {
    height: 48vh;
    max-height: 48vh;
  }

  .detail-image img,
  .detail-img {
    height: 48vh;
    max-height: 48vh;
    aspect-ratio: auto;
    object-fit: contain;
  }
}

.detail-image img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: contain;
}

.image-actions {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,.6);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:active {
  transform: scale(0.95);
}

.detail-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: contain;
}

.detail-body {
  padding: 0;
}

.detail-body h1 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 0.95;
  color: #4f3138;
}

.detail-sheet {
  background: #fff;
  border-radius: 22px 22px 18px 18px;
  padding: 16px 16px 20px;
  box-shadow: 0 -8px 20px rgba(95,63,70,0.06);
}

.detail-desc-block {
  margin: 6px 0 16px;
}

.detail-section-title {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #8b6a72;
}

.desc {
  font-size: 14px;
  line-height: 1.7;
  color: #5f3f46;
}

.detail-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 10px;
  border-top: 1px solid #eee;
}

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 6px;
}


/* =========================================================
   RESPONSIVE GRID
========================================================= */

/* Tablet */
@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Desktop */
@media (min-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
  }
}

/* =========================================================
   DETAIL LAYOUT (RESPONSIVE)
========================================================= */

.detail-container {
  display: block;
  margin: 0;
  padding: 0;
}

/* tombol cart biasa */
.btn-cart {
  margin-top: 16px;
}

/* DESKTOP MODE */
@media (min-width: 1024px) {
  .detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px;
    align-items: start;
  }

  .detail-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
}




/* =========================================================
   IMAGE ACTION BUTTONS (BIG BUTTON)
========================================================= */

.image-action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 14px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.btn-outline {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 124px;
  height: 36px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  background: #f2f2f7;
  border: 1px solid #ececf1;
  color: #2c2c2e;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.92);
  cursor: pointer;
  transition: background .2s ease, transform .15s ease;
}

.btn-outline i {
  font-size: 16px;
}

/* hover desktop */
.btn-outline:hover {
  background: #e9e9ee;
}

/* tap mobile */
.btn-outline:active {
  transform: scale(0.97);
}

@media (max-width: 767px) {
  .detail-page {
    padding-bottom: 28px;
  }

  .detail-sheet {
    border-radius: 0;
    box-shadow: none;
    padding: 14px 16px 20px;
  }

  .detail-body h1 {
    font-size: 28px;
    line-height: 1.02;
  }

  .detail-body .detail-prices {
    margin: 6px 0 12px;
  }

  .detail-body .price-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
  }
}

/* desktop spacing */

/* =========================================================
   TOAST NOTIFIER
========================================================= */

.toast {
  position: fixed;
  top: calc(var(--header-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;

  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;

  color: #fff;
  background: #333;
  box-shadow: 0 6px 16px rgba(0,0,0,.15);
  pointer-events: none;
}

/* success */
.toast.success {
  background: #43a047;
}

/* error */
.toast.error {
  background: #e53935;
}


/* =========================================================
   CONFIRM DIALOG
========================================================= */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 3000;

  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-box {
  width: 90%;
  max-width: 320px;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.confirm-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 8px;
}

.confirm-message {
  font-size: 14px;
  color: #555;
  margin-bottom: 16px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

/* tombol hapus */
.btn-danger {
  flex: 1;
  background: #e53935;
  color: #fff;
  border: none;
  border-radius: 8px;
  height: 40px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger:active {
  opacity: 0.9;
}

/* =========================================================
   CONTACT PAGE
========================================================= */

.contact-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}

.contact-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.contact-header i {
  font-size: 28px;
  color: var(--primary);
}

.contact-header h2 {
  margin: 0;
  font-size: 18px;
}

.contact-item {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.4;
}

.contact-item i {
  font-size: 18px;
  color: var(--primary);
  min-width: 20px;
}

.contact-item a {
  color: var(--primary);
  text-decoration: none;
  font-weight: bold;
}

.contact-item a:active {
  opacity: 0.8;
}

.category-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px;
}

.category-bar::-webkit-scrollbar {
  display: none;
}
.category-bar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.cat-btn {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #ead2d6;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  transition: all .2s ease;
  cursor: pointer;
}

.cat-btn:hover {
  background: #f9ecee;
}

.cat-btn.active {
  background: linear-gradient(135deg, #d79fa7, #c98f98);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(215,159,167,.28);
}


.table-order.full-width {
  width: 100%;
}

.qty-col {
  width: 140px;
}

.qty-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-box button {
  width: 32px;
  height: 32px;
  border: 1px solid #ddd;
  background: #f5f5f5;
  font-size: 18px;
  cursor: pointer;
}

.qty-box input {
  width: 60px;
  text-align: center;
}

.qty-box input::-webkit-outer-spin-button,
.qty-box input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-box input[type=number] {
  -moz-appearance: textfield;
}

.row-active {
  background: #fff4f6; /* soft pink / soft highlight */
}

.order-summary {
  margin: 12px 0;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 6px;

  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.order-summary > div:last-child {
  text-align: right;
  word-break: break-word;       /* ← biar angka nggak keluar */
}

.order-summary b {
  white-space: normal;
  word-break: break-word;
}

.order-error-bubble {
  position: relative;
  background: #fff0f0;
  border: 1px solid #ffb3b3;
  color: #b71c1c;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.4;
}

/* ekor baloon */
.order-error-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 30px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 8px 0 8px;
  border-color: #fff0f0 transparent transparent transparent;
}

.order-error-bubble::before {
  content: "";
  position: absolute;
  bottom: -9px;
  left: 29px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 9px 9px 0 9px;
  border-color: #ffb3b3 transparent transparent transparent;
}

.btn-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.bank-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.bank-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.order-news-row {
  width: 100%;
  margin-top: 6px;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  resize: vertical;
}
