/* Baby Bar — main styles v3 (consolidated)
   Palette matches the babybär logo (warm beige + peach + brown).
   Replace /assets/css/app.css entirely with this file.
*/
:root {
  --brand: #8B5E3C;
  --brand-dark: #6B4527;
  --brand-light: #C89B7B;
  --accent: #F5C994;
  --accent-light: #FBE4C4;
  --surface: #E8D9C7;
  --surface-2: #F5EDE1;
  --bg: #FFFCF9;
  --text: #3A2A1E;
  --muted: #8A7566;
  --border: #DCC9B3;
  --shadow: 0 4px 20px rgba(139, 94, 60, 0.08);
  --shadow-lg: 0 12px 40px rgba(139, 94, 60, 0.15);
  --radius: 12px;
  --radius-lg: 24px;
  --container: 1280px;
  --header-h: 76px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

button { font: inherit; cursor: pointer; background: none; border: 0; padding: 0; color: inherit; }
.icon { flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* ============ TOPBAR ============ */
.topbar { background: var(--accent); color: var(--brand-dark); font-size: 14px; text-align: center; padding: 8px 16px; font-weight: 500; }
.topbar-inner a { color: inherit; text-decoration: underline; }

/* ============ HEADER ============ */
.site-header { background: var(--surface); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(139, 94, 60, 0.05); }
.header-inner { max-width: var(--container); margin: 0 auto; padding: 12px 20px; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 16px; min-height: var(--header-h); }

.menu-toggle { padding: 10px; border-radius: 12px; color: var(--brand-dark); transition: background .15s; display: grid; place-items: center; }
.menu-toggle:hover { background: rgba(139, 94, 60, 0.08); }

.logo { display: flex; align-items: center; gap: 8px; color: var(--brand); font-weight: 800; font-size: 24px; text-decoration: none !important; }
.logo img { height: 40px; width: auto; }

.search-wrap { position: relative; min-width: 0; }
.search-form { position: relative; display: flex; align-items: center; }
.search-form .search-icon { position: absolute; left: 18px; color: var(--muted); pointer-events: none; }
#search-input { width: 100%; padding: 14px 44px 14px 48px; border: 0; border-radius: 999px; background: #fff; font-size: 15px; color: var(--text); outline: none; box-shadow: inset 0 0 0 1px transparent, 0 2px 8px rgba(139, 94, 60, 0.06); transition: box-shadow .15s; }
#search-input:focus { box-shadow: inset 0 0 0 2px var(--brand-light), 0 4px 16px rgba(139, 94, 60, 0.12); }
.search-clear { position: absolute; right: 12px; padding: 6px; border-radius: 50%; color: var(--muted); display: none; }
.search-clear:hover { background: #f3f3f3; color: var(--text); }
.search-wrap.has-value .search-clear { display: grid; place-items: center; }

.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); max-height: 70vh; overflow-y: auto; z-index: 200; }
.search-results:empty { display: none; }
.search-results .section-title { padding: 12px 16px 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.search-results .result-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--surface-2); }
.search-results .result-item:last-child { border-bottom: 0; }
.search-results .result-item:hover { background: var(--surface-2); text-decoration: none; }
.search-results .result-img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: var(--surface-2); }
.search-results .result-body { flex: 1; min-width: 0; }
.search-results .result-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .result-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .result-price { font-weight: 700; color: var(--brand-dark); font-size: 14px; flex-shrink: 0; }
.search-results .result-price s { color: var(--muted); font-weight: 400; margin-right: 6px; font-size: 12px; }
.search-results .link-row { display: flex; align-items: center; gap: 8px; padding: 8px 16px; color: var(--brand-dark); border-bottom: 1px solid var(--surface-2); }
.search-results .link-row:hover { background: var(--surface-2); text-decoration: none; }
.search-results .empty { padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }
.search-results .see-all { display: block; padding: 12px 16px; text-align: center; background: var(--surface-2); font-weight: 600; color: var(--brand-dark); border-top: 1px solid var(--border); }

