@import url('/assets/css/pages/produits.css?v=filter-sheet-v2');

html {
    scroll-behavior: smooth;
}

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

/* ══════════════════════════════════════════════
   ABONNEMENT CARD — Design cohérent & épuré
   ══════════════════════════════════════════════ */

.abonnement-card {
    background: #ffffff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    border: 1.5px solid #f0f0f0;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    touch-action: pan-y pinch-zoom;
}

.abonnement-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    border-color: #e5e7eb;
}

.lp-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.42);
    border-radius: inherit;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: .6rem;
    opacity: 0;
    visibility: hidden;
    transform: scale(.97);
    transition: opacity .22s ease, visibility .22s ease, transform .22s ease;
    pointer-events: none;
    touch-action: pan-y pinch-zoom;
}

.lp-overlay.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    pointer-events: auto;
}

.lp-overlay.lp-pending .lp-fav-btn,
.lp-overlay.lp-pending .lp-cart-btn {
    pointer-events: none;
}

.lp-fav-btn,
.lp-cart-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,.22);
    transition: color .2s ease, transform .18s ease, background .2s ease;
    opacity: 0;
    transform: scale(.5) translateY(-6px);
    animation: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.lp-fav-btn {
    font-size: 1.15rem;
    color: #9ca3af;
}

.lp-cart-btn {
    font-size: 1.05rem;
    color: #6b7280;
}

.lp-overlay.visible .lp-fav-btn {
    animation: favBtnPop .28s cubic-bezier(.175, .885, .32, 1.275) .06s forwards;
}

.lp-overlay.visible .lp-cart-btn {
    animation: favBtnPop .28s cubic-bezier(.175, .885, .32, 1.275) .02s forwards;
}

