/* =====================================================
   CATALOGUE ENTREPRISES – CSS D’ADAPTATION OVANIE
   Version nettoyée + mobile corrigé
===================================================== */

/* ===============================
   STRUCTURE GLOBALE
================================ */
body[data-mode="business"] {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-areas:
    "header header"
    "toolbar toolbar"
    "filters content";
  background: transparent;
  overflow-x: hidden;
}

body[data-mode="business"]>.catalog-filters,
body[data-mode="business"]>.catalog-content {
  background: transparent;
}

/* ===============================
   BARRE D'ANNONCE
================================ */
body[data-mode="business"] .announcement-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  flex-wrap: nowrap;
}

/* ===============================
   HEADER PRINCIPAL
================================ */
body[data-mode="business"] .site-header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background-image: url("../images/ovanie.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  z-index: 10;
  gap: 16px;
}

body[data-mode="business"] .site-header .header-name,
body[data-mode="business"] .site-header .header-logo {
  flex: 1 1 50%;
  min-width: 0;
}

body[data-mode="business"] .site-header .header-name a {
  font-size: 16px;
  font-weight: 600;
  color: #111111;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-mode="business"] .site-header .logo {
  height: 40px;
  width: auto;
  display: block;
  margin-left: auto;
  max-width: 100%;
}

/* ===============================
   HEADER CATALOGUE
================================ */
body[data-mode="business"] .catalog-header {
  grid-area: header;
  display: block;
  margin-top: 10px;
  background: #111827;
  color: #ffffff;
  padding: 25px 20px;
  text-align: center;
  max-width: 100%;
}

body[data-mode="business"] .catalog-header h1 {
  margin: 0;
  font-size: 24px;
}

body[data-mode="business"] .catalog-header p {
  margin-top: 6px;
  font-size: 14px;
  opacity: 0.9;
}

/* ===============================
   TOOLBAR (RECHERCHE)
================================ */
body[data-mode="business"] .catalog-toolbar {
  grid-area: toolbar;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.1);
  margin: 0 20px 20px;
  gap: 15px;
}

body[data-mode="business"] #search-input {
  flex: 1 1 300px;
  min-width: 0;
  padding: 10px 15px;
  border: 2px solid #1e88e5;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

body[data-mode="business"] #search-input:focus {
  outline: none;
  border-color: #1565c0;
  box-shadow: 0 0 8px rgba(21, 101, 192, 0.5);
}

body[data-mode="business"] .button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

body[data-mode="business"] .button-group button {
  background-color: #1e88e5;
  color: white;
  border: none;
  padding: 10px 18px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 2px 4px rgba(30, 136, 229, 0.4);
}

body[data-mode="business"] .button-group button:hover {
  background-color: #1565c0;
  box-shadow: 0 4px 8px rgba(21, 101, 192, 0.6);
}

body[data-mode="business"] .catalog-sort {
  min-width: 130px;
}

body[data-mode="business"] .catalog-sort span {
  font-weight: 600;
  color: #333333;
  font-size: 15px;
  text-align: right;
  display: block;
}

/* ===============================
   FILTRES LATERAUX
================================ */
body[data-mode="business"] .catalog-filters {
  grid-area: filters;
  width: 260px;
  min-width: 260px;
  max-width: 300px;
  margin: 20px 0 20px 20px;
  padding: 20px;
  box-sizing: border-box;
  background: #0f1230;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 12px;
}

body[data-mode="business"] .catalog-filters h3 {
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
}

body[data-mode="business"] .catalog-filters label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #f43606;
  white-space: normal;
  word-wrap: break-word;
  transition: background 0.2s ease;
}

body[data-mode="business"] .catalog-filters label:hover {
  background: #f3f4f6;
}

body[data-mode="business"] .catalog-filters input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0a7cff;
  cursor: pointer;
  flex: 0 0 auto;
}

body[data-mode="business"] .catalog-filters h3+label {
  margin-top: 4px;
}

/* ===============================
   CONTENU PRODUITS
================================ */
body[data-mode="business"] .catalog-content {
  grid-area: content;
  margin: 5px 10px 5px 5px;
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  background: transparent;
  min-width: 0;
}

body[data-mode="business"] .products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 10px 0;
}

body[data-mode="business"] .product-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.08);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  box-sizing: border-box;
  overflow: hidden;
  min-height: 170px;
  min-width: 0;
}

body[data-mode="business"] .product-card h4 {
  font-size: 15px;
  margin-bottom: 6px;
  color: #111827;
  line-height: 1.2;
}

