/* ============================================
   ShopLink - Page Boutique Publique
   frontend/src/styles/shop.css
   ============================================ */

/* SHOP HEADER */
.shop-header {
  position: relative;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.shop-banner {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--green-wa), var(--green-dark));
  display: block;
}
.shop-banner-placeholder {
  height: 200px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}
.shop-header-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 1.5rem;
  position: relative;
}
.shop-logo-wrap {
  margin-top: -50px;
  margin-bottom: 1rem;
}
.shop-logo {
  width: 100px;
  height: 100px;
  border-radius: 20px;
  border: 4px solid var(--surface);
  object-fit: cover;
  box-shadow: var(--shadow-md);
  background: white;
}
.shop-logo-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 20px;
  border: 4px solid var(--surface);
  background: var(--green-wa);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  box-shadow: var(--shadow-md);
}
.shop-meta { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem; }
.shop-name { font-size: 1.6rem; font-weight: 800; line-height: 1.2; word-break: break-word; }
.shop-desc { color: var(--text-secondary); font-size: .9rem; margin-top: .35rem; max-width: 600px; line-height: 1.6; }
.shop-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: .75rem;
}
.shop-info-pill {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  color: var(--text-secondary);
  background: var(--gray-100);
  padding: .3rem .7rem;
  border-radius: 999px;
}
.shop-actions-header {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: flex-end;
}

/* RATING */
.rating-display {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .875rem;
  font-weight: 600;
}
.stars-display { color: #F59E0B; letter-spacing: 2px; }

/* SOCIAL LINKS */
.social-links {
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
  flex-wrap: wrap;
}
.social-link {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-100);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
  text-decoration: none;
  flex-shrink: 0;
}
.social-link:hover { background: var(--green-light); border-color: var(--green-wa); transform: translateY(-2px); }

