﻿/* Price Tapestry — custom overrides */

/* Base font size matches template (15px) */
html, body { font-size: 15px; }

/* Product card — hover lift effect */
.pt-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.pt-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--pt-card-hover-shadow, 0 8px 24px rgba(0,0,0,0.08));
  border-color: var(--pt-card-hover-border, #2563eb) !important;
}

/* Search sidebar responsive */
@media (max-width: 767px) {
  .pt-search-grid { grid-template-columns: 1fr !important; }
  .pt-sf-aside { display: none; }
}

/* Score tag */
.pt-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 3px 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
}

/* Description truncation */
.pt-clamp2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Star ratings */
.pt_stars img { vertical-align: middle; }

/* Menu category dropdown items (AJAX loaded) */
#menu_cat0 li a,
[id^="menu_cat"] li a {
  display: block;
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s, background-color 0.15s;
}
#menu_cat0 li a:hover,
[id^="menu_cat"] li a:hover {
  color: #2563eb;
  background-color: #eff6ff;
}

/* Breadcrumb */
.pt-bc-nav { display:flex; align-items:center; flex-wrap:wrap; gap:6px; font-size:13px; color:#6b7280; }
.pt-bc-link { color:#6b7280; text-decoration:none; transition:color .12s; white-space:nowrap; }
.pt-bc-link:hover { color:#2563eb; }
.pt-bc-sep { color:#e0e0da; user-select:none; }
.pt-bc-current { color:#0c0c10; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:340px; display:inline-block; vertical-align:middle; }

/* Focus cleanup */
:focus:not(:focus-visible) { outline: none; }
::-moz-focus-inner { border: 0; }

/* ── Homepage zones ── */
.pt-hp-zone-sidebar {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
.pt-hp-aside-sticky { position: sticky; top: 80px; }

/* Section headers */
.pt-hp-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--pt-border, #e8e8e4);
  padding-top: 20px;
  margin-bottom: 16px;
}
.pt-hp-section-title {
  font-family: var(--pt-font-heading, 'Space Grotesk', sans-serif);
  font-size: var(--pt-hp-title-size, 22px);
  font-weight: 700;
  color: var(--pt-text, #0c0c10);
  line-height: 1.2;
  margin: 0;
}
.pt-hp-section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--pt-hp-link, #2563eb);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.pt-hp-section-link:hover { text-decoration: underline; }

/* Deals horizontal scroll */
.pt-deals-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.pt-deals-scroll::-webkit-scrollbar { height: 4px; }
.pt-deals-scroll::-webkit-scrollbar-track { background: var(--pt-border,#e8e8e4); border-radius: 2px; }
.pt-deals-scroll::-webkit-scrollbar-thumb { background: var(--pt-muted,#7a7a7a); border-radius: 2px; }

/* Best of Week */
.pt-bow-section {
  background: var(--pt-bow-bg, #0c0c10);
  padding: 40px 0;
  margin: 8px 0;
}
.pt-bow-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.pt-bow-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform .2s, box-shadow .2s;
}
.pt-bow-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

@media (max-width: 1023px) {
  .pt-bow-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .pt-hp-zone-sidebar { grid-template-columns: 1fr; }
  .pt-hp-aside-sticky { position: static; display: flex; justify-content: center; }
  .pt-bow-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 479px) {
  .pt-bow-grid { grid-template-columns: 1fr; }
}

/* ── Product hero ── */
.pt-product-hero {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 40px;
  margin-bottom: 40px;
  align-items: start;
}
.pt-product-img-box {
  width: 400px;
  height: 400px;
  border-radius: 12px;
  border: 1px solid #e8e8e4;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pt-product-img { width: 400px !important; height: 400px !important; object-fit: contain; display: block; }

@media (max-width: 767px) {
  .pt-product-hero { grid-template-columns: 1fr; gap: 16px; }
  .pt-product-img-box { width: 100%; height: 260px; }
  .pt-product-img { width: 100% !important; height: 260px !important; }
}

/* ── Sticky bar ── */
.pt-sticky-inner { display: flex; align-items: center; gap: 20px; max-width: 1280px; margin: 0 auto; }
@media (max-width: 767px) {
  #pt-sticky-bar { display: none !important; }
}

/* ── Prices table ── */
/* Grid desktop+mobile défini dans html/prices.php (style en fin de fichier) */
.pt-pr-voucher-mob { display: none; }

@media (max-width: 767px) {
  /* Force flex sur les lignes même quand display:grid est en inline style (variant_prices) */
  .pt-pr-hdr  { display: none !important; }
  .pt-pr-row  { display: flex !important; flex-wrap: wrap !important; align-items: center !important; padding: 12px 14px !important; gap: 0 !important; }
  .pt-pr-merchant { flex: 1 1 auto; min-width: 0; }
  .pt-pr-price    { flex: 0 0 auto !important; text-align: right; padding-left: 12px; }
  .pt-pr-delivery { flex: 0 0 100% !important; margin-top: 8px; font-size: 12px; }
  .pt-pr-cta      { flex: 0 0 100% !important; margin-top: 10px; }
  /* display:flex (pas inline-flex) pour que width:100% fonctionne correctement */
  .pt-pr-cta a    { display: flex !important; width: 100% !important; box-sizing: border-box; justify-content: center; white-space: normal !important; }
  .pt-pr-payments, .pt-pr-rating, .pt-pr-voucher { display: none !important; }
  .pt-pr-voucher-mob { display: block; }
}

/* ── Offers section header ── */
@media (max-width: 767px) {
  #pt-offres > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
  }
}

/* ── Ratings page ── */
@media (max-width: 767px) {
  .pt-ratings-grid       { grid-template-columns: 1fr !important; }
  .pt-ratings-overview   { grid-template-columns: 1fr !important; gap: 20px !important; }
  .pt-ratings-form-names { grid-template-columns: 1fr !important; }

  /* Card interne : empile meta sous le contenu sur petit écran */
  .pt-rev-card { grid-template-columns: 1fr !important; gap: 10px !important; }

  /* Évite le zoom iOS sur focus (min 16px requis) */
  .pt-ratings-grid input,
  .pt-ratings-grid textarea,
  .pt-ratings-grid select { font-size: 16px !important; }

  /* Labels uppercase illisibles en 12px sur mobile */
  .pt-ratings-grid label  { font-size: 14px !important; }

  /* Texte des reviews un peu plus aéré */
  .pt-rev-txt             { font-size: 15px !important; line-height: 1.8 !important; }

  /* Boutons helpful et Répondre plus faciles à tapper */
  .pt-hbtn               { font-size: 15px !important; padding: 8px 14px !important; }
  .pt-helpful            { flex-wrap: wrap; gap: 12px !important; margin-top: 20px !important; }

  /* Étoiles de notation plus grandes */
  #pt-star-row span      { font-size: 38px !important; }
}

/* ── Banner H1 ── */
@media (max-width: 767px) {
  .pt-banner-h1 { font-size: 24px !important; }
}

/* ── Mobile filter button ── */
.pt-filter-btn { display: none; }
@media (max-width: 767px) {
  .pt-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid #e8e8e4;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #0c0c10;
    cursor: pointer;
    font-family: inherit;
  }

  /* Aside becomes a full-screen backdrop with a slide-in panel */
  .pt-sf-aside {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0,0,0,.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
  }
  .pt-sf-aside.open {
    opacity: 1;
    pointer-events: auto;
  }
  .pt-sf-aside-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 90vw);
    background: #fff;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .pt-sf-aside.open .pt-sf-aside-panel {
    transform: translateX(0);
  }
  /* Remove sticky inside the drawer */
  .pt-sf-aside-panel > form > div { position: static !important; border: none !important; border-radius: 0 !important; box-shadow: none !important; }
  .pt-sf-close { display: flex !important; }
}

/* Close button header — hidden on desktop */
.pt-sf-close {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #e8e8e4;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
}

/* ── Dual-range price slider ── */
.pt-range-wrap {
  position: relative;
  height: 32px;
  display: flex;
  align-items: center;
}
.pt-range-track {
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: #e8e8e4;
  border-radius: 2px;
  pointer-events: none;
}
.pt-range-fill {
  position: absolute;
  height: 100%;
  background: var(--pt-primary, #2563eb);
  border-radius: 2px;
}
.pt-range {
  position: absolute;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  height: 4px;
  margin: 0;
  padding: 0;
  outline: none;
}
.pt-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--pt-primary, #2563eb);
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  pointer-events: all;
  cursor: pointer;
}
.pt-range:focus::-webkit-slider-thumb {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.pt-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--pt-primary, #2563eb);
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  pointer-events: all;
  cursor: pointer;
}
#pt-range-hi { z-index: 2; }
#pt-range-lo { z-index: 1; }

/* ── Autocomplete dropdown ────────────────────────────────────── */
.pt-ac-dropdown {
  background: #fff;
  border: 1px solid #e8e8e4;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.06);
  overflow: hidden;
  animation: pt-ac-in .13s ease;
  max-height: 80vh;
  overflow-y: auto;
}
@keyframes pt-ac-in {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}

/* Section label */
.pt-ac-lbl {
  padding: 10px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #c0bfb8;
  font-family: 'DM Sans', sans-serif;
}

/* ── Product items (with thumbnail) ──── */
.pt-ac-product {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  text-decoration: none;
  transition: background .09s;
  cursor: pointer;
  border-top: 1px solid #f5f5f2;
}
.pt-ac-product:first-of-type { border-top: none; }
.pt-ac-product:hover, .pt-ac-product.active { background: #f5f7ff; }

.pt-ac-thumb {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 9px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid #ebebeb;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pt-ac-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

.pt-ac-info { flex: 1; min-width: 0; }

.pt-ac-name {
  font-size: 13.5px;
  color: #0c0c10;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.pt-ac-name mark { background: none; color: #2563eb; font-weight: 700; }

.pt-ac-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 12px;
  color: #9ca3af;
}
.pt-ac-meta-price {
  color: var(--pt-cta);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 13px;
}
.pt-ac-meta-dot { color: #d1d5db; }

/* ── Bottom section: brands + categories 2-col ── */
.pt-ac-bottom {
  border-top: 1px solid #f0f0ec;
}
.pt-ac-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.pt-ac-col:first-child {
  border-right: 1px solid #f0f0ec;
}

/* Side items (brands / categories) */
.pt-ac-side {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  text-decoration: none;
  transition: background .09s;
  cursor: pointer;
  border-top: 1px solid #f5f5f2;
}
.pt-ac-side:first-of-type { border-top: none; }
.pt-ac-side:hover, .pt-ac-side.active { background: #f5f7ff; }
.pt-ac-side:hover .pt-ac-side-txt, .pt-ac-side.active .pt-ac-side-txt { color: #1d4ed8; }

/* Brand avatar */
.pt-ac-avatar {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 6px;
  background: #eff6ff;
  color: #2563eb;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: .02em;
}

/* Category icon */
.pt-ac-cat-ico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #c4c4be;
}

.pt-ac-side-txt {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: #0c0c10;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .09s;
}
.pt-ac-side-txt mark { background: none; color: #2563eb; font-weight: 700; }

.pt-ac-cnt {
  flex-shrink: 0;
  font-size: 11px;
  color: #c0bfb8;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Footer */
.pt-ac-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 13px;
  color: #6b7280;
  text-decoration: none;
  background: #fafaf8;
  border-top: 1px solid #f0f0ec;
  transition: color .1s, background .1s;
}
.pt-ac-footer:hover, .pt-ac-footer.active { color: #2563eb; background: #eff6ff; }
.pt-ac-footer b { color: #0c0c10; font-weight: 600; }
.pt-ac-footer-arrow { font-size: 14px; opacity: .55; }

/* ── Avantages marchands ─────────────────────────────────── */
/* Mode accordion */
.pt-perks-details summary::-webkit-details-marker { display: none; }
.pt-perks-details[open] .pt-perks-arrow { transform: rotate(90deg); }
.pt-perks-arrow { display: inline-block; transition: transform .2s; }
/* Mode accordion dans l'admin */
.pt-mi-perks summary::-webkit-details-marker { display: none; }
.pt-mi-perks[open] .pt-perks-arrow { transform: rotate(90deg); }

/* ── MERCHANT BADGES ─────────────────────────────────────── */
[data-tip]   { cursor: default; }
a[data-tip]  { cursor: pointer; }

/* Sur mobile les lignes passent en flex (grid annulé) → pas de min-width nécessaire */
