/* Toko Online - Custom Styles */
/* Most styling via Tailwind CDN, this handles custom/animation styles */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #22c55e;
  --accent-dark: #16a34a;
}

* { box-sizing: border-box; }

body {
  font-family: 'Poppins', sans-serif;
  scroll-behavior: smooth;
}

/* Fade-in animation */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* WhatsApp floating button */
.wa-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  z-index: 1000;
  transition: transform 0.3s ease;
  text-decoration: none;
}
.wa-float:hover {
  transform: scale(1.1);
}
.wa-float svg {
  width: 32px;
  height: 32px;
  fill: white;
}

@keyframes pulse-wa {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
.wa-float { animation: pulse-wa 2s infinite; }
.wa-float:hover { animation: none; }

/* Card hover effects */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

/* Shopping cart badge */
.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Category filter buttons */
.filter-btn {
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.filter-btn:hover {
  border-color: var(--primary);
}
.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Cart sidebar */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100%;
  background: white;
  z-index: 2001;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}
.cart-sidebar.open {
  transform: translateX(0);
}

/* Admin styles */
.admin-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 24px;
  margin-bottom: 16px;
}

.admin-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}
.admin-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-primary {
  background: #2563eb;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}
.btn-primary:hover { background: #1d4ed8; }

.btn-danger {
  background: #ef4444;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}
.btn-danger:hover { background: #dc2626; }

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}
.btn-secondary:hover { background: #e5e7eb; }

/* Product image zoom on hover */
.produk-img-wrapper {
  overflow: hidden;
}
.produk-img-wrapper img {
  transition: transform 0.3s ease;
}
.produk-img-wrapper:hover img {
  transform: scale(1.05);
}

/* Responsive */
@media (max-width: 768px) {
  .wa-float {
    width: 52px;
    height: 52px;
    bottom: 16px;
    right: 16px;
  }
  .wa-float svg {
    width: 26px;
    height: 26px;
  }
  .cart-sidebar {
    width: 100vw;
    max-width: 100vw;
  }
}