@keyframes favBtnPop {
    from { opacity: 0; transform: scale(.5) translateY(-6px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.lp-fav-btn:hover,
.lp-cart-btn:hover {
    transform: scale(1.12);
    background: #fff5ee;
}

.lp-fav-btn.is-fav {
    color: #e53e3e;
    background: #fff5ee;
}

.lp-cart-btn.in-cart {
    color: #da6f0d;
    background: #fff5ee;
}

.lp-no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* ── Zone logo ── */
.abonnement-card .card-header {
    padding: 0;
    position: relative;
    flex-shrink: 0;
}

.abonnement-card .card-image {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.abonnement-card .card-main-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 14px;
    background: white;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}

/* ── Badges ── */
.abonnement-card .badge {
    position: absolute;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    max-width: calc(100% - 84px);
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    background: #001830;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.abonnement-card .badge-promo {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    background: #e53e3e;
    z-index: 10;
}

/* ── Corps ── */
.abonnement-card .card-body {
    padding: 0.75rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0;
}

/* Nom de plateforme */
.abonnement-card .service-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Titre */
.abonnement-card .plan-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.35rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Lieu */
.abonnement-card .location-info {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.abonnement-card .location-info i {
    font-size: 0.65rem;
    color: #da6f0d;
}

/* Description */
.abonnement-card .description {
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.45;
    margin-bottom: 0.65rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Features */
.abonnement-card .features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.abonnement-card .feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    font-size: 0.65rem;
    font-weight: 500;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 0.18rem 0.45rem;
    border-radius: 5px;
    white-space: nowrap;
}

.abonnement-card .feature-tag i {
    color: #da6f0d;
    font-size: 0.6rem;
}

/* ── Section prix ── */
.abonnement-card .price-section {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
}

.abonnement-card .original-price {
    font-size: 0.78rem;
    color: #c4c4c4;
    text-decoration: line-through;
    font-weight: 500;
}

.abonnement-card .current-price {
    font-size: 1.18rem;
    font-weight: 800;
    line-height: 1;
}

.abonnement-card .price-period {
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 500;
}

/* ── Bouton détails ── */
.abonnement-card .btn-details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.6rem 1rem;
    background: #da6f0d;
    color: white;
    font-weight: 600;
    font-size: 0.82rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    letter-spacing: 0.2px;
}

.abonnement-card .btn-details:hover {
    background: #da6f0d;
    box-shadow: 0 4px 14px rgba(218, 111, 13, 0.30);
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

#products {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
    #products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    #products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    #products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
    #products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1536px) {
    #products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Hauteur minimale cohérente pour toutes les cartes */
.abonnement-card {
    min-height: 260px;
}

.service-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.service-badge.netflix {
    background: linear-gradient(135deg, #E50914 0%, #b20710 100%);
}

.service-badge.crunchyroll {
    background: linear-gradient(135deg, #da6f0d 0%, #da6f0d 100%);
}

.service-badge.disney {
    background: linear-gradient(135deg, #113CCF 0%, #0d2a9f 100%);
}

.service-badge.spotify {
    background: linear-gradient(135deg, #1DB954 0%, #158a3f 100%);
}

.service-badge.amazon {
    background: linear-gradient(135deg, #00A8E1 0%, #007ea3 100%);
}

.service-badge.youtube {
    background: linear-gradient(135deg, #FF0000 0%, #cc0000 100%);
}

.service-badge.apple {
    background: linear-gradient(135deg, #555555 0%, #333333 100%);
}

.service-badge.hbo {
    background: linear-gradient(135deg, #5c4d8a 0%, #3d3260 100%);
}

.service-badge.paramount {
    background: linear-gradient(135deg, #0064FF 0%, #004ecc 100%);
}

.plan-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #f3f4f6;
    color: #374151;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
}

.plan-type-badge.mensuel {
    background: #dbeafe;
    color: #1d4ed8;
}

.plan-type-badge.annuel {
    background: #d1fae5;
    color: #047857;
}

.service-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: white;
    padding: 4px;
}

.mobile-currency-selector {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  margin-top: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.mobile-currency-selector label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #da6f0d;
  font-weight: 600;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mobile-currency-selector label i {
  font-size: 0.9rem;
}

.mobile-currency-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 0.5rem;
  font-size: 0.95rem;
  background: rgba(255,255,255,0.1);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.mobile-currency-select:hover,
.mobile-currency-select:focus {
  border-color: #da6f0d;
  background-color: rgba(255,255,255,0.15);
  outline: none;
}

.mobile-currency-select option {
  background: #1f2937;
  color: white;
  padding: 0.5rem;
}

html.filters-open,
body.filters-open {
  overflow: hidden;
}

#filterBackdrop {
  position: fixed;
  inset: 0;
  z-index: 1201;
  background: rgba(0, 24, 48, 0.48);
  backdrop-filter: blur(3px);
}

#filterBackdrop[hidden] {
  display: none !important;
}

body.filters-open .nav-secondary {
  z-index: 1203;
}

body.filters-open #countryPopup {
  z-index: 1204;
}

#advancedFiltersContainer {
  position: fixed;
  top: var(--filters-sheet-top, calc(36px + 4rem + 2.5rem));
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1202;
  width: 100%;
  max-height: none;
  margin-top: 0;
  padding: 0;
  display: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid #e5e7eb;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
}

#advancedFiltersContainer.show {
  display: grid;
  z-index: 1202;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

#advancedFiltersContainer,
#advancedFiltersContainer.show {
  overflow: hidden;
}

#advancedFiltersContainer.show::before {
  content: none !important;
}

.filters-sheet-header,
.filters-sheet-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
}

.filters-sheet-header {
  justify-content: space-between;
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid #e5e7eb;
}

.filters-sheet-title {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.filters-sheet-title i {
  color: #da6f0d;
}

.filters-sheet-header h2 {
  margin: 0;
  color: #001830;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.25;
}

.filters-close-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9999px;
  background: #fff;
  color: #001830;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filters-close-btn:hover {
  color: #da6f0d;
  background: #fff5ee;
}

.filters-sheet-body {
  display: grid;
  gap: 0.9rem;
  overflow-y: auto;
  padding: 1rem;
}

.filters-sheet-body .filter-group,
.filters-sheet-body .filter-group.half,
.filters-sheet-body .filter-group.quarter-lg {
  min-width: 0;
}

.filter-group-label {
  display: block;
  margin-bottom: 0.5rem;
  color: #374151;
  font-weight: 500;
}

.filter-control-wrap {
  position: relative;
  display: block;
}

.filter-control-wrap > i {
  position: absolute;
  top: 50%;
  left: 1rem;
  z-index: 1;
  color: #334155;
  font-size: 0.9rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.filter-control {
  min-height: 52px;
  border-color: #dbe1ea !important;
  border-radius: 0.55rem !important;
  padding-left: 2.8rem !important;
  padding-right: 2.8rem !important;
  background-color: #fff !important;
}

select.filter-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23001830' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 0.9rem;
}

.price-range-group {
  display: block;
}

.price-range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.price-field {
  display: block;
}

.price-control-wrap .filter-control {
  padding-right: 4.2rem !important;
}

.filter-control-unit {
  position: absolute;
  top: 50%;
  right: 1rem;
  color: #64748b;
  font-size: 0.82rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.filters-mobile-only {
  display: none;
}

.filters-more-options {
  grid-column: 1 / -1;
  border: 1px solid #e5e7eb;
  border-radius: 0.6rem;
  overflow: hidden;
}

.filters-more-options summary {
  min-height: 54px;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  color: #001830;
  font-weight: 600;
  list-style: none;
}

.filters-more-options summary::-webkit-details-marker {
  display: none;
}

.filters-more-options summary span {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.filters-more-options summary .fa-chevron-down {
  transition: transform 0.18s ease;
}

.filters-more-options[open] summary .fa-chevron-down {
  transform: rotate(180deg);
}

.filters-more-options-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0 1rem 1rem;
}

.filters-sheet-footer {
  justify-content: space-between;
  padding: 0.85rem 1rem max(0.85rem, env(safe-area-inset-bottom));
  border-top: 1px solid #e5e7eb;
}

.filters-sheet-footer .btn {
  min-height: 46px;
  justify-content: center;
}

.filters-sheet-footer .btn-primary {
  flex: 1;
}

@media (min-width: 640px) {
  .filters-sheet-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  #filterBackdrop {
    display: none !important;
  }

  .filters-desktop-only {
    display: none;
  }

  .filters-mobile-only {
    display: block;
  }

  .filters-sheet-body {
    grid-template-columns: 1fr;
  }

  .price-range-group,
  .filters-more-options {
    grid-column: auto;
  }

  .filters-more-options-body {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  #advancedFiltersContainer,
  #advancedFiltersContainer.show {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: min(880px, calc(100vw - 3rem));
    max-height: min(76vh, 760px);
    border-radius: 0.75rem;
    box-shadow: 0 24px 60px rgba(0, 24, 48, 0.22);
    transform: translate(-50%, calc(-50% + 16px));
  }

  #advancedFiltersContainer.show {
    transform: translate(-50%, -50%);
  }

  .filters-sheet-body {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .price-range-group {
    grid-column: span 2;
  }

  .filters-sheet-footer .btn-primary {
    flex: 0 0 auto;
    min-width: 190px;
  }
}

@media (max-width: 1023px) {
  .header-profile-dropdown {
    display: none !important;
  }
}

@media (max-width: 480px) {
  header .max-w-7xl {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  header .h-16 {
    gap: 0.5rem;
    min-width: 0;
  }

  #homeLink {
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.5rem !important;
    margin-left: 0 !important;
  }

  #homeLink img {
    width: 2rem !important;
    height: 2rem !important;
    border-radius: 0.75rem !important;
    flex-shrink: 0;
  }

  #homeLink span {
    min-width: 0;
    max-width: 9.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem !important;
  }

  header .h-16 > .flex.items-center:last-child {
    gap: 0.35rem !important;
    flex-shrink: 0;
  }

  .header-cart-icon,
  .hamburger-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0 !important;
    border-radius: 10px;
  }

  .header-cart-icon i,
  .hamburger-btn i {
    font-size: 1.15rem !important;
  }

  #cart-count-badge {
    top: -3px;
    right: -3px;
  }
}

@media (max-width: 380px) {
  #homeLink {
    flex: 0 0 auto;
  }

  #homeLink span {
    display: none;
  }

  header .h-16 > .flex.items-center:last-child {
    gap: 0.25rem !important;
  }
}
