/**
 * Key Soft Italia - Volantini Page Styles
 * Stili specifici per la pagina Volantini & Offerte
 */



/* ========== SECTION BASE ========== */
.section-flyers {
  padding: var(--ks-spacing-20, 5rem) 0;
  background: #fff;
}

.section-flyers .section-title {
  margin-bottom: .5rem;
}

.section-flyers .section-subtitle {
  max-width: 680px;
  margin: 0 auto 1.5rem;
}

/* ========== FILTER TABS ========== */
.flyers-filters {
  display: flex;
  justify-content: center;
  gap: .75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.flyer-tab {
  border: 1px solid var(--ks-gray-200, #e5e7eb);
  background: var(--ks-bg-primary, #ffffff);
  color: var(--ks-text-secondary, #4b5563);
  border-radius: var(--ks-radius-full, 999px);
  padding: .5rem 1.25rem;
  font-size: .95rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.flyer-tab:hover {
  box-shadow: var(--ks-shadow-sm, 0 1px 3px rgba(15,23,42,0.12));
  transform: translateY(-1px);
}

.flyer-tab.is-active {
  background: var(--ks-orange, #ff6b35);
  border-color: var(--ks-orange, #ff6b35);
  color: #fff;
  box-shadow: var(--ks-shadow-md, 0 6px 15px rgba(249,115,22,0.35));
}

/* ========== META & MESSAGGI ========== */
.flyers-meta {
  font-size: .9rem;
}

.flyers-message {
  min-height: 1.5rem;
  font-size: .95rem;
  color: var(--ks-text-secondary, #4b5563);
}

.flyers-message.is-loading {
  color: var(--ks-orange, #ff6b35);
}

/* ========== CARD VOLANTINO ========== */
.flyer-card {
  background: var(--ks-bg-primary, #ffffff);
  border-radius: var(--ks-radius-2xl, 1.5rem);
  box-shadow: var(--ks-shadow-md, 0 8px 20px rgba(15,23,42,0.1));
  border: 1px solid var(--ks-gray-100, #e5e7eb);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.flyer-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ks-shadow-xl, 0 14px 30px rgba(15,23,42,0.16));
  border-color: var(--ks-orange, #ff6b35);
}

.flyer-card-header {
  display: flex;
  gap: var(--ks-spacing-4, 1.25rem);
  padding: var(--ks-spacing-5, 1.5rem) var(--ks-spacing-5, 1.5rem) var(--ks-spacing-4, 1.25rem);
  border-bottom: 1px solid var(--ks-gray-100, #e5e7eb);
}

.flyer-cover {
  width: 110px;
  flex-shrink: 0;
}

.flyer-cover img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--ks-radius-xl, 1rem);
  box-shadow: var(--ks-shadow-sm, 0 4px 10px rgba(15,23,42,0.15));
}

.flyer-cover-placeholder {
  width: 100%;
  height: 150px;
  border-radius: var(--ks-radius-xl, 1rem);
  background: linear-gradient(135deg, rgba(249,115,22,0.12), rgba(30,64,175,0.08));
  display: flex;
  align-items: center;
  justify-content: center;
}

.flyer-cover-placeholder i {
  font-size: 2.2rem;
  color: var(--ks-orange, #ff6b35);
}

.flyer-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.flyer-title {
  font-size: var(--ks-text-xl, 1.25rem);
  font-weight: var(--ks-font-bold, 700);
  color: var(--ks-text-primary, #111827);
  margin: 0;
}

.flyer-period {
  font-size: .95rem;
  color: var(--ks-text-secondary, #4b5563);
  margin: 0;
}

.flyer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .25rem;
}

/* badge base */
.flyer-badge {
  font-size: .75rem;
  font-weight: 600;
  border-radius: var(--ks-radius-full, 999px);
  padding: .2rem .7rem;
}

/* stato */
.flyer-badge-current {
  background: rgba(34,197,94,0.12);
  color: #15803d;
  border: 1px solid rgba(34,197,94,0.45);
}

.flyer-badge-upcoming {
  background: rgba(59,130,246,0.12);
  color: #1d4ed8;
  border: 1px solid rgba(59,130,246,0.45);
}

.flyer-badge-archived {
  background: rgba(148,163,184,0.16);
  color: #4b5563;
  border: 1px solid rgba(148,163,184,0.4);
}

/* evidenza home */
.flyer-badge-highlight {
  background: rgba(249,115,22,0.12);
  color: var(--ks-orange, #ff6b35);
  border-radius: var(--ks-radius-full, 999px);
  padding: .2rem .6rem;
  font-size: .75rem;
  border: 1px dashed rgba(249,115,22,0.6);
}

/* BODY */
.flyer-card-body {
  padding: var(--ks-spacing-4, 1.25rem) var(--ks-spacing-5, 1.5rem) var(--ks-spacing-5, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: .75rem;
  flex: 1;
}

.flyer-description {
  font-size: .95rem;
  color: var(--ks-text-secondary, #4b5563);
  margin-bottom: .25rem;
}

.flyer-note {
  font-size: .85rem;
}

/* ACTIONS */
.flyer-card-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.flyer-card-actions .btn {
  border-radius: var(--ks-radius-lg, .8rem);
  font-weight: 600;
}

.flyer-card-actions .btn-outline-secondary {
  border-width: 1px;
}

/* ========== MODAL VIEWER PDF ========== */
#flyerViewerModal .modal-dialog {
  max-width: 95%;
  width: 95%;
  margin: 1.75rem auto;
}

#flyerViewerModal .modal-content {
  height: calc(100vh - 3.5rem);
}

@media (max-width: 992px) {
  #flyerViewerModal .modal-dialog {
    max-width: 100%;
    width: 100%;
    margin: 0;
  }
  #flyerViewerModal .modal-content {
    height: 100vh;
    border-radius: 0;
  }
}

/* ===== CTA finale volantini (stile chiaro, coerente col sito) ===== */

.section-cta-flyers {
  background: var(--ks-gray-50, #f3f4f6);
  padding: var(--ks-spacing-16, 4rem) 0;
}

.section-cta-flyers .cta-flyers-box {
  margin: 0 auto;
  background: #ffffff;
  border-radius: var(--ks-radius-2xl, 1.5rem);
  padding: 2.5rem 2rem;
  border: 1px solid var(--ks-gray-200, #e5e7eb);
  box-shadow: var(--ks-shadow-md, 0 10px 25px rgba(15,23,42,0.08));
}

.section-cta-flyers .cta-title {
  color: var(--ks-text-primary, #111827);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: .5rem;
}

.section-cta-flyers .cta-subtitle {
  color: var(--ks-text-secondary, #4b5563);
  margin-bottom: 1.5rem;
  font-size: .98rem;
}

/* Bottoni */
.section-cta-flyers .cta-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
  margin-bottom: 1rem;
}

.section-cta-flyers .cta-buttons .btn {
  border-radius: var(--ks-radius-lg, .9rem);
  padding: .75rem 1.6rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

/* WhatsApp (verde classico) */
.section-cta-flyers .btn-whatsapp {
  background-color: #25D366;
  border-color: #25D366;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(16,185,129,0.35);
}
.section-cta-flyers .btn-whatsapp:hover {
  background-color: #1ebe5c;
  border-color: #1ebe5c;
  color: #ffffff;
}

/* Outline primari: usiamo l'arancio del sito */
.section-cta-flyers .btn-outline-primary {
  border-color: var(--ks-orange, #f97316);
  color: var(--ks-orange, #f97316);
  background: #ffffff;
}
.section-cta-flyers .btn-outline-primary:hover {
  background-color: var(--ks-orange, #f97316);
  color: #ffffff;
}

/* Nota sotto */
.section-cta-flyers .cta-flyers-note {
  font-size: .82rem;
  color: var(--ks-text-muted, #6b7280);
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .section-cta-flyers {
    padding: var(--ks-spacing-12, 3rem) 0;
  }

  .section-cta-flyers .cta-flyers-box {
    padding: 2rem 1.5rem;
  }

  .section-cta-flyers .cta-title {
    font-size: 1.6rem;
  }

  .section-cta-flyers .cta-buttons .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
  .flyer-card-header {
    flex-direction: row;
  }
}

@media (max-width: 768px) {
  .hero-flyers {
    padding: var(--ks-spacing-12, 3rem) 0;
  }

  .hero-flyers .hero-title {
    font-size: var(--ks-text-3xl, 2rem);
  }

  .hero-flyers .hero-subtitle {
    font-size: var(--ks-text-base, 1rem);
  }

  .flyer-card-header {
    flex-direction: column;
    text-align: left;
  }

  .flyer-cover {
    width: 100%;
  }

  .flyer-cover img,
  .flyer-cover-placeholder {
    height: 200px;
  }

  .flyer-card-actions {
    flex-direction: column;
  }

  .flyer-card-actions .btn,
  .flyer-card-actions a.btn {
    width: 100%;
  }

  .section-cta .cta-title {
    font-size: var(--ks-text-3xl, 2rem);
  }

  .cta-buttons .btn {
    width: 100%;
    margin-bottom: .5rem;
  }
}

/* ===== PDF.js viewer in modale volantini ===== */

.flyer-modal-dialog {
  max-width: 1140px;
}

.flyer-modal-body {
  padding: 0;
  background: #020617;
}

.pdfjs-viewer {
  height: 80vh;
  overflow: auto;
  padding: 1.5rem 1rem;
  background: radial-gradient(circle at top,
              rgba(15,23,42,0.8) 0%,
              #020617 55%);
}

.pdfjs-page-canvas {
  display: block;
  margin: 0 auto 1rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.7);
  border-radius: 4px;
  background: #111827;
}

.pdfjs-loading,
.pdfjs-error {
  color: #e5e7eb;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.95rem;
}

.pdfjs-error a {
  color: #f97316;
  text-decoration: underline;
}

/* ===== MODALE VOLANTINI + PDF.js ===== */

.flyer-modal-dialog {
  max-width: 1140px;
}

.flyer-modal-body {
  padding: 0;
  background: #020617;
  display: flex;
  flex-direction: column;
}

/* Toolbar in alto */
.pdfjs-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem 1rem;
  border-bottom: 1px solid #111827;
  background: linear-gradient(90deg, #020617 0%, #0b1120 100%);
  color: #e5e7eb;
  font-size: .85rem;
}

.pdfjs-page-indicator span {
  font-weight: 600;
}

/* Bottoni zoom più “touch friendly” */
.pdfjs-zoom-controls .btn {
  min-width: 2.3rem;
  height: 2.3rem;
  padding: 0;
  border-radius: 999px;
  border-color: rgba(248,250,252,.7);
  color: #e5e7eb;
}

.pdfjs-zoom-controls .btn:hover {
  background-color: #e5e7eb;
  color: #020617;
}

/* Viewer scrollabile sotto la toolbar */
.pdfjs-viewer {
  flex: 1 1 auto;
  height: auto;
  max-height: 80vh;
  overflow: auto;
  padding: 1.5rem 1rem;
  background: radial-gradient(circle at top,
              rgba(15,23,42,0.8) 0%,
              #020617 55%);
}

/* Pagine */
.pdfjs-page-canvas {
  display: block;
  margin: 0 auto 1rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.7);
  border-radius: 4px;
  background: #111827;
}

/* Messaggi */
.pdfjs-loading,
.pdfjs-error {
  color: #e5e7eb;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.95rem;
}

.pdfjs-error a {
  color: #f97316;
  text-decoration: underline;
}

/* Mobile */
@media (max-width: 768px) {
  .flyer-modal-dialog {
    max-width: 100%;
    margin: .5rem;
  }

  .pdfjs-toolbar {
    padding: .4rem .7rem;
    font-size: .8rem;
  }

  .pdfjs-zoom-controls .btn {
    min-width: 2.2rem;
    height: 2.2rem;
    width: auto;
  }
}

/* Pan con il mouse */
.pdfjs-viewer {
  cursor: grab;
}

.pdfjs-viewer.pdfjs-grabbing {
  cursor: grabbing;
}

/* Volantini scaduti (archivio) */
.flyer-card.flyer-card-expired {
  opacity: 0.8;
  filter: grayscale(0.3);
}

.flyer-card.flyer-card-expired .flyer-title {
  color: var(--ks-text-secondary, #6b7280);
}

.flyer-card.flyer-card-expired .flyer-badge-archived {
  background-color: var(--ks-gray-300, #d1d5db);
  color: var(--ks-text-primary, #111827);
}

.flyer-card.flyer-card-expired .flyer-card-actions {
  opacity: 0.9;
}

/* ===== RECONDITIONED SECTION ===== */
.section-recond {
  background: var(--ks-bg-primary);
  padding: var(--ks-spacing-16) 0;
}

.recond-card {
  background: var(--ks-bg-primary);
  border: 1px solid var(--ks-gray-200);
  border-radius: var(--ks-radius-xl);
  overflow: hidden;
  box-shadow: var(--ks-shadow-sm);
  transition: all var(--ks-transition-base);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.recond-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--ks-shadow-lg);
  border-color: var(--ks-orange);
}

.recond-img {
  width: 100%;
  height: 180px;
  object-fit: scale-down;
}

.recond-body {
  padding: var(--ks-spacing-4);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.recond-title {
  font-size: var(--ks-text-base);
  font-weight: var(--ks-font-semibold);
  color: var(--ks-text-primary);
  margin-bottom: var(--ks-spacing-2);
}

.recond-price {
  font-size: var(--ks-text-lg);
  font-weight: var(--ks-font-bold);
  color: var(--ks-orange);
}

/* Swiper custom */
.recond-swiper {
  padding-bottom: var(--ks-spacing-10);
  padding-top: var(--ks-spacing-4);
}
.swiper-pagination-bullet {
  background: var(--ks-orange);
  opacity: 0.7;
}
.swiper-pagination-bullet-active {
  opacity: 1;
}

/* Reconditioned Swiper Fix */
.recond-swiper .swiper-slide {
  display: flex;
  justify-content: center;
  height: auto;
}

.recond-card {
  width: 88vw;
  max-width: 320px;
}

@media (min-width: 768px) {
  .recond-card {
    width: 100%;
    max-width: 280px;
  }
}
@media (min-width: 1200px) {
  .recond-card {
    max-width: 300px;
  }
}
/* --- Ricondizionati: card --- */
.recond-card {
  border: 1px solid #eee;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.05);
}

.recond-img-wrap {
  position: relative;
  aspect-ratio: 4/3;            /* mantiene proporzioni eleganti */
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recond-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* chips in alto a destra */
.recond-chips {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  gap: 6px;
  justify-items: end;
}

.recond-chip {
  font-size: 12px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  white-space: nowrap;
}
.recond-chip.storage { }
.recond-chip.grade   { background: #fff7ec; border-color: #ffd6a6; }

/* body */
.recond-body { padding: 14px 14px 16px; }
.recond-title { font-size: 15px; font-weight: 600; margin: 0 0 6px; color: #222; }
.recond-price { font-size: 18px; font-weight: 700; color: #ff6a00; }

/* bottone WhatsApp */
.btn-wa {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%;
  gap: 8px;
  background:var(--ks-orange);
  border: none;
  color: #fff !important;
  font-weight: 600;
  border-radius: 12px;
  padding: 10px 14px;
}
.btn-wa:hover { filter: brightness(0.95); color: #fff !important; }
.btn-wa i { font-size: 18px; }

/* Wrapper: esteso per gestire sinistra/destra */
.recond-chips{
  position:absolute; top:10px; left:10px; right:10px;
  display:flex; justify-content:space-between; pointer-events:none;
}

/* Pile sinistra/destra (così puoi avere più chip per lato) */
.recond-chips-left, .recond-chips-right{
  display:grid; gap:6px; justify-items:start;
}

.recond-chip{
  pointer-events:auto;            /* clickabili se servisse */
  font-size:12px; line-height:1;
  padding:6px 10px; border-radius:999px;
  background:#fff; border:1px solid rgba(0,0,0,.08);
  box-shadow:0 2px 8px rgba(0,0,0,.06); white-space:nowrap;
}

/* Colori per GRADO */
.recond-chip.grade { color:#222; font-weight:600; }
.recond-chip.grade.grade-new { background:#eb3d5a; color: #ffffff; border-color:#e3b5c7; } /* verde più “premium” */
.recond-chip.grade.grade-expo { background:#6d6d6d; border-color:#a0a0a0; } /* verde più “premium” */
.recond-chip.grade.grade-a-plus { background:#e7f7ed; border-color:#b5e3c6; } /* verde più “premium” */
.recond-chip.grade.grade-a      { background:#eefcf1; border-color:#cdeed6; } /* verde chiaro */
.recond-chip.grade.grade-b      { background:#fff6e5; border-color:#ffd89a; } /* ambra */
.recond-chip.grade.grade-c      { background:#ffede8; border-color:#ffb9a6; } /* arancio/rosso chiaro */
.recond-chip.grade.grade-d      { background:#ffe6e6; border-color:#ff9b9b; } /* rosso */

/* Wrapper delle pagine per lo zoom di anteprima */
.pdfjs-pages {
  transform-origin: top center;
  will-change: transform;
}