/*
 * Sunnah Club Loyalty — Widget CSS
 * Floating button + popup panel
 */

/* =========================================================================
   Floating Action Button
   ========================================================================= */

.scl-fab {
  position: fixed;
  bottom: 1.5rem;
  z-index: 9998;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  /* Metallic gold so it stands out on both the dark-green footer and light pages */
  background: linear-gradient(145deg, #d8ab48 0%, #b4842c 100%);
  cursor: pointer;
  /* Cream ring + soft dark shadow keep it separated from any background */
  border: 2px solid rgba(254, 243, 218, 0.9);
  box-shadow: 0 4px 18px rgba(27, 28, 26, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.scl-fab--bottom-left  { left: 1.5rem; }
.scl-fab--bottom-right { right: 1.5rem; }

.scl-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 26px rgba(27, 28, 26, 0.5);
}

.scl-fab:focus-visible {
  outline: 3px solid var(--scl-secondary, #775a19);
  outline-offset: 2px;
}

.scl-fab__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.scl-fab__logo {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  filter: brightness(0) invert(1);
  display: block;
}

.scl-fab__points {
  color: #00322a;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  text-align: center;
  line-height: 1;
}

.scl-fab__pts-number {
  font-size: 1rem;
  display: block;
}

.scl-fab__pts-label {
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  opacity: 0.8;
  display: block;
  margin-top: 1px;
}

/* =========================================================================
   Popup overlay
   ========================================================================= */

.scl-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.scl-popup.is-open {
  pointer-events: all;
}

.scl-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 28, 26, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.scl-popup.is-open .scl-popup__backdrop {
  opacity: 1;
}

/* Panel — mobile: bottom sheet */
.scl-popup__panel {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--scl-bg, #fbf9f5);
  border-radius: 1rem 1rem 0 0;
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -8px 40px rgba(27, 28, 26, 0.15);
  -webkit-overflow-scrolling: touch;
}

/* Scrollbar styling */
.scl-popup__panel::-webkit-scrollbar { width: 4px; }
.scl-popup__panel::-webkit-scrollbar-track { background: transparent; }
.scl-popup__panel::-webkit-scrollbar-thumb { background: rgba(0, 50, 42, 0.2); border-radius: 2px; }

.scl-popup.is-open .scl-popup__panel {
  transform: translateY(0);
}

/* Desktop: floating card anchored near FAB */
@media (min-width: 480px) {
  .scl-popup__panel {
    bottom: 6rem;
    left: 1.5rem;
    right: auto;
    width: 420px;
    max-width: calc(100vw - 3rem);
    border-radius: 1rem;
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
  }

  .scl-popup--right .scl-popup__panel {
    left: auto;
    right: 1.5rem;
  }

  .scl-popup.is-open .scl-popup__panel {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* =========================================================================
   Close button
   ========================================================================= */

.scl-popup__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--scl-primary, #00322a);
  padding: 0.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  transition: background 0.2s;
}

.scl-popup__close:hover {
  background: rgba(0, 50, 42, 0.08);
}

.scl-popup__close .material-symbols-outlined {
  font-size: 1.25rem;
}

/* =========================================================================
   Header
   ========================================================================= */

.scl-popup__header {
  text-align: center;
  margin-bottom: 1.25rem;
  padding-top: 0.25rem;
}

.scl-popup__logo {
  height: 2.5rem;
  width: auto;
  object-fit: contain;
  margin-bottom: 0.5rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.scl-popup__title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--scl-primary, #00322a);
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

/* =========================================================================
   Balance card
   ========================================================================= */

.scl-popup__balance-card {
  background: var(--scl-primary, #00322a);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  color: #fff;
  gap: 1rem;
}

.scl-account__balance-card {
  max-width: 480px;
}

.scl-popup__balance-left {
  flex: 1;
  min-width: 0;
}

.scl-popup__points-number {
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

.scl-popup__points-label {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-top: 0.25rem;
}

.scl-popup__points-value {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-top: 0.5rem;
}

.scl-popup__balance-right {
  flex-shrink: 0;
  position: relative;
  width: 5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================================================================
   Progress ring
   ========================================================================= */

.scl-ring {
  width: 5rem;
  height: 5rem;
  transform: rotate(-90deg);
  position: absolute;
  top: 0;
  left: 0;
}

.scl-ring__track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 6;
}

.scl-ring__fill {
  fill: none;
  stroke: var(--scl-secondary, #775a19);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 213.628;
  stroke-dashoffset: 213.628;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scl-ring__text {
  position: relative;
  z-index: 1;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  font-family: 'Cinzel', serif;
}

/* =========================================================================
   Guest panel
   ========================================================================= */

.scl-popup__guest {
  text-align: center;
  padding: 1rem 0 1.5rem;
}

.scl-popup__guest p {
  color: #555;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* =========================================================================
   Tabs
   ========================================================================= */

.scl-tabs {
  display: flex;
  border-bottom: 1px solid rgba(0, 50, 42, 0.12);
  margin-bottom: 1rem;
  gap: 0;
}

.scl-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.625rem 0.125rem;
  font-family: 'Cinzel', serif;
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  color: #707976;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

@media (min-width: 360px) {
  .scl-tab {
    font-size: 0.6875rem;
    padding: 0.625rem 0.25rem;
  }
}

.scl-tab.active,
.scl-tab:hover {
  color: var(--scl-primary, #00322a);
}

.scl-tab.active {
  border-bottom-color: var(--scl-primary, #00322a);
  font-weight: 700;
}

/* =========================================================================
   Panels
   ========================================================================= */

.scl-panels {
  min-height: 8rem;
}

.scl-panel {
  display: none;
  animation: sclFadeIn 0.2s ease;
}

.scl-panel.active {
  display: block;
}

@keyframes sclFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   Earn rows
   ========================================================================= */

.scl-earn-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem;
  background: var(--scl-bg-row, #f5f3ef);
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
}

.scl-earn-row:last-child {
  margin-bottom: 0;
}

.scl-earn-row__icon {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  background: rgba(0, 50, 42, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scl-earn-row__icon .material-symbols-outlined {
  font-size: 1.25rem;
  color: var(--scl-primary, #00322a);
}

.scl-earn-row__body {
  flex: 1;
  min-width: 0;
}

.scl-earn-row__title {
  font-family: 'Cinzel', serif;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--scl-primary, #00322a);
  line-height: 1.3;
}

.scl-earn-row__desc {
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.125rem;
  line-height: 1.4;
}

/* =========================================================================
   Redeem form
   ========================================================================= */

.scl-redeem-summary {
  font-size: 0.8125rem;
  color: #555;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--scl-bg-row, #f5f3ef);
  border-radius: 0.5rem;
  display: none;
}

.scl-redeem-summary.visible {
  display: block;
}

.scl-redeem-form {
  margin-bottom: 0.25rem;
}

.scl-label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 0.375rem;
}

.scl-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid rgba(0, 50, 42, 0.2);
  background: #fff;
  font-family: 'Cinzel', serif;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
  box-sizing: border-box;
  transition: border-color 0.2s;
  color: #1b1c1a;
}

.scl-input:focus {
  outline: none;
  border-color: var(--scl-primary, #00322a);
}

.scl-redeem-preview {
  font-size: 0.8125rem;
  color: var(--scl-secondary, #775a19);
  font-weight: 600;
  margin-bottom: 0.75rem;
  min-height: 1.25rem;
}

/* =========================================================================
   Buttons
   ========================================================================= */

.scl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.75rem 1.25rem;
  background: var(--scl-primary, #00322a);
  color: #fff;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
  box-sizing: border-box;
}

.scl-btn:hover {
  background: var(--scl-primary-dark, #004b40);
  color: #fff;
  text-decoration: none;
}

.scl-btn:active {
  transform: scale(0.98);
}

.scl-btn:disabled,
.scl-btn.is-loading {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.scl-btn--outline {
  background: transparent;
  border: 1.5px solid var(--scl-primary, #00322a);
  color: var(--scl-primary, #00322a);
}

.scl-btn--outline:hover {
  background: rgba(0, 50, 42, 0.06);
  color: var(--scl-primary, #00322a);
}

.scl-btn--full {
  width: 100%;
  margin-bottom: 0.5rem;
}

.scl-btn--sm {
  padding: 0.5rem 0.875rem;
  font-size: 0.6875rem;
  white-space: nowrap;
}

/* =========================================================================
   Divider
   ========================================================================= */

.scl-divider {
  text-align: center;
  color: #999;
  font-size: 0.75rem;
  margin: 0.75rem 0;
  position: relative;
}

.scl-divider::before,
.scl-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: rgba(0, 50, 42, 0.1);
}

.scl-divider::before { left: 0; }
.scl-divider::after  { right: 0; }

/* =========================================================================
   Redeem result
   ========================================================================= */

.scl-redeem-result {
  margin-top: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  display: none;
  line-height: 1.5;
}

.scl-redeem-result.visible {
  display: block;
}

.scl-redeem-result.success {
  background: #e8f4f1;
  border: 1px solid rgba(0, 50, 42, 0.2);
  color: #00322a;
}

.scl-redeem-result.error {
  background: #ffdad6;
  border: 1px solid rgba(186, 26, 26, 0.2);
  color: #ba1a1a;
}

.scl-result-label {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.scl-result-code {
  font-family: 'Cinzel', serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--scl-primary, #00322a);
  letter-spacing: 0.1em;
  word-break: break-all;
}

.scl-result-copy {
  margin-top: 0.625rem;
}

/* =========================================================================
   Coupon codes list
   ========================================================================= */

.scl-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--scl-bg-row, #f5f3ef);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.scl-code-info {
  flex: 1;
  min-width: 0;
}

.scl-code-value {
  font-family: 'Cinzel', serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--scl-primary, #00322a);
  letter-spacing: 0.05em;
  word-break: break-all;
}

.scl-code-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

.scl-code-type-badge {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  background: var(--scl-secondary, #775a19);
  color: #fff;
}

.scl-code-amount {
  font-size: 0.75rem;
  color: var(--scl-secondary, #775a19);
  font-weight: 600;
}

.scl-code-copy {
  flex-shrink: 0;
  font-size: 0.6875rem;
  padding: 0.375rem 0.75rem;
}

/* =========================================================================
   History list
   ========================================================================= */

.scl-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0;
  border-bottom: 1px solid rgba(0, 50, 42, 0.07);
  gap: 0.5rem;
}

.scl-history-row:last-child {
  border-bottom: none;
}

.scl-history-body {
  flex: 1;
  min-width: 0;
}

.scl-history-type {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.scl-history-date {
  font-size: 0.6875rem;
  color: #777;
  margin-top: 0.125rem;
}

.scl-history-pts {
  font-family: 'Cinzel', serif;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.scl-history-pts--positive { color: var(--scl-primary, #00322a); }
.scl-history-pts--negative { color: #ba1a1a; }

/* =========================================================================
   Empty state
   ========================================================================= */

.scl-empty {
  color: #777;
  font-size: 0.8125rem;
  text-align: center;
  padding: 1.5rem 0;
  margin: 0;
}

/* =========================================================================
   My Account page overrides
   ========================================================================= */

.scl-account {
  max-width: 700px;
}

.scl-account__title {
  font-family: 'Cinzel', serif;
  color: var(--scl-primary, #00322a);
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  letter-spacing: 0.05em;
}

/* Wider tabs on account page */
.scl-account .scl-tab {
  font-size: 0.75rem;
  padding: 0.75rem 0.5rem;
}