body[data-mode="business"] .product-card p {
  font-size: 13px;
  margin: 3px 0;
  color: #4b5563;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

body[data-mode="business"] .product-card .description {
  font-size: 12px;
  color: #6b7280;
  max-height: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-mode="business"] .product-card .consult-btn,
body[data-mode="business"] .consult-btn {
  margin-top: auto;
  padding: 10px 12px;
  font-size: 14px;
  background: #1e88e5;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
}

body[data-mode="business"] .product-card .consult-btn:hover,
body[data-mode="business"] .consult-btn:hover {
  background: #1565c0;
}

.business-card {
  border: 2px solid #0a7cff;
}

.business-card h4 {
  min-height: 20px;
}

.business-label {
  font-size: 13px;
  color: #fbf8f8;
  margin-bottom: 8px;
}

/* ===============================
   PAGINATION
================================ */
body[data-mode="business"] .catalog-content .pagination {
  margin-top: 25px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

body[data-mode="business"] .catalog-content .pagination button {
  background: #1e88e5;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.25s ease;
}

body[data-mode="business"] .catalog-content .pagination button:hover,
body[data-mode="business"] .catalog-content .pagination button.active {
  background-color: #1565c0;
}

body[data-mode="business"] .catalog-content .page-indicator {
  text-align: center;
  margin-top: 12px;
  font-size: 14px;
  color: #6b7280;
}

/* ===============================
   MODALS
================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 20px 30px;
  width: 90%;
  max-width: 600px;
  border-radius: 8px;
  position: relative;
  overflow-y: auto;
  max-height: 80vh;
}

.close-modal,
.close-modal-payment {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 15px;
}

.row p {
  flex: 1;
}

#payment-modal input[type="tel"] {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border: 1.5px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  transition: border-color 0.25s ease;
  font-family: inherit;
  box-sizing: border-box;
}

#payment-modal input[type="tel"]:focus {
  border-color: #1e88e5;
  outline: none;
  box-shadow: 0 0 6px rgba(30, 136, 229, 0.4);
}

#pay-btn {
  margin-top: 15px;
  width: 100%;
  padding: 12px 0;
  background-color: #28a745;
  color: white;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#pay-btn:hover,
#pay-btn:focus {
  background-color: #1e7e34;
  outline: none;
}

#payment-error {
  margin-top: 12px;
  font-weight: 600;
  font-size: 14px;
  color: #d93025;
}

#contact-btn {
  display: block;
  margin: 25px auto 0;
  padding: 14px 32px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(45deg, #1e88e5, #42a5f5);
  border: none;
  border-radius: 40px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(30, 136, 229, 0.5);
  transition: background 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  user-select: none;
  position: relative;
  overflow: hidden;
  animation: pulseGlow 2.5s ease-in-out infinite;
}

#contact-btn:hover,
#contact-btn:focus {
  background: linear-gradient(45deg, #1565c0, #64b5f6);
  box-shadow: 0 6px 18px rgba(21, 101, 192, 0.8);
  transform: scale(1.05);
  outline: none;
}

@keyframes pulseGlow {

  0%,
  100% {
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.5);
  }

  50% {
    box-shadow: 0 0 30px rgba(30, 136, 229, 0.9);
  }
}

/* ===============================
   RESPONSIVE TABLET
================================ */
@media (max-width: 1100px) {
  body[data-mode="business"] .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  body[data-mode="business"] {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "toolbar"
      "filters"
      "content";
  }

  body[data-mode="business"] .catalog-filters,
  body[data-mode="business"] .catalog-content {
    margin: 10px;
  }

  body[data-mode="business"] .catalog-filters {
    width: auto;
    min-width: 0;
    max-width: 100%;
  }

  body[data-mode="business"] .catalog-content {
    padding-left: 0;
  }
}

/* ===============================
   RESPONSIVE MOBILE
================================ */
@media (max-width: 768px) {
  body[data-mode="business"] {
    display: block;
    width: 100%;
    overflow-x: hidden;
  }

  body[data-mode="business"] .announcement-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
  }

  body[data-mode="business"] .announcement-text1,
  body[data-mode="business"] .announcement-text2 {
    font-size: 12px;
    line-height: 1.3;
  }

  body[data-mode="business"] .announcement-order {
    margin-left: auto;
    transform: scale(0.92);
    transform-origin: right center;
  }

  body[data-mode="business"] .site-header {
    height: 70px;
    /* ajuste selon ton logo */
    min-height: unset;
    padding: 6px 12px;
    gap: 8px;
    align-items: center;
    overflow: hidden;
  }

  body[data-mode="business"] .site-header .header-name a {
    display: block;
    font-size: 15px;
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
  }

  body[data-mode="business"] .site-header .logo {
    max-height: 40px;
    height: auto;
  }

  body[data-mode="business"] .catalog-header {
    max-width: 100%;
    padding: 16px 12px;
    margin-top: 0;
  }

  body[data-mode="business"] .catalog-header h1 {
    font-size: 18px;
    line-height: 1.25;
  }

  body[data-mode="business"] .catalog-header p {
    font-size: 13px;
  }

  body[data-mode="business"] .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin: 12px;
    padding: 14px;
  }

  body[data-mode="business"] #search-input {
    width: 100%;
    min-width: 0;
    flex: none;
    font-size: 15px;
  }

  body[data-mode="business"] .button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  body[data-mode="business"] .button-group button {
    width: 100%;
    min-width: 0;
    padding: 12px 10px;
    font-size: 15px;
  }

  body[data-mode="business"] .catalog-sort {
    width: 100%;
    min-width: 0;
  }

  body[data-mode="business"] .catalog-sort span {
    text-align: left;
    min-width: 0;
  }

  body[data-mode="business"] .catalog-filters {
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 12px;
    padding: 16px;
  }

  body[data-mode="business"] .catalog-content {
    margin: 12px;
    padding: 0;
    box-shadow: none;
  }

  body[data-mode="business"] .products-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0;
  }

  body[data-mode="business"] .product-card {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
  }

  body[data-mode="business"] .product-card h4 {
    font-size: 16px;
  }

  body[data-mode="business"] .product-card p {
    font-size: 14px;
  }

  body[data-mode="business"] .modal-content {
    width: calc(100% - 24px);
    max-width: none;
    max-height: 85vh;
    padding: 18px 14px;
    border-radius: 12px;
  }

  body[data-mode="business"] .row {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  body[data-mode="business"] .button-group {
    grid-template-columns: 1fr;
  }

  body[data-mode="business"] .announcement-text1,
  body[data-mode="business"] .announcement-text2 {
    font-size: 11px;
  }

  body[data-mode="business"] .site-header {
    min-height: 105px;
  }

  body[data-mode="business"] .site-header .logo {
    max-height: 48px;
  }
}