/* BookHaven v4 — commercial component polish */
:root{
  --bh-primary:#0b5d52;
  --bh-primary-dark:#08483f;
  --bh-gold:#d4a017;
  --bh-ink:#102a43;
  --bh-soft:#f5f8f7;
  --bh-shadow:0 14px 38px rgba(15,23,42,.10);
  --bh-shadow-hover:0 22px 52px rgba(15,23,42,.16);
}

/* Cards */
.product-card{
  position:relative;
  overflow:hidden;
  border:1px solid var(--border-color)!important;
  border-radius:18px!important;
  background:var(--surface)!important;
  box-shadow:0 7px 24px rgba(15,23,42,.07)!important;
  transition:transform .28s ease,box-shadow .28s ease,border-color .28s ease;
}
.product-card:hover{transform:translateY(-5px);box-shadow:var(--bh-shadow-hover)!important;border-color:rgba(11,93,82,.28)!important}
.product-img-wrapper{display:block;overflow:hidden;background:#f5f7f7;min-height:230px}
.product-img-wrapper img{width:100%;height:255px;object-fit:cover;transition:transform .4s ease}
.product-card:hover .product-img-wrapper img{transform:scale(1.035)}
.product-body{padding:1rem}
.product-title a{color:var(--text-main);transition:color .2s ease}.product-title a:hover{color:var(--primary)}
.product-actions{z-index:3}.btn-action{backdrop-filter:blur(8px)}
.btn-wishlist-toggle.active{background:#fff0f2!important;color:#dc3545!important;border-color:#ffd0d7!important}

/* Buttons */
.btn-bh-primary,.btn-add-cart,.btn-add-cart-sellzy,.btn-mini-add{
  background:var(--primary)!important;color:#fff!important;border:1px solid var(--primary)!important;border-radius:999px!important;font-weight:700!important;
  transition:transform .2s ease,box-shadow .2s ease,background .2s ease;
}
.btn-bh-primary:hover,.btn-add-cart:hover,.btn-add-cart-sellzy:hover,.btn-mini-add:hover{background:var(--primary-hover)!important;border-color:var(--primary-hover)!important;transform:translateY(-1px);box-shadow:0 8px 20px rgba(11,93,82,.2)}

/* Search */
.search-wrapper{isolation:isolate}
.search-results-dropdown{position:absolute;left:0;right:0;top:calc(100% + 8px);z-index:1080;background:var(--surface);border:1px solid var(--border-color);border-radius:14px;overflow:hidden;box-shadow:0 20px 45px rgba(15,23,42,.16);max-height:420px;overflow-y:auto}
.search-result-row{display:flex;gap:.8rem;align-items:center;padding:.7rem .85rem;border-bottom:1px solid var(--border-color);color:var(--text-main);transition:background .2s ease}
.search-result-row:hover{background:var(--bg-light)}
.search-result-row img{width:42px;height:56px;border-radius:7px;object-fit:cover;flex:0 0 auto}.search-result-row small{color:var(--text-muted)}
.search-view-all{display:block;padding:.75rem;text-align:center;font-weight:700;color:var(--primary);background:var(--bg-light)}

/* Mini cart */
.mini-cart-item{display:flex;align-items:center;gap:.8rem;padding:.85rem 0;border-bottom:1px solid var(--border-color)}
.mini-cart-item img{width:48px;height:66px;object-fit:cover;border-radius:8px;box-shadow:var(--shadow-sm)}
.min-w-0{min-width:0}

/* Quantity */
.qty-stepper{display:inline-flex;align-items:center;border:1px solid var(--border-color);border-radius:999px;overflow:hidden;background:var(--surface)}
.qty-stepper button{width:34px;height:34px;border:0;background:transparent;color:var(--text-main);font-weight:800}.qty-stepper button:hover{background:var(--bg-light)}
.qty-stepper input{width:42px;height:34px;border:0;border-left:1px solid var(--border-color);border-right:1px solid var(--border-color);text-align:center;background:transparent;color:var(--text-main);outline:0}
.qty-stepper input::-webkit-inner-spin-button,.qty-stepper input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}

/* Product detail format selector */
.format-option{display:flex;flex-direction:column;align-items:flex-start;gap:.15rem;min-width:112px;padding:.72rem .9rem;border:1px solid var(--border-color);border-radius:12px;background:var(--surface);color:var(--text-main);transition:.2s ease}
.format-option span{font-size:.78rem;color:var(--text-muted)}.format-option:hover,.format-option.active{border-color:var(--primary);box-shadow:0 0 0 3px rgba(11,93,82,.10)}.format-option.active{background:rgba(11,93,82,.06)}

/* Result/empty states */
.results-toolbar{display:flex;align-items:end;justify-content:space-between;gap:1rem;margin-bottom:1.5rem}.results-toolbar p{margin:0;color:var(--text-muted)}
.empty-state{text-align:center;padding:4rem 1.5rem;background:var(--surface);border:1px dashed var(--border-color);border-radius:18px}.empty-state i{font-size:2.2rem;color:var(--text-muted);margin-bottom:1rem}.empty-state p{color:var(--text-muted)}

/* Reusable commercial surfaces */
.commercial-panel{background:var(--surface);border:1px solid var(--border-color);border-radius:20px;box-shadow:0 8px 26px rgba(15,23,42,.06)}
.trust-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:1rem;padding:1rem 0}.trust-item{display:flex;align-items:center;gap:.75rem;padding:1rem;border:1px solid var(--border-color);border-radius:14px;background:var(--surface)}.trust-item i{font-size:1.25rem;color:var(--primary)}

/* Accessibility/focus */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid rgba(11,93,82,.28)!important;outline-offset:2px}
button,[role="button"],a{touch-action:manipulation}

/* Reveal */
.bh-reveal{opacity:0;transform:translateY(16px);transition:opacity .48s ease,transform .48s ease}.bh-visible{opacity:1;transform:none}

/* Dark mode compatibility for Bootstrap utility surfaces */
.dark-mode .bg-white,.dark-mode .card,.dark-mode .modal-content,.dark-mode .offcanvas,.dark-mode .dropdown-menu{background-color:var(--surface)!important;color:var(--text-main)!important}
.dark-mode .text-dark{color:var(--text-main)!important}.dark-mode .bg-light{background-color:#172033!important}.dark-mode .form-control,.dark-mode .form-select{background-color:#162033;color:var(--text-main);border-color:var(--border-color)}

@media (prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.001ms!important;transition-duration:.001ms!important}.bh-reveal{opacity:1;transform:none}}

/* Product detail visual polish */
.detail-gallery-frame{overflow:hidden;position:relative;background:linear-gradient(145deg,#fff,#f4f7f6)!important}
.detail-cover-image{transition:transform .4s ease,filter .3s ease;cursor:zoom-in}.detail-gallery-frame:hover .detail-cover-image{transform:scale(1.055);filter:contrast(1.02)}
.dark-mode .detail-gallery-frame{background:linear-gradient(145deg,#1e293b,#172033)!important}
#detailBuyNowBtn{border-radius:999px;white-space:nowrap}
@media(max-width:575.98px){#detailBuyNowBtn{flex:1 0 100%;width:100%}.detail-gallery-frame:hover .detail-cover-image{transform:none}}
