/* ═══════════════════════════════════════════════════════════
   BIBLIOTECA DE PLANTES — Auró Jardiners
   Integrat amb el tema Gardyn · aurojardiners.com
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&display=swap');

:root {
  --grd-green:      #2a5c3f;
  --grd-green-dark: #1a3a28;
  --grd-green-btn:  #3a7a50;
  --grd-text:       #1a1a1a;
  --grd-muted:      #6b6b6b;
  --grd-border:     #e0e0d8;
  --grd-bg:         #ffffff;
  --grd-bg-soft:    #f7f7f4;
  --grd-serif:      'Cormorant Garamond', Georgia, serif;
  --grd-sans:       -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease:           cubic-bezier(.25,.46,.45,.94);
}

.bp-biblioteca *,
.bp-biblioteca *::before,
.bp-biblioteca *::after {
  box-sizing: border-box;
}

.bp-biblioteca {
  font-family: var(--grd-sans);
  color: var(--grd-text);
  background: var(--grd-bg);
  margin-left: -20px;
  margin-right: -20px;
}

/* ── HERO ── */
.bp-hero {
  position: relative;
  height: 420px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--grd-green-dark);
}

.bp-hero-bg {
  position: absolute; inset: 0;
  background-image: url('https://images.unsplash.com/photo-1416879595882-3373a0480b5b?w=1600&q=80');
  background-size: cover;
  background-position: center;
  filter: brightness(.4) saturate(.75);
}

.bp-hero-content {
  position: relative; z-index: 2;
  padding: 0 60px 52px;
}

.bp-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: rgba(255,255,255,.6);
  margin-bottom: 16px;
  list-style: none; padding: 0;
}
.bp-breadcrumb a { color: rgba(255,255,255,.6); text-decoration: none; }
.bp-breadcrumb a:hover { color: #fff; }
.bp-breadcrumb-sep { color: rgba(255,255,255,.3); }

.bp-hero-title {
  font-size: clamp(42px, 5.5vw, 68px);
  font-weight: 300;
  color: #ffffff;
  line-height: 1.0;
  letter-spacing: -.01em;
  margin: 0 0 10px;
  font-family: var(--grd-sans);
}

.bp-hero-sub {
  font-size: 15px;
  color: rgba(255,255,255,.55);
  font-weight: 300;
  margin: 0;
}

/* ── CONTROLS ── */
.bp-controls {
  background: var(--grd-bg);
  border-bottom: 1px solid var(--grd-border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.bp-controls-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 60px;
  display: flex; align-items: center;
  justify-content: space-between; gap: 24px;
}

.bp-filters {
  display: flex; gap: 0;
  overflow-x: auto;
}
.bp-filters::-webkit-scrollbar { display: none; }

.bp-filter {
  background: none; border: none;
  border-bottom: 2px solid transparent;
  padding: 16px 16px; margin-bottom: -1px;
  font-size: 12px;
  font-family: var(--grd-sans);
  font-weight: 400;
  color: var(--grd-muted);
  cursor: pointer; white-space: nowrap;
  letter-spacing: .04em;
  transition: all .18s;
}
.bp-filter:hover { color: var(--grd-text); }
.bp-filter.active {
  color: var(--grd-green);
  border-bottom-color: var(--grd-green);
  font-weight: 500;
}

.bp-filter-count {
  font-size: 10px;
  background: var(--grd-bg-soft);
  border: 1px solid var(--grd-border);
  color: var(--grd-muted);
  padding: 1px 6px; border-radius: 20px;
  margin-left: 4px;
}
.bp-filter.active .bp-filter-count {
  background: rgba(42,92,63,.08);
  border-color: rgba(42,92,63,.2);
  color: var(--grd-green);
}

.bp-search {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--grd-border);
  border-radius: 4px; padding: 8px 14px;
  background: var(--grd-bg-soft);
  min-width: 220px;
  transition: border-color .2s;
}
.bp-search:focus-within { border-color: var(--grd-green); background: #fff; }
.bp-search svg { color: #bbb; flex-shrink: 0; }
.bp-search input {
  background: none; border: none; outline: none;
  font-size: 13px; font-family: var(--grd-sans);
  color: var(--grd-text); flex: 1;
}
.bp-search input::placeholder { color: #bbb; }

/* ── GRID ── */
.bp-grid-wrap {
  max-width: 1200px; margin: 0 auto;
  padding: 44px 60px 80px;
}

.bp-meta-bar {
  font-size: 12px; color: var(--grd-muted);
  margin-bottom: 24px;
}

.bp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ── CARD ── */
.bp-card {
  background: var(--grd-bg);
  border: 1px solid var(--grd-border);
  overflow: hidden;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.bp-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,.09);
  transform: translateY(-3px);
}

.bp-card-inner { display: block; text-decoration: none; color: inherit; }

.bp-card-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--grd-bg-soft);
}
.bp-card-photo img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .6s var(--ease);
}
.bp-card:hover .bp-card-photo img { transform: scale(1.04); }

.bp-card-cat {
  position: absolute; top: 12px; left: 12px;
  background: var(--grd-green);
  color: #fff;
  font-size: 9px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px;
}

.bp-card-body { padding: 20px 20px 22px; }

.bp-card-name {
  font-size: 19px; font-weight: 500;
  color: var(--grd-text); line-height: 1.2;
  margin: 0 0 3px;
}
.bp-card-sci {
  font-family: var(--grd-serif);
  font-style: italic; font-size: 13px;
  color: var(--grd-muted); margin: 0 0 14px;
}

.bp-card-specs {
  display: flex; flex-direction: column; gap: 6px;
  padding-top: 12px; margin-bottom: 16px;
  border-top: 1px solid var(--grd-border);
}
.bp-spec-row {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--grd-muted);
}
.bp-spec-row svg { color: var(--grd-green); flex-shrink: 0; }
.bp-spec-row strong { color: var(--grd-text); font-weight: 500; }

