/* =============================================
   UMKM Desa Rejomulyo – Custom CSS
   ============================================= */

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* ── Product card ──────────────────────────── */
.product-card .card-img {
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.product-card:hover .card-img { transform: scale(1.07); }

.product-card {
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.product-card:hover {
  box-shadow: 0 12px 36px 0 rgba(0,0,0,0.12);
  transform: translateY(-4px);
}

/* ── Skeleton shimmer ──────────────────────── */
@keyframes shimmer {
  0%   { background-position: -700px 0; }
  100% { background-position:  700px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 700px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 0.75rem;
}

/* ── WhatsApp button pulse ─────────────────── */
@keyframes waPulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(37,211,102,0.45); }
  50%       { box-shadow: 0 0 0 10px rgba(37,211,102,0);   }
}
.wa-btn-pulse { animation: waPulse 2.2s infinite; }

/* ── Product card entrance animation ──────── */
.product-card { animation: fadeInCard 0.35s ease both; }
@keyframes fadeInCard {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ── Responsive image placeholder ─────────── */
.img-wrap {
  background: linear-gradient(135deg, #fef9ec 0%, #fde68a 100%);
}

/* ── Stat counter animation ────────────────── */
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}
.stat-animated { animation: countUp 0.5s ease both; }

/* ══════════════════════════════════════════════
   MODAL SYSTEM
══════════════════════════════════════════════ */

/* Overlay backdrop */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  /* display: flex is added by JS */
}

/* Modal box */
.modal-box {
  position: relative;
  background: #fff;
  border-radius: 1.5rem;
  box-shadow: 0 24px 64px 0 rgba(0, 0, 0, 0.18);
  padding: 1.75rem;
  width: 100%;
  animation: modalIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(16px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

/* Close buttons */
.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  background: rgba(255,255,255,0.92);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: background 0.2s;
  cursor: pointer;
  border: none;
}
.modal-close-btn:hover { background: #fff; }

.modal-close-btn-sm {
  width: 2rem;
  height: 2rem;
  background: #f3f4f6;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  cursor: pointer;
  border: none;
  color: #6b7280;
  flex-shrink: 0;
}
.modal-close-btn-sm:hover { background: #e5e7eb; }

/* ── Scrollbar styling ─────────────────────── */
.modal-box::-webkit-scrollbar,
.overflow-y-auto::-webkit-scrollbar { width: 5px; }
.modal-box::-webkit-scrollbar-track,
.overflow-y-auto::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 999px;
}
.modal-box::-webkit-scrollbar-thumb,
.overflow-y-auto::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}
.modal-box::-webkit-scrollbar-thumb:hover,
.overflow-y-auto::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ══════════════════════════════════════════════
   FORM ELEMENTS
══════════════════════════════════════════════ */

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.375rem;
}

.form-input {
  width: 100%;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: #1f2937;
  background: #f9fafb;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: #f4b92a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(244, 185, 42, 0.15);
}

/* ══════════════════════════════════════════════
   MAP SECTION
══════════════════════════════════════════════ */

/* Invisible click overlay on map */
.map-click-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  cursor: pointer;
}

/* ══════════════════════════════════════════════
   ADMIN TOOLBAR
══════════════════════════════════════════════ */

#admin-toolbar {
  border-left: 4px solid #e8a012;
}

/* ══════════════════════════════════════════════
   TOAST NOTIFICATION
══════════════════════════════════════════════ */

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0);    }
}

#toast-container > div {
  animation: slideInRight 0.3s ease both;
}

/* ══════════════════════════════════════════════
   KERANJANG BELANJA (CART)
══════════════════════════════════════════════ */

/* Badge keranjang di header */
.cart-badge {
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 3px;
}

/* Animasi bounce saat item ditambah */
@keyframes cartBounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.5); }
  60%  { transform: scale(0.85); }
  100% { transform: scale(1); }
}
.cart-badge-bounce {
  animation: cartBounce 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Tombol keranjang di kartu produk */
.cart-btn {
  transition: all 0.2s ease;
}
.cart-btn:active {
  transform: scale(0.9);
}

/* Item di daftar keranjang */
.cart-item {
  animation: fadeInCard 0.25s ease both;
  transition: background 0.2s;
}
.cart-item:hover {
  background: #f3f4f6;
}

/* ══════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════ */

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.pagination-btn:hover:not(:disabled) {
  border-color: #f4b92a;
}
.pagination-btn:disabled {
  cursor: not-allowed;
}

.pagination-active {
  background: #e8a012;
  border-color: #e8a012;
  color: #fff;
  box-shadow: 0 2px 8px rgba(232, 160, 18, 0.35);
}
.pagination-active:hover {
  background: #cc7d0c;
  border-color: #cc7d0c;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  color: #9ca3af;
  font-size: 0.875rem;
  font-weight: 600;
  user-select: none;
}

/* ══════════════════════════════════════════════
   UPLOAD GAMBAR
══════════════════════════════════════════════ */

/* Upload area hover */
#upload-label {
  transition: all 0.2s ease;
}
#upload-label:hover {
  transform: translateY(-1px);
}

/* Preview gambar */
#img-preview-wrap img {
  transition: opacity 0.3s ease;
}

/* ══════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
══════════════════════════════════════════════ */

@media (max-width: 640px) {
  .modal-box { padding: 1.25rem; border-radius: 1.25rem; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-overlay .modal-box {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: 95vh;
  }

  /* Tombol keranjang lebih kecil di mobile */
  .cart-btn {
    width: 2.25rem;
    height: 2.25rem;
  }

  /* Pagination lebih compact */
  .pagination-btn {
    min-width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
  }
}
