/**
* Theme Name: Footpaw Child
* Description: This is a child theme of Footpaw, generated by Merlin WP.
* Author: <a href="https://wpopal.com/">Opalthemes</a>
* Template: footpaw
* Version: 1.0.3
*/

/** CHECKOUT **/
body .amount {
    white-space: nowrap;
}

/** FILTER ANYTHING PLUGIN **/
/* Checkmark icon */
.selected::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background-color: #D32300;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}
.wpc-custom-selected-terms .wpc-filter-chip a {
    border: 2px solid #D32300!important;
    background: #D32300;
}
.wpc-custom-selected-terms .wpc-filter-chip .wpc-chip-content {
    color: #fff;
    font-weight: 500;
}
.breadcrumb-wrap {
    margin-top: 120px;
}

@media screen and (max-width: 768px) {
    .wpc-custom-selected-terms {
        display: flex !important;
        flex-wrap: nowrap;
        /* empêche le retour à la ligne */
        overflow-x: auto;
        /* permet le défilement horizontal */
        gap: 8px;
        /* espace entre les éléments */
        padding: 8px 0;
        scrollbar-width: none;
        /* masque la scrollbar sur Firefox */
        -ms-overflow-style: none;
        /* masque la scrollbar sur IE/Edge */
    }
    /* Chaque liste UL (si plusieurs) */
    .wpc-custom-selected-terms ul {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        padding: 0;
        margin: 0;
        list-style: none;
    }
    /* Chaque filtre sélectionné */
    .wpc-custom-selected-terms li {
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        background: #f3f3f3;
        border-radius: 20px;
        padding: 6px 12px;
        font-size: 14px;
        cursor: pointer;
        user-select: none;
    }
    /* Petites améliorations visuelles */
    .wpc-custom-selected-terms li:hover {
        background: #e0e0e0;
    }
}

/** CUSTOM FILTERS **/
/* --- Barre des filtres --- */
.filter-bar {
  display: flex;
  gap: 12px;
  white-space: nowrap;
  padding: 10px;
  overflow: hidden; /* masque la scrollbar */
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.filter-bar:active {
  cursor: grabbing;
}
.filter-bar::-webkit-scrollbar {
  height: 6px;
}
.filter-bar::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* --- Filtre individuel --- */
.filter-item {
  flex: 0 0 auto;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 12px;
  padding: 6px;
  max-width: 112px;
}

.filter-item:hover {
  background: #f0f0f0;
}

.filter-item.active {
  background: #f0f0f0;
  border: 1px solid #D32300;
}
.filter-item.active span {
  color: #D32300;
}

/* --- Image du filtre --- */
.filter-item img {
  width: 80px;
  height: 120px;
  object-fit: cover;
  border-radius: 5px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}
/* === MOBILE: 2.5 éléments visibles === */
@media (max-width: 768px) {
  :root {
    --filter-gap: 8px;   /* ajuster l'écart si besoin */
    --visible-count: 4.5; /* ne pas toucher sauf si besoin */
  }
  
   .filter-item img { 
        max-width: 60px; 
        height: 90px; 
    } 

   .filter-bar {
    gap: var(--filter-gap) !important;
    padding-left: 8px !important;
    padding-right: 16px !important; /* laisse un peu d'espace pour voir le demi élément */
    scroll-snap-type: x mandatory; /* optionnel mais joli */
    -webkit-overflow-scrolling: touch;
  }

  /* Override des règles gênantes */
  .filter-item {
    box-sizing: border-box !important;
    min-width: 0 !important;         /* IMPORTANT: autorise la réduction */
    flex: 0 0 calc(100% / var(--visible-count)) !important;
    max-width: calc(100% / var(--visible-count)) !important;
    scroll-snap-align: start;
  }

  /* Ajuste l'image pour qu'elle rentre proprement dans la cellule */
  .filter-item img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
    border-radius: 12px;
    display: block;
  }

  /* Texte centré et qui wrappe */
  .filter-item span {
    display: block;
    white-space: normal !important;
    text-align: center;
    font-size: 13px;
    margin-top: 6px;
    line-height: 1.2;
  }
  .filter-item {
    display: flex;
    flex-direction: column; /* empile image + texte */
    align-items: center;    /* centre horizontalement */
    justify-content: flex-start; /* image en haut, texte dessous */
    text-align: center; /* pour le texte interne */
  }

  .filter-item span {
    margin-top: 6px;
    text-align: center;
    white-space: normal !important;
    word-break: break-word;
    line-height: 1.2;
  }
  .ht-ctc-chat {
    right: 10px!important;
  }
}

.filter-item.active img {
  border-color: #D32300;
}

/* --- texte du filtre --- */
.filter-item span {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-top: 5px;
  color: #333;
  white-space: normal; /* autorise les retours à la ligne */
  word-break: break-word; /* casse les mots trop longs si nécessaire */
  text-align: center!important; 
  line-height: 1.2; /* pour un peu de compacité */
  max-width: 100px;
}
.filter-bar {
  -webkit-overflow-scrolling: touch;
}
/* --- Pour éviter la sélection du texte et des images au glissement du curseur ---*/
.filter-bar {
  user-select: none; /* empêche la sélection du texte/images */
  -webkit-user-select: none;
  -ms-user-select: none;
  cursor: grab; /* petit détail visuel sympa */
}

.filter-bar:active {
  cursor: grabbing;
}

.filter-item {
  user-drag: none; /* empêche le glisser-déposer natif d’une image */
  -webkit-user-drag: none;
}

/** ALL WEB SITE **/
.breadcrumb-wrap {
    margin-top: 0;
}
/* ToTop Button */
.progress-wrap {
    bottom: 9rem!important;
}
/* Pagination */
.woocommerce-pagination ul.page-numbers li .page-numbers,
a.next.page-numbers {
	background-color: #5479A1;
	border: 1px solid #5479A1;
	color: #fff!important;
}
.page-numbers .current {
	background-color: #D32300!important;
	border: 2px solid #D32300!important;
	box-shadow: none!important;
}

/** HIDE FOOTER ON MOBILE **/
@media screen and (max-width: 768px) {
  footer {
    display: none !important;
  }
}

/** PWA CSS **/
.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  box-shadow: 0 -2px 15px rgba(0,0,0,0.1);
  display: none;
  z-index: 9999;
  padding: 1rem;
  animation: slideUp 0.4s ease forwards;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.install-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 600px;
  margin: 0 auto;
  gap: 1rem;
  flex-wrap: wrap;
}

.install-text p {
  margin: 0.25rem 0 0 0;
  font-size: 0.9rem;
  color: #555;
}

.install-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-install {
  background-color: #6b1941;
  color: #fff;
  border: 2px solid #6b1941;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}

.btn-install:hover {
  background-color: #fff;
  color: #6b1941;
}

.btn-close {
  background-color: transparent;
  border: 2px solid #6b1941;
  color: #6b1941;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
}

.btn-close:hover {
  background-color: #6b1941;
  color: #fff;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 480px) {
  .install-content {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .install-actions {
    justify-content: center;
    width: 100%;
  }
  .btn-install, .btn-close {
    width: 100%;
  }
}

/******* PWA LOADER (mobile-safe) **********/
#pwa-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483647; /* max z-index pour Android WebView */
  -webkit-transform: translateZ(0); /* force le rendu GPU, supprime les lignes */
}

#pwa-loader .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(107,25,65,0.2);
  border-top-color: #6b1941;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-sizing: border-box;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