.socials { display: flex; gap: 4px; }
.socials a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--brand-dark); color: #fff; transition: transform .15s, background .15s; }
.socials a:hover { background: var(--brand); transform: translateY(-2px); text-decoration: none; }

/* ============ DRAWER ============ */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(58, 42, 30, 0.45); opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 300; }
body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; left: 0; bottom: 0; width: 320px; max-width: 85vw; background: var(--bg); z-index: 310; transform: translateX(-100%); transition: transform .3s cubic-bezier(.4, 0, .2, 1); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
body.drawer-open .drawer { transform: translateX(0); }
.drawer[hidden] { display: flex; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; background: var(--surface); }
.drawer-title { font-weight: 700; font-size: 18px; color: var(--brand-dark); }
.drawer-close { color: var(--brand-dark); padding: 4px; border-radius: 8px; display: grid; place-items: center; }
.drawer-close:hover { background: rgba(139, 94, 60, 0.1); }
.drawer-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.drawer-section-title { padding: 16px 24px 6px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.drawer-link { display: flex; align-items: center; gap: 12px; padding: 12px 24px; color: var(--text); transition: background .15s; }
.drawer-link .right { margin-left: auto; color: var(--muted); }
.drawer-link:hover { background: var(--surface-2); text-decoration: none; }
.drawer-socials { display: flex; gap: 8px; padding: 20px 24px; border-top: 1px solid var(--border); background: var(--surface-2); }
.drawer-socials a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--brand-dark); color: #fff; }
.drawer-socials a:hover { background: var(--brand); text-decoration: none; }

/* ============ RESPONSIVE HEADER ============ */
@media (max-width: 720px) {
  .header-inner { grid-template-columns: auto 1fr auto; gap: 10px; padding: 10px 14px; }
  .logo { font-size: 20px; }
  .logo img { height: 32px; }
  .socials { display: none; }
  #search-input { padding: 12px 40px 12px 42px; font-size: 14px; }
}
@media (max-width: 480px) {
  .header-inner { grid-template-columns: auto 1fr; }
  .logo { display: none; }
}

/* ============ HERO ============ */
.hero { position: relative; height: 480px; overflow: hidden; }
.hero img, .hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-inner { position: relative; z-index: 2; max-width: var(--container); margin: 0 auto; padding: 100px 20px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.hero h1 { font-size: 48px; margin: 0 0 12px; }
.hero p { font-size: 20px; margin: 0 0 24px; }

.btn { display: inline-block; padding: 12px 24px; background: var(--brand); color: #fff; border-radius: 999px; font-weight: 600; }
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn-primary { background: var(--brand); }
.btn-lg { padding: 16px 32px; font-size: 16px; display: inline-flex; align-items: center; gap: 10px; margin: 12px 0; }

/* ============ HOME PAGE ============ */
.category-tiles { padding: 60px 20px; max-width: var(--container); margin: 0 auto; }
.category-tiles h2, .product-grid h2, .articles h2 { font-size: 28px; margin-bottom: 24px; color: var(--brand-dark); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.tile { background: var(--surface-2); padding: 16px; text-align: center; color: var(--text); transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); text-decoration: none; }
.tile img { aspect-ratio: 1; object-fit: cover; margin-bottom: 12px; }
.tile-title { display: block; font-weight: 600; }
.tile small { color: var(--muted); }

.product-grid { padding: 40px 20px; max-width: var(--container); margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); } }

/* ============ CATEGORY PAGE — full-width grid ============ */
.category-page { padding: 20px 0 40px; }

