/* ============================================================
   VELDION V5 — components.css
   Komponen UI: tombol, kartu, badge, nav, form, modal, dsb.
   Bergantung pada tokens.css.
   ============================================================ */

/* ===== SECTION ===== */
.section {
  padding-block: var(--space-16);
}
@media (min-width: 768px) {
  .section { padding-block: var(--space-24); }
}

.section-alt {
  background: var(--bg-section);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}
.section-header .eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--silver);
  margin-bottom: var(--space-3);
  position: relative;
  padding-left: 28px;
}
.section-header .eyebrow::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 20px;
  height: 1px;
  background: var(--silver);
  transform: translateY(-50%);
}
.section-header h2 {
  font-size: var(--fs-3xl);
  color: var(--charcoal);
  margin-bottom: var(--space-3);
}
.section-header p {
  color: var(--text-muted);
  max-width: 560px;
  margin-inline: auto;
}

/* ===== BUTTONS ===== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn i[data-lucide] { width: 16px; height: 16px; }
.btn-lg i[data-lucide] { width: 18px; height: 18px; }
.btn-sm i[data-lucide] { width: 14px; height: 14px; }

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255,255,255,0.25) 50%,
    transparent 100%
  );
  transform: skewX(-20deg);
  transition: left 0.7s var(--ease-out);
  pointer-events: none;
  z-index: -1;
}
.btn:hover::before {
  left: 120%;
}

.btn:active {
  transform: scale(0.97);
  transition-duration: var(--duration-instant);
}

.btn-primary {
  background: var(--charcoal);
  color: var(--cream-50);
  box-shadow: 0 1px 2px rgba(26,28,31,0.06);
}
.btn-primary:hover {
  background: var(--silver-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-silver {
  background: var(--silver);
  color: var(--cream-50);
  box-shadow: 0 1px 2px rgba(26,28,31,0.06);
}
.btn-silver:hover {
  background: var(--silver-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--silver);
  color: var(--charcoal);
}
.btn-outline:hover {
  background: var(--silver-light);
  border-color: var(--silver-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-outline-inverse {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--cream-50);
}
.btn-outline-inverse:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--cream-50);
}

.btn-peach {
  background: var(--peach);
  color: var(--charcoal);
}
.btn-peach:hover {
  background: #E8C4A0;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-bronze {
  background: var(--bronze);
  color: var(--cream-50);
}
.btn-bronze:hover {
  background: #926A45;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-lg {
  padding: 16px 32px;
  font-size: var(--fs-base);
}
.btn-sm {
  padding: 8px 16px;
  font-size: var(--fs-xs);
}

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  background: var(--cream-200);
  color: var(--silver-dark);
  border: 1px solid var(--border);
  transition: all var(--duration) var(--ease-out);
}

.badge-success {
  background: rgba(94, 122, 94, 0.1);
  color: var(--success);
  border-color: rgba(94, 122, 94, 0.2);
}
.badge-warning {
  background: rgba(201, 154, 74, 0.1);
  color: var(--warning);
  border-color: rgba(201, 154, 74, 0.2);
}
.badge-error {
  background: rgba(184, 92, 74, 0.1);
  color: var(--error);
  border-color: rgba(184, 92, 74, 0.2);
}

.badge-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-dot-live {
  animation: pulse-dot 2s var(--ease-in-out) infinite;
}
.badge-dot-live::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
  animation: dotRing 2s var(--ease-in-out) infinite;
  pointer-events: none;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}
@keyframes dotRing {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(3); opacity: 0; }
}

/* ===== CARD ===== */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow-xs);
  transition: all var(--duration-slow) var(--ease-out);
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--silver-pale), transparent);
  opacity: 0;
  transition: opacity var(--duration) var(--ease-out);
}
.card-hover:hover {
  border-color: var(--silver-pale);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.card-hover:hover::before {
  opacity: 1;
}

.card-shine {
  position: relative;
  overflow: hidden;
}
.card-shine::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    110deg,
    transparent 40%,
    rgba(192, 197, 206, 0.06) 50%,
    transparent 60%
  );
  transition: left 0.8s var(--ease-out);
  pointer-events: none;
}
.card-shine:hover::after {
  left: 100%;
}

/* ===== INPUT & FORM ===== */
.input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  color: var(--text);
  transition: border-color var(--duration) var(--ease-out),
              box-shadow var(--duration) var(--ease-out);
}
.input:hover {
  border-color: var(--silver-pale);
}
.input:focus {
  outline: none;
  border-color: var(--silver);
  box-shadow: 0 0 0 3px rgba(138, 144, 149, 0.1);
}
.input::placeholder {
  color: var(--silver-light);
}