.bp-card-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--grd-green);
  color: #fff; font-size: 11px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 11px 20px;
  text-decoration: none;
  transition: background .2s;
  width: 100%;
}
.bp-card-btn:hover { background: var(--grd-green-dark); color: #fff; }
.bp-card-btn svg { transition: transform .2s; }
.bp-card:hover .bp-card-btn svg { transform: translateX(3px); }

.bp-empty {
  grid-column: 1/-1; text-align: center;
  padding: 80px 20px; color: var(--grd-muted); font-size: 14px;
}

/* ── MODAL ── */
.bp-modal-bg {
  display: none;
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,.6);
  align-items: center; justify-content: center;
  padding: 20px;
}
.bp-modal-bg.open { display: flex; }

/* El modal és un layout fix d'alçada: foto esquerra + dades dreta */
.bp-modal {
  background: var(--grd-bg);
  max-width: 900px; width: 100%;
  max-height: 90vh;
  display: grid;
  grid-template-columns: 380px 1fr;
  grid-template-rows: 1fr;
  box-shadow: 0 24px 80px rgba(0,0,0,.3);
  position: relative;
  animation: bpModalIn .25s var(--ease);
  overflow: hidden;
}
@keyframes bpModalIn {
  from { opacity:0; transform: scale(.97); }
  to   { opacity:1; transform: none; }
}

/* FOTO — columna esquerra, alçada total */
.bp-modal-hero {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  overflow: hidden;
  min-height: 500px;
}
.bp-modal-hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(.55) saturate(.85);
}
.bp-modal-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,50,30,.95) 0%, rgba(20,50,30,.3) 55%, transparent 100%);
}
.bp-modal-hero-text {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 24px 28px;
}
.bp-modal-cat {
  display: inline-block;
  background: var(--grd-green);
  color: #fff; font-size: 9px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 20px;
  margin-bottom: 8px;
}
.bp-modal-name {
  font-size: 32px; font-weight: 300; color: #fff;
  line-height: 1.05; margin: 0 0 5px;
}
.bp-modal-sci {
  font-family: var(--grd-serif);
  font-style: italic; font-size: 14px;
  color: rgba(255,255,255,.45); margin: 0;
}

/* CONTINGUT — columna dreta, scrollable */
.bp-modal-content-col {
  grid-column: 2;
  grid-row: 1;
  overflow-y: auto;
  display: flex; flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--grd-border) transparent;
}
.bp-modal-content-col::-webkit-scrollbar { width: 3px; }
.bp-modal-content-col::-webkit-scrollbar-thumb { background: var(--grd-border); }

/* Controls (X, ←, →) */
.bp-modal-controls {
  position: absolute; top: 12px; right: 12px;
  display: flex; align-items: center; gap: 5px;
  z-index: 30;
}
.bp-modal-close, .bp-m-nav {
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, opacity .2s;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 13px;
}
.bp-modal-close:hover, .bp-m-nav:hover { background: rgba(0,0,0,.7); }

.bp-m-counter {
  font-size: 10px; color: rgba(255,255,255,.65);
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.15);
  padding: 4px 9px; border-radius: 20px;
  font-family: var(--grd-sans); font-weight: 300;
  letter-spacing: .05em;
}

/* Descripció + cures */
.bp-modal-body {
  padding: 28px 28px 0;
  flex: 1;
}
.bp-modal-desc {
  font-size: 13px; font-weight: 300;
  line-height: 1.75; color: #555;
  margin: 0 0 20px;
}
.bp-modal-section-title {
  font-size: 9px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--grd-green); margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--grd-border);
}
.bp-care-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 24px; }
.bp-care-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; color: #666; line-height: 1.5;
}
.bp-care-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--grd-green); margin-top: 6px; flex-shrink: 0;
}

/* Fitxa tècnica */
.bp-ficha-card {
  background: var(--grd-bg-soft);
  border-top: 1px solid var(--grd-border);
  padding: 20px 28px 28px;
}
.bp-ficha-title {
  font-size: 9px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--grd-green); margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--grd-border);
}
.bp-ficha-row {
  display: flex; justify-content: space-between;
  align-items: baseline; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--grd-border);
  font-size: 11px;
}
.bp-ficha-row:last-child { border-bottom: none; padding-bottom: 0; }
.bp-ficha-k { color: var(--grd-muted); }
.bp-ficha-v { color: var(--grd-text); font-weight: 500; text-align: right; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .bp-hero-content { padding: 0 32px 44px; }
  .bp-controls-inner { padding: 0 32px; }
  .bp-grid-wrap { padding: 32px 32px 60px; }
  .bp-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  /* Modal: una columna en tablet */
  .bp-modal { grid-template-columns: 1fr; grid-template-rows: 300px 1fr; max-height: 88vh; }
  .bp-modal-hero { min-height: 0; }
  .bp-modal-content-col { overflow-y: auto; }
}

@media (max-width: 640px) {
  .bp-biblioteca { margin-left: -15px; margin-right: -15px; }
  .bp-hero { height: 280px; }
  .bp-hero-content { padding: 0 20px 28px; }
  .bp-controls-inner { padding: 0 16px; flex-direction: column; align-items: stretch; gap: 0; }
  .bp-search { min-width: 0; }
  .bp-grid-wrap { padding: 20px 16px 48px; }
  .bp-grid { grid-template-columns: 1fr; gap: 12px; }
  .bp-modal { grid-template-columns: 1fr; grid-template-rows: 240px 1fr; max-height: 92vh; }
  .bp-modal-body { padding: 20px 20px 0; }
  .bp-ficha-card { padding: 16px 20px 20px; }
}
