/* =========================================================
   Smart Widget - storefront styles
   ========================================================= */

/* ---------- Popup ---------- */
.sw-popup-overlay[hidden],
.sw-popup[hidden] { display: none; }

.sw-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  animation: sw-fade-in 0.2s ease-out;
}

.sw-popup {
  --sw-primary: #9b0d23;
  --sw-primary-dark: #7d0a1c;
  --sw-text: #2b2b2b;
  --sw-width: 440px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--sw-width);
  max-width: calc(100% - 32px);
  max-height: calc(100vh - 32px);
  overflow: hidden auto;
  box-sizing: border-box;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  color: #555;
  z-index: 9999;
  animation: sw-pop-in 0.22s ease-out;
}

.sw-popup-x {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: #555;
  font-size: 22px;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}
.sw-popup-x:hover { background: rgba(0, 0, 0, 0.14); }

/* --- text popup --- */
.sw-popup-content { padding: 34px 28px 6px; text-align: center; }

.sw-popup-title {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--sw-primary);
}

.sw-popup-body { font-size: 15px; line-height: 1.6; color: #555; }
.sw-popup-body p { margin: 0 0 10px; }

.sw-popup-highlight {
  margin-top: 14px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--sw-text);
}

/* --- image popup: the image is the whole content --- */
.sw-popup-image { padding: 0; }
.sw-popup-img { display: block; width: 100%; height: auto; }
/* the X must stay readable over any picture */
.sw-popup-image .sw-popup-x {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.sw-popup-image .sw-popup-x:hover { background: #fff; }

/* --- buttons (both modes) --- */
.sw-popup-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 28px 22px;
}
.sw-popup-image .sw-popup-buttons { padding: 14px 20px 16px; }

.sw-popup-buttons button { cursor: pointer; font-family: inherit; font-size: 15px; }

.sw-popup .sw-popup-close {
  min-width: 180px;
  padding: 11px 26px;
  border: 0;
  border-radius: 8px;
  background: var(--sw-primary);
  color: #fff;
  font-weight: 600;
  transition: background 0.15s;
}
.sw-popup .sw-popup-close:hover { background: var(--sw-primary-dark); }

.sw-popup .sw-popup-dont-show {
  padding: 4px 10px;
  border: 0;
  background: none;
  color: #8a8f98;
  font-size: 13px;
  text-decoration: underline;
}
.sw-popup .sw-popup-dont-show:hover { color: #333; }

.sw-popup button:focus-visible,
.sw-wa button:focus-visible { outline: 2px solid #4285f4; outline-offset: 2px; }

@media (max-width: 480px) {
  .sw-popup-content { padding: 30px 20px 4px; }
  .sw-popup-title { font-size: 20px; }
  .sw-popup .sw-popup-close { width: 100%; }
}

/* ---------- WhatsApp floating button ---------- */
.sw-wa {
  --sw-wa-bottom: 30px;
  --sw-wa-size: 60px;
  position: fixed;
  bottom: var(--sw-wa-bottom);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
}
.sw-wa-right { right: 24px; align-items: flex-end; }
.sw-wa-left { left: 24px; align-items: flex-start; }

.sw-wa-welcome[hidden] { display: none; }

/* Plain white card, nothing else. */
.sw-wa-welcome {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 250px;
  padding: 10px 12px 10px 14px;
  background: #fff;
  color: #333;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  animation: sw-fade-in 0.3s ease-out;
}

.sw-wa-welcome-text { font-size: 13.5px; font-weight: 500; line-height: 1.4; }

.sw-wa-welcome-close {
  flex: none;
  padding: 0 2px;
  border: 0;
  background: none;
  color: #9a9a9a;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.sw-wa-welcome-close:hover { color: #333; }

.sw-wa-btn {
  width: var(--sw-wa-size);
  height: var(--sw-wa-size);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease;
}
.sw-wa-btn:hover { transform: scale(1.08); }
.sw-wa-btn img { width: 100%; height: 100%; object-fit: contain; }

@keyframes sw-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sw-pop-in {
  from { opacity: 0; transform: translate(-50%, -48%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

@media (max-width: 480px) {
  .sw-wa-right { right: 14px; }
  .sw-wa-left { left: 14px; }
  .sw-wa-welcome { max-width: 210px; }
}

@media (prefers-reduced-motion: reduce) {
  .sw-cd-icon-anim .sw-cd-icon { animation: none; }
  .sw-popup, .sw-popup-overlay, .sw-wa-welcome { animation: none; }
  .sw-wa-btn { transition: none; }
}

/* ---------- Countdown ---------- */
.sw-countdown[hidden] { display: none; }

.sw-countdown {
  --sw-cd-number: #d3121a;
  --sw-cd-text: #444;
  --sw-cd-bg: #fff;
  --sw-cd-num: 24px;
  --sw-cd-unit: 9px;
  --sw-cd-label: 14px;
  --sw-cd-icon: 18px;
  --sw-cd-scale: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 20px;
  box-sizing: border-box;
  max-width: 550px;
  margin: 10px auto;
  padding: 6px 20px;
  color: var(--sw-cd-text);
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
}

/* size */
.sw-cd-size-sm { --sw-cd-num: 18px; --sw-cd-unit: 8px; --sw-cd-label: 12px; --sw-cd-icon: 15px; max-width: 440px; }
.sw-cd-size-lg { --sw-cd-num: 36px; --sw-cd-unit: 11px; --sw-cd-label: 18px; --sw-cd-icon: 26px; max-width: 720px; }

/* alignment */
.sw-cd-align-left { justify-content: flex-start; margin-left: 0; margin-right: auto; }
.sw-cd-align-right { justify-content: flex-end; margin-left: auto; margin-right: 0; }

/* background: a card (color + border + shadow), a flat color, or none at all */
.sw-cd-bg-card { background: var(--sw-cd-bg); border: 1px solid rgba(0, 0, 0, 0.07); border-radius: 6px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); }
.sw-cd-bg-flat { background: var(--sw-cd-bg); border-radius: 6px; }
.sw-cd-bg-none { background: none; border: 0; box-shadow: none; padding-left: 0; padding-right: 0; }

.sw-cd-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: calc(var(--sw-cd-label) * var(--sw-cd-scale));
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sw-cd-icon {
  flex: none;
  display: inline-flex;
  width: calc(var(--sw-cd-icon) * var(--sw-cd-scale));
  height: calc(var(--sw-cd-icon) * var(--sw-cd-scale));
  color: var(--sw-cd-number);
}
.sw-cd-icon svg { width: 100%; height: 100%; }
.sw-cd-icon-anim .sw-cd-icon { animation: sw-tick 2s infinite ease-in-out; }

.sw-cd-timer { display: flex; align-items: center; gap: 10px; }
.sw-cd-timer[hidden], .sw-cd-block[hidden], .sw-cd-sep[hidden], .sw-cd-end[hidden] { display: none; }

.sw-cd-block { display: flex; flex-direction: column; align-items: center; min-width: calc(var(--sw-cd-num) * 1.6 * var(--sw-cd-scale)); }

.sw-cd-number {
  font-size: calc(var(--sw-cd-num) * var(--sw-cd-scale));
  font-weight: 800;
  line-height: 1;
  color: var(--sw-cd-number);
  font-variant-numeric: tabular-nums;
}

.sw-cd-unit {
  margin-top: 1px;
  font-size: calc(var(--sw-cd-unit) * var(--sw-cd-scale));
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.6;
}
.sw-cd-nounits .sw-cd-unit { display: none; }

.sw-cd-sep { margin-top: calc(var(--sw-cd-unit) * -1.2); font-size: calc(var(--sw-cd-num) * 0.85 * var(--sw-cd-scale)); opacity: 0.35; }
.sw-cd-nounits .sw-cd-sep { margin-top: 0; }

/* numbers in boxes: each figure sits on a block of the numbers color */
.sw-cd-num-boxed .sw-cd-block { padding: 6px 9px; background: var(--sw-cd-number); border-radius: 8px; }
.sw-cd-num-boxed .sw-cd-number { color: #fff; }
.sw-cd-num-boxed .sw-cd-unit { color: #fff; opacity: 0.85; }
.sw-cd-num-boxed .sw-cd-sep { margin-top: 0; }

.sw-cd-end { font-size: calc(15px * var(--sw-cd-scale)); font-weight: 700; color: var(--sw-cd-number); text-align: center; }

@keyframes sw-tick { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

@media (max-width: 600px) {
  .sw-countdown { --sw-cd-scale: 0.85; justify-content: center; margin: 10px; padding: 8px 10px; gap: 6px; }
  .sw-cd-bg-none { padding-left: 0; padding-right: 0; }
  .sw-cd-label { width: 100%; justify-content: center; }
  .sw-cd-timer { gap: 8px; }
}
/* ---------- Video (YouTube) ---------- */
.sw-video { box-sizing: border-box; max-width: 1200px; margin: 24px auto; padding: 0 12px; font-family: inherit; }
.sw-video-title { margin: 0 0 16px; font-size: 22px; font-weight: 700; line-height: 1.25; }

.sw-video-grid { display: grid; gap: 24px; align-items: center; grid-template-columns: minmax(0, 1fr); }

/* a single video is not stretched across the whole page */
.sw-video-one .sw-video-grid { max-width: 960px; margin: 0 auto; }
.sw-video-two .sw-video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.sw-video-cell { min-width: 0; }

/* 16:9 box; the padding fallback keeps it working where aspect-ratio is not supported */
.sw-video-frame {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
}
.sw-video-frame iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

.sw-video-text { font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.sw-video-text > :first-child { margin-top: 0; }
.sw-video-text > :last-child { margin-bottom: 0; }
.sw-video-text img, .sw-video-text iframe, .sw-video-text video { max-width: 100%; height: auto; }
.sw-align-center { text-align: center; }
.sw-align-left { text-align: left; }

/* phones and small tablets: one column, in the order the columns were set */
@media (max-width: 768px) {
  .sw-video { margin: 16px auto; }
  .sw-video-two .sw-video-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .sw-video-title { font-size: 19px; margin-bottom: 12px; }
  .sw-video-frame { border-radius: 10px; }
  .sw-video-text { font-size: 15px; }
}

/* text written with the admin's visual editor */
.sw-video-text h2, .sw-video-text h3, .sw-video-text h4 { margin: 0 0 10px; line-height: 1.25; }
.sw-video-text p { margin: 0 0 12px; }
.sw-video-text ul, .sw-video-text ol { margin: 0 0 12px; padding-left: 1.4em; }
.sw-video-text a { text-decoration: underline; }
.sw-align-center ul, .sw-align-center ol { list-style-position: inside; padding-left: 0; }