/* MAIN LAYOUT */
.shop-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* SEARCH & FILTER BAR */
.shop-search-bar {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}
.shop-search-input {
  flex: 1;
  min-width: 200px;
  padding: .7rem 1rem .7rem 2.5rem;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 16px; /* empêche le zoom auto iOS */
  transition: var(--transition);
}
.shop-search-input:focus { border-color: var(--green-wa); box-shadow: 0 0 0 3px rgba(37,211,102,.12); outline: none; }
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-icon { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

/* CATEGORIES FILTER */
.categories-scroll {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding-bottom: .25rem;
  margin-bottom: 1.25rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.categories-scroll::-webkit-scrollbar { display: none; }
.cat-btn {
  padding: .45rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  min-height: 38px;
}
.cat-btn.active, .cat-btn:hover { background: var(--green-wa); border-color: var(--green-wa); color: white; }

/* PRODUCTS GRID */
.shop-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

/* PRODUCT CARD */
.shop-product-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}
.shop-product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.product-photo {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.product-photo img { width: 100%; height: 100%; object-fit: cover; }
.promo-badge {
  position: absolute;
  top: .5rem;
  left: .5rem;
  background: var(--accent);
  color: white;
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 999px;
}
.unavailable-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: .875rem;
}
.shop-product-body { padding: .875rem; }
.shop-product-name { font-size: .9rem; font-weight: 700; margin-bottom: .3rem; }
.shop-product-desc { font-size: .78rem; color: var(--text-secondary); margin-bottom: .5rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shop-product-price { font-size: 1.05rem; font-weight: 800; color: var(--green-wa); }
.shop-product-original { font-size: .8rem; text-decoration: line-through; color: var(--text-muted); margin-left: .4rem; }
.add-to-cart-btn {
  width: 100%;
  margin-top: .75rem;
  padding: .55rem;
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  min-height: 38px;
}
.add-to-cart-btn:hover { background: var(--green-wa); color: white; }

/* CART BUTTON */
.cart-fab {
  position: fixed;
  bottom: 2rem;
  bottom: max(2rem, calc(env(safe-area-inset-bottom) + 1rem));
  right: 2rem;
  right: max(2rem, calc(env(safe-area-inset-right) + 1rem));
  background: var(--green-wa);
  color: white;
  border-radius: 999px;
  padding: 1rem 1.5rem;
  font-size: .95rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  z-index: 50;
  animation: slideUp .4s ease;
}
.cart-fab:hover { background: var(--green-dark); transform: translateY(-2px); }
.cart-count {
  background: white;
  color: var(--green-dark);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 800;
  flex-shrink: 0;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* WHATSAPP BUTTON */
.wa-sticky-btn {
  position: fixed;
  bottom: 2rem;
  bottom: max(2rem, calc(env(safe-area-inset-bottom) + 1rem));
  right: 2rem;
  right: max(2rem, calc(env(safe-area-inset-right) + 1rem));
  background: var(--green-wa);
  color: white;
  border-radius: 999px;
  padding: 1rem 1.5rem;
  font-size: .95rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  transition: var(--transition);
  z-index: 50;
  animation: slideUp .4s ease;
}
.wa-sticky-btn:hover { background: var(--green-dark); transform: translateY(-2px); }

/* REVIEWS */
.reviews-section { margin-bottom: 2rem; }
.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: .75rem;
}
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; flex-wrap: wrap; gap: .4rem; }
.reviewer-name { font-size: .875rem; font-weight: 700; }
.review-stars { color: #F59E0B; font-size: .85rem; }
.review-text { font-size: .875rem; color: var(--text-secondary); line-height: 1.6; word-break: break-word; }
.review-date { font-size: .75rem; color: var(--text-muted); margin-top: .4rem; }

/* SCHEDULE TABLE */
.schedule-table { width: 100%; font-size: .875rem; }
.schedule-table tr td { padding: .4rem .5rem; }
.schedule-table tr td:first-child { font-weight: 600; color: var(--text-secondary); width: 90px; }

/* MAP */
.map-placeholder {
  height: 200px;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: .875rem;
  border: 1px solid var(--border);
  flex-direction: column;
  gap: .5rem;
  padding: 1rem;
  text-align: center;
}

/* SHARE ROW */
.share-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  align-items: center;
}

/* SECTION TITLE */
.shop-section-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* PRODUCT MODAL */
.product-modal-img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  background: var(--gray-100);
}
.qty-control {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.qty-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gray-100);
  border: 1px solid var(--border);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.qty-btn:hover { background: var(--green-light); border-color: var(--green-wa); }
.qty-value { font-size: 1.1rem; font-weight: 700; min-width: 28px; text-align: center; }

/* ─────────────────────────── RESPONSIVE ─────────────────────────── */

/* Tablettes (≤768px) */
@media (max-width: 768px) {
  .shop-products-grid { grid-template-columns: repeat(3, 1fr); }
  .shop-header-content { padding: 0 1.25rem 1.25rem; }
}

/* Mobiles (≤600px) */
@media (max-width: 600px) {
  .shop-products-grid { grid-template-columns: repeat(2, 1fr); }
  .shop-banner, .shop-banner-placeholder { height: 130px; }
  .shop-logo, .shop-logo-placeholder { width: 72px; height: 72px; border-radius: 16px; }
  .shop-logo-wrap { margin-top: -36px; }
  .shop-name { font-size: 1.25rem; }
  .shop-meta { flex-direction: column; align-items: stretch; }
  .shop-actions-header { align-items: stretch; flex-direction: row; flex-wrap: wrap; }
  .shop-actions-header .rating-display { width: 100%; }
  .shop-actions-header .btn { flex: 1; }
  .cart-fab, .wa-sticky-btn {
    bottom: max(1rem, env(safe-area-inset-bottom));
    right: max(1rem, env(safe-area-inset-right));
    padding: .75rem 1.1rem;
    font-size: .85rem;
  }
  .shop-main { padding: 1rem; }
  .product-photo { height: 140px; }
}

/* Très petits mobiles (≤360px) */
@media (max-width: 360px) {
  .shop-products-grid { gap: .6rem; }
  .product-photo { height: 120px; }
  .shop-product-body { padding: .6rem; }
}