/* ===== SELECT ===== */
.select {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 36px 10px 14px;
  font-size: var(--fs-sm);
  color: var(--text);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A9095' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color var(--duration) var(--ease-out),
              box-shadow var(--duration) var(--ease-out);
}
.select:hover {
  border-color: var(--silver-pale);
}
.select:focus {
  outline: none;
  border-color: var(--silver);
  box-shadow: 0 0 0 3px rgba(138, 144, 149, 0.1);
}

/* ===== TOPBAR ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  background: var(--charcoal);
  color: var(--cream-50);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.topbar-group {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.topbar-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--silver-light);
  font-family: var(--font-mono);
  font-weight: var(--fw-semi);
  letter-spacing: 0.02em;
}
.topbar-item .label {
  color: var(--silver);
  font-family: var(--font-sans);
  font-weight: var(--fw-normal);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: var(--ls-wide);
}
.topbar-item .value {
  color: var(--cream-50);
}

.topbar-status {
  color: var(--cream-50);
  font-family: var(--font-sans);
  font-weight: var(--fw-semi);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
}

.topbar-date {
  display: none;
  align-items: center;
  gap: var(--space-3);
  padding-left: var(--space-4);
  border-left: 1px solid rgba(192, 197, 206, 0.15);
}
.topbar-date .date-value {
  color: var(--silver-light);
  font-family: var(--font-mono);
  font-weight: var(--fw-semi);
  letter-spacing: 0.02em;
  font-size: 11px;
}
@media (min-width: 1024px) {
  .topbar-date { display: inline-flex; }
}

.floating-date {
  position: fixed;
  top: calc(var(--topbar-h) + var(--header-h) + 10px);
  right: 14px;
  z-index: calc(var(--z-sticky) + 1);
  font-size: 10px;
  font-weight: var(--fw-semi);
  color: var(--silver-dark);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  background: transparent;
  border: none;
  padding: 0;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.floating-date.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (min-width: 1024px) {
  .floating-date { display: none; }
}

/* ===== HEADER / NAV ===== */
.site-header {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  background: rgba(245, 242, 236, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: border-color var(--duration) var(--ease-out),
              background var(--duration) var(--ease-out),
              box-shadow var(--duration) var(--ease-out);
}
.site-header.scrolled {
  background: rgba(245, 242, 236, 0.95);
  border-bottom-color: var(--border);
  box-shadow: 0 4px 20px rgba(26, 28, 31, 0.04);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1;
  text-decoration: none;
  transition: transform var(--duration) var(--ease-out);
}
.brand:hover {
  transform: translateY(-1px);
}
.brand-name {
  font-size: var(--fs-xl);
  font-weight: var(--fw-black);
  letter-spacing: -0.02em;
  color: var(--charcoal);
}
.brand-tag {
  font-size: 9px;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--silver);
  margin-top: 2px;
  font-weight: var(--fw-medium);
}

.nav-links {
  display: none;
  align-items: center;
  gap: var(--space-8);
}
@media (min-width: 1024px) {
  .nav-links { display: flex; }
}
.nav-links a {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--silver-dark);
  transition: color var(--duration) var(--ease-out);
  position: relative;
}
.nav-links a:hover {
  color: var(--charcoal);
}
.nav-links a.active {
  color: var(--charcoal);
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--silver);
  border-radius: var(--radius-full);
  transition: width var(--duration) var(--ease-out);
}
.nav-links a:hover::after {
  width: 60%;
}
.nav-links a.active::after {
  width: 100%;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--cream-200);
  border-top: 1px solid var(--border);
  padding-block: var(--space-12) var(--space-6);
  margin-top: var(--space-16);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1.2fr; gap: var(--space-12); }
}
.footer-brand { margin-bottom: var(--space-4); }
.footer-desc {
  font-size: var(--fs-sm);
  color: var(--silver-dark);
  line-height: var(--lh-loose);
}
.footer-title {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--charcoal);
  margin-bottom: var(--space-4);
}
.footer-link {
  display: block;
  padding: 6px 0;
  font-size: var(--fs-sm);
  color: var(--silver-dark);
  transition: color var(--duration) var(--ease-out),
              transform var(--duration) var(--ease-out);
}
.footer-link:hover {
  color: var(--charcoal);
  transform: translateX(4px);
}
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--space-6);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--silver);
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 900;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--charcoal);
  color: var(--cream-50);
  border: 1px solid rgba(192, 197, 206, 0.15);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(26, 28, 31, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.9);
  transition: all var(--duration-slow) var(--ease-out);
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.back-to-top:hover {
  background: var(--silver-dark);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(26, 28, 31, 0.3);
}
.back-to-top:active {
  transform: translateY(-1px) scale(0.95);
}
.back-to-top svg {
  width: 18px;
  height: 18px;
}
@media (max-width: 767px) {
  .back-to-top {
    right: 16px;
    bottom: 84px;
    width: 40px;
    height: 40px;
  }
  .back-to-top svg { width: 16px; height: 16px; }
}

