/* ==========================================================================
   PUBLIC SHOP EXTRAS — loaded AFTER the template CSS (public-site.css)
   Covers: header functional tools (search/cart/notification/profile),
   shop pages (products, categories, cart, tin tuc, otp, notifications),
   cart modal, and Sneat utility fallbacks.
   ========================================================================== */

/* --- Header tools (integrated into template .site-header) ---------------- */
.brand-logo-img { height: 80px; width: auto; border-radius: 8px; display: block; }

.header-tools { display: flex; align-items: center; gap: 10px; }

.header-search { position: relative; }
.header-search .search-box {
  display: flex; align-items: center;
  background: #fff; border: 1px solid #e8e4ec; border-radius: 999px;
  padding: 0 12px; width: 190px; transition: border-color .15s ease, box-shadow .15s ease;
}
.header-search .search-box:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(117, 87, 199, .12); }
.header-search .search-box i { color: #6d6a7f; font-size: 1.05rem; }
.header-search .search-box input {
  border: 0; outline: 0; background: transparent; flex: 1;
  padding: 8px 8px; font-size: .9rem; color: var(--ink); min-width: 0;
}
#searchResults {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border: 1px solid #e8e4ec; border-radius: 14px;
  box-shadow: 0 18px 45px rgba(67, 52, 99, .18);
  max-height: 400px; overflow-y: auto; z-index: 1050;
}
#searchResults .search-result-item {
  display: flex; gap: 10px; padding: 10px 14px; text-decoration: none;
  color: var(--ink); border-bottom: 1px solid #e8e4ec;
}
#searchResults .search-result-item:last-child { border-bottom: 0; }
#searchResults .search-result-item:hover { background: #f7f3ff; }
#searchResults .search-result-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; }
#searchResults .search-result-item .price { color: var(--purple); font-weight: 700; font-size: .85rem; }
#searchResults:empty { display: none; }

.header-icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 999px;
  background: #fff; border: 1px solid #e8e4ec; color: var(--ink);
  font-size: 1.2rem; text-decoration: none; transition: all .15s ease;
}
.header-icon-btn:hover { border-color: var(--purple); color: var(--purple); }
.header-icon-btn .badge {
  position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px;
  border-radius: 999px; background: var(--purple); color: #fff;
  font-size: .6rem; font-weight: 700; display: none; align-items: center; justify-content: center;
  padding: 0 4px;
}
.header-login-btn {
  font-weight: 600; font-size: .88rem; color: var(--ink); text-decoration: none;
  padding: 8px 14px; border-radius: 999px; white-space: nowrap; transition: all .15s ease;
}
.header-login-btn:hover { color: var(--purple); background: #f7f3ff; }

.notification-dropdown { min-width: 350px; max-height: 420px; overflow-y: auto; border-radius: 16px; border: 1px solid #e8e4ec; box-shadow: 0 18px 45px rgba(67, 52, 99, .18); }
.notification-dropdown .dropdown-header { position: sticky; top: 0; background: #fff; z-index: 2; }
.notification-item.unread { background: #f7f3ff; }
.profile-dropdown { border-radius: 16px; border: 1px solid #e8e4ec; box-shadow: 0 18px 45px rgba(67, 52, 99, .18); }
.profile-dropdown .dropdown-item { padding: 9px 16px; border-radius: 10px; }
.profile-dropdown .dropdown-item:hover { background: #f7f3ff; }

.public-offcanvas { width: 300px !important; }
.public-offcanvas .list-group-item { border: 0; border-radius: 10px !important; margin-bottom: 2px; color: var(--ink); }
.public-offcanvas .list-group-item:hover { background: #f7f3ff; color: var(--purple); }

/* Mobile: hide search box (available in offcanvas) */
@media (max-width: 1199.98px) {
  .header-search { display: none; }
}

/* --- Shop pages --------------------------------------------------------- */
.landing-section-title {
  font-family: var(--font-display);
  font-weight: 800; font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -.015em; color: var(--ink);
}
.landing-section-title em { font-style: italic; color: var(--purple); }
.landing-section-sub { color: #6d6a7f; max-width: 620px; }

.card-soft-lavender { background-color: #eee8ff; border-color: transparent; }
.card-soft-mint { background-color: #dcf3e8; border-color: transparent; }

/* Product card */
.product-card { height: 100%; overflow: hidden; border-radius: 16px; }
.product-card .card-img-custom {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 16px 16px 0 0;
}
.product-card .card-title { font-size: .95rem; font-weight: 700; line-height: 1.35; }
.product-card .card-title a { color: var(--ink); text-decoration: none; }
.product-card .card-title a:hover { color: var(--purple); }
.discount-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: #ff5d5d; color: #fff; font-weight: 800; font-size: .72rem;
  padding: 4px 10px; border-radius: 999px; box-shadow: 0 4px 10px rgba(255, 93, 93, .3);
}
.product-price-current { color: var(--purple); font-weight: 800; font-size: 1.02rem; margin: 0; }
.product-card .btn-add-card {
  border-radius: 999px !important; width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
}
.add-to-cart-ajax:disabled { opacity: .6; cursor: not-allowed; }
.add-to-cart-ajax:hover { animation: p-pulse .3s ease-in-out; }
@keyframes p-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* Breadcrumb, pagination, table, forms */
.breadcrumb { font-size: .9rem; }
.breadcrumb a { color: var(--purple); text-decoration: none; }
.breadcrumb-item.active { color: #6d6a7f; }
.table thead th { color: var(--ink); font-weight: 700; border-bottom: 2px solid #e8e4ec; }
.table td, .table th { vertical-align: middle; }
.page-link { color: var(--purple); border-radius: 999px !important; margin: 0 3px; }
.page-item.active .page-link { background-color: var(--purple); border-color: var(--purple); color: #fff; }
.form-control, .form-select { border-radius: 10px; border-color: #e8e4ec; padding: 10px 14px; }
.form-control:focus, .form-select:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(117, 87, 199, .12); }
.list-group-item-action:hover { background: #f7f3ff; }
.badge-pill-lavender { background: #eee8ff; color: #59409e; font-weight: 600; border-radius: 999px; padding: 6px 13px; }
.alert { border-radius: 14px; }
.alert-info { background: #f7f3ff; border-color: #ded5f5; color: #59409e; }

/* Huong dan mua hang timeline */
.timeline { position: relative; padding-left: 3rem; }
.timeline::before { content: ''; position: absolute; left: 1.5rem; top: 0; bottom: 0; width: 2px; background: var(--purple); }
.timeline-item { position: relative; padding-bottom: 2rem; }
.timeline-marker { position: absolute; left: -3rem; top: 0; width: 3rem; height: 3rem; display: flex; align-items: center; justify-content: center; }
.timeline-marker .badge { width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.timeline-content { background: #eee8ff; padding: 1rem; border-radius: 12px; border-left: 3px solid var(--purple); }
.timeline-content h6 { color: var(--purple); margin-bottom: .5rem; }

/* Cart modal + toast animations */
#cartNotificationModal .modal-content { border-radius: 16px; border: 0; }
#cartNotificationModal .modal-header {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%) !important;
}
#cartNotificationModal .modal-body img { max-height: 80px; object-fit: cover; border-radius: 10px; }
.modal-footer-mobile { display: flex; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* Sneat utility fallbacks used by public views */
.mb-6 { margin-bottom: 3.5rem !important; }
.fs-tiny { font-size: .75rem; }

/* Request form in template uses .request-form; ensure select/textarea render */
.request-form select, .request-form textarea, .request-form input { font-family: inherit; }