.category-head { max-width: var(--container); margin: 0 auto 24px; padding: 0 20px; }
.category-head h1 { font-size: 28px; color: var(--brand-dark); margin: 8px 0; }
.category-head .cat-desc { color: var(--muted); line-height: 1.6; margin-bottom: 12px; }
.category-head .subcats { margin: 16px 0; }
.category-head .results-count { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

.product-grid-fw {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  padding: 0 5px;
  width: 100%;
}
@media (max-width: 900px) { .product-grid-fw { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .product-grid-fw { grid-template-columns: repeat(2, 1fr); } }

/* ============ NEW PRODUCT CARD (no borders, no radius, 3:4) ============ */
.pcard { background: #fff; overflow: hidden; transition: opacity .15s; }
.pcard a { display: block; color: var(--text); text-decoration: none; }
.pcard a:hover { text-decoration: none; }
.pcard:hover { opacity: .92; }
.pcard-img { aspect-ratio: 3/4; background: var(--surface-2); overflow: hidden; }
.pcard-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.pcard:hover .pcard-img img { transform: scale(1.03); }
.pcard-brand { display: block; padding: 10px 10px 0; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.pcard-title { font-size: 14px; font-weight: 500; padding: 4px 10px; margin: 0; line-height: 1.4; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-price { padding: 6px 10px 14px; margin: 0; font-weight: 700; font-size: 15px; color: var(--brand-dark); }
.pcard-price .sale { color: var(--brand); }
.pcard-price s { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 13px; }
@media (max-width: 600px) {
  .pcard-title { font-size: 13px; padding: 4px 8px; }
  .pcard-brand { padding: 8px 8px 0; font-size: 10px; }
  .pcard-price { padding: 4px 8px 12px; font-size: 14px; }
}

/* Legacy .card kept for home page / related products */
.card { background: #fff; overflow: hidden; transition: opacity .15s; }
.card a { display: block; color: var(--text); }
.card:hover { opacity: .92; }
.card img { aspect-ratio: 3/4; object-fit: cover; background: var(--surface-2); }
.card .brand { display: block; padding: 10px 10px 0; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.card h3 { font-size: 14px; padding: 4px 10px; margin: 0; line-height: 1.4; }
.card .price { padding: 6px 10px 14px; font-weight: 700; margin: 0; color: var(--brand-dark); font-size: 15px; }
.card .price .sale { color: var(--brand); }
.card .price s { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 13px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ============ INFINITE SCROLL ============ */
.infinite-sentinel { padding: 40px 0; text-align: center; }
.infinite-loader { display: inline-block; width: 32px; height: 32px; border: 3px solid var(--surface); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; }
.infinite-end { color: var(--muted); font-size: 14px; padding: 20px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ PRODUCT PAGE + CAROUSEL ============ */
.product { padding: 30px 20px; max-width: var(--container); margin: 0 auto; }
.product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 20px; }
@media (max-width: 800px) { .product-layout { grid-template-columns: 1fr; } }

.gallery { position: relative; }
.carousel-viewport { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--surface-2); aspect-ratio: 1; user-select: none; }
.carousel-track { display: flex; height: 100%; transition: transform .35s cubic-bezier(.4, 0, .2, 1); touch-action: pan-y; }
.carousel-slide { flex: 0 0 100%; width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.carousel-slide img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; background: #fff; }

.carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.9); color: var(--brand-dark); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); display: grid; place-items: center; transition: background .15s, transform .15s; z-index: 3; }
.carousel-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.05); }
.carousel-arrow.prev { left: 12px; }
.carousel-arrow.prev svg { transform: rotate(180deg); }
.carousel-arrow.next { right: 12px; }
.carousel-arrow[hidden] { display: none; }

.carousel-counter { position: absolute; bottom: 12px; right: 12px; padding: 4px 12px; border-radius: 999px; background: rgba(58, 42, 30, 0.6); color: #fff; font-size: 12px; font-weight: 600; z-index: 2; }

.carousel-thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; scroll-behavior: smooth; scrollbar-width: thin; }
.carousel-thumbs::-webkit-scrollbar { height: 6px; }
.carousel-thumbs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.carousel-thumb { flex-shrink: 0; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--surface-2); transition: border-color .15s, transform .15s; cursor: pointer; }
.carousel-thumb img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.carousel-thumb:hover { transform: translateY(-2px); }
.carousel-thumb.active { border-color: var(--brand); }
@media (max-width: 600px) {
  .carousel-thumb { width: 56px; height: 56px; }
  .carousel-arrow { width: 36px; height: 36px; }
}

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(20, 15, 10, 0.92); z-index: 1000; display: grid; place-items: center; animation: lightbox-in .2s ease; }
.lightbox[hidden] { display: none; }
@keyframes lightbox-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox-image { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 8px; animation: lightbox-zoom .25s cubic-bezier(.4, 0, .2, 1); }
@keyframes lightbox-zoom { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.lightbox-close, .lightbox-arrow { position: absolute; background: rgba(255, 255, 255, 0.1); color: #fff; border-radius: 50%; width: 52px; height: 52px; display: grid; place-items: center; cursor: pointer; transition: background .15s, transform .15s; backdrop-filter: blur(8px); }
.lightbox-close:hover, .lightbox-arrow:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-arrow { top: 50%; transform: translateY(-50%); }
.lightbox-arrow:hover { transform: translateY(-50%) scale(1.08); }
.lightbox-arrow.prev { left: 24px; }
.lightbox-arrow.prev svg { transform: rotate(180deg); }
.lightbox-arrow.next { right: 24px; }
.lightbox-arrow[hidden] { display: none; }
.lightbox-counter { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 6px 16px; border-radius: 999px; background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 14px; font-weight: 600; }
@media (max-width: 600px) {
  .lightbox-arrow { width: 44px; height: 44px; }
  .lightbox-arrow.prev { left: 8px; }
  .lightbox-arrow.next { right: 8px; }
}

/* Product details */
.details h1 { font-size: 28px; margin: 8px 0; color: var(--brand-dark); }
.details .brand { color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: 1px; }
.details .price { font-size: 28px; font-weight: 800; margin: 12px 0; color: var(--brand-dark); }
.details .price .sale { color: var(--brand); }
.details .price s { color: var(--muted); font-weight: 400; margin-left: 12px; }
.details .price .range { font-size: 24px; color: var(--brand); }
.details .availability { color: var(--muted); margin-bottom: 24px; }
.details .description { margin-top: 24px; line-height: 1.7; }
.details .description h3 { color: var(--brand-dark); margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); }
.hint-small { font-size: 13px; color: var(--muted); margin: 8px 0 0; }

.variation-group { margin: 20px 0; }
.variation-group strong { display: block; margin-bottom: 8px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips .chip { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); font-size: 14px; font-weight: 500; background: #fff; }
.chips .chip.available { border-color: var(--brand); color: var(--brand-dark); background: var(--surface-2); }
.chips .chip.sold-out { color: var(--muted); text-decoration: line-through; opacity: .5; background: var(--surface-2); }

.meta { list-style: none; padding: 0; margin: 24px 0; color: var(--muted); font-size: 14px; }
.meta li { padding: 4px 0; }

/* Related products on product page — still use container */
.related { max-width: var(--container); margin: 60px auto 0; padding: 0 20px; }
.related h2 { color: var(--brand-dark); margin-bottom: 24px; }

/* ============ ARTICLE ============ */
.post { padding: 30px 20px; max-width: 800px; margin: 0 auto; }
.post h1 { font-size: 36px; margin: 12px 0; color: var(--brand-dark); }
.post .meta { color: var(--muted); }
.post .hero-img { border-radius: var(--radius); margin: 24px 0; }
.post .content { font-size: 17px; line-height: 1.8; }
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.article-card { display: block; overflow: hidden; background: #fff; border: 1px solid var(--border); }
.article-card:hover { box-shadow: var(--shadow); text-decoration: none; }
.article-card img { aspect-ratio: 16/9; object-fit: cover; }
.article-card h3 { font-size: 18px; margin: 12px; color: var(--text); }
.article-card p { color: var(--muted); margin: 0 12px 14px; font-size: 14px; }
.articles { max-width: var(--container); margin: 0 auto; padding: 40px 20px; }

/* ============ MISC ============ */
.breadcrumbs { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.breadcrumbs a { color: var(--muted); }
.chip { display: inline-block; padding: 6px 14px; margin: 0 8px 8px 0; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 13px; }
.pagination { margin: 32px 20px; display: flex; gap: 6px; justify-content: center; }
.pagination a, .pagination .current { padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

.site-footer { margin-top: 60px; padding: 30px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; background: var(--surface-2); }
.site-footer .container { max-width: var(--container); }
.error-page { padding: 80px 20px; text-align: center; }