/* ===== PAGE HEADER (base untuk semua halaman sub) ===== */
.page-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(245, 242, 236, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.page-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.page-header .brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}
.page-header .brand-name {
  font-size: var(--fs-lg);
  font-weight: var(--fw-black);
  letter-spacing: -0.02em;
  color: var(--charcoal);
}
.page-header .brand-tag {
  font-size: 9px;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--silver);
  font-weight: var(--fw-medium);
}
.page-header .actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ===== PAGE HEAD (base) ===== */
.page-head {
  padding: var(--space-10) 0 var(--space-6);
  text-align: center;
}
.page-head .eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--silver);
  margin-bottom: var(--space-3);
}
.page-head h1 {
  font-size: var(--fs-3xl);
  color: var(--charcoal);
  margin-bottom: var(--space-3);
}
.page-head p {
  color: var(--silver-dark);
  font-size: var(--fs-base);
  max-width: 560px;
  margin-inline: auto;
}
@media (max-width: 640px) {
  .page-head { padding: var(--space-8) 0 var(--space-4); }
  .page-head h1 { font-size: var(--fs-2xl); }
}

/* ===== MODAL (base untuk semua halaman) ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(26, 28, 31, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration) var(--ease-out),
              visibility var(--duration) var(--ease-out);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 440px;
  width: 100%;
  position: relative;
  transform: scale(0.95) translateY(12px);
  transition: transform var(--duration-slow) var(--ease-out);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream-100);
  border-radius: 50%;
  color: var(--silver-dark);
  cursor: pointer;
  border: none;
  transition: all var(--duration) var(--ease-out);
}
.modal-close:hover {
  background: var(--cream-200);
  color: var(--charcoal);
}
.modal-close svg,
.modal-close i[data-lucide] {
  width: 18px;
  height: 18px;
}

.modal-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-right: 32px;
}
.modal-img {
  width: 64px;
  height: 64px;
  background: var(--cream-100);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
  flex-shrink: 0;
}
.modal-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.modal-img .placeholder {
  font-family: var(--font-sans);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--silver);
}
.modal-title {
  font-size: var(--fs-lg);
  color: var(--charcoal);
  margin-bottom: 2px;
  line-height: 1.3;
}
.modal-cat {
  font-size: var(--fs-xs);
  color: var(--silver);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}

.modal-detail {
  display: flex;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--cream-200);
  font-size: var(--fs-sm);
}
.modal-detail:last-of-type {
  border-bottom: none;
}
.modal-detail .label {
  color: var(--silver-dark);
}
.modal-detail .value {
  color: var(--charcoal);
  font-weight: var(--fw-medium);
}
.modal-detail .value.price {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semi);
}

.modal-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: 14px;
  margin-top: var(--space-5);
  background: var(--charcoal);
  color: var(--cream-50);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  text-decoration: none;
  transition: all var(--duration) var(--ease-out);
}
.modal-wa:hover {
  background: var(--silver-dark);
  transform: translateY(-2px);
}
.modal-wa svg,
.modal-wa i[data-lucide] {
  width: 18px;
  height: 18px;
}

/* ===== TABLE UTILITY ===== */
.table-empty {
  text-align: center;
  color: var(--silver);
}

/* ===== ICON SIZE UTILITIES ===== */
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 18px; height: 18px; }
.icon-lg { width: 20px; height: 20px; }
.icon-xl { width: 24px; height: 24px; }

/* ===== HIDDEN UTILITY ===== */
.is-hidden { display: none !important; }

/* ===== UTILITAS ===== */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-mono   { font-family: var(--font-mono); font-weight: var(--fw-semi); }
.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mb-2  { margin-bottom: var(--space-2); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }

.hidden { display: none !important; }