/* =====================================================================
   Phase 174 - shopper's store home (item_listing_shared.php).
   Simple on purpose: store name, search, categories, products.
   Everything here is scoped to body.ss-shop or sh-* classes, so the
   merchant pages that share header.php/footer.php are untouched.
   ===================================================================== */
/* overflow-x: hidden (set by the theme on phones) turns body into a scroll box and stops the
   bars from sticking; clip hides the same overflow without that side effect. */
body.ss-shop { background: #f6f7fb; overflow-x: clip !important; }
/* The theme makes body one screen tall; the top bar sticks only inside body, so it scrolled away. */
body.ss-shop { height: auto; min-height: 100%; }
body.ss-shop .sh-fluid { padding: 0; }
.sh-wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ---- Top bar: white and quiet for shoppers (owners keep their blue admin bar) ---- */
body.ss-shop:not(.ss-owner) .ss-nav { background: #fff; box-shadow: 0 1px 0 #e6e8f0; }
body.ss-shop:not(.ss-owner) .ss-nav-brand { background: none; color: #1e2a52; padding: 0; max-width: 70vw; display: flex; align-items: center; gap: 10px; }
.sh-nav-badge { display: none; }
body.ss-shop:not(.ss-owner) .sh-nav-badge {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px;
    width: 34px; height: 34px; border-radius: 10px; background: var(--ss-primary); color: #fff; font-size: 13px;
}
.sh-nav-name { overflow: hidden; text-overflow: ellipsis; }
body.ss-shop:not(.ss-owner) .ss-nav-cart { background: #eef0fb; color: var(--ss-primary); }
body.ss-shop:not(.ss-owner) .ss-nav-actions { margin-left: auto; }
/* One cart: the bar's cart stays on screen, so the floating copy is not needed here. */
body.ss-shop .ss-fab-cart { display: none !important; }

/* ---- Store intro ---- */
.sh-intro { background: #fff; border-bottom: 1px solid #eceef5; }
.sh-intro-inner { display: flex; align-items: center; gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.sh-avatar {
    flex: 0 0 64px; width: 64px; height: 64px; border-radius: 16px;
    background: var(--ss-primary); color: #fff; font-size: 24px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.sh-intro-text { flex: 1 1 auto; min-width: 0; }
.sh-store-name { font-size: 24px; font-weight: 800; color: #1e2a52; margin: 0 0 4px; line-height: 1.2; }
.sh-store-sub { font-size: 14px; color: #6b7490; }
.sh-store-sub .fa { color: var(--ss-accent); margin-right: 4px; }
.sh-dot { margin: 0 8px; }
.sh-intro-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.sh-pill {
    display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 999px;
    border: 1px solid #d9ddec; background: #fff; color: #1e2a52; font-size: 14px; font-weight: 600;
    text-decoration: none; cursor: pointer;
}
.sh-pill:hover { border-color: var(--ss-primary); color: var(--ss-primary); text-decoration: none; }
.sh-pill-primary { background: var(--ss-primary); border-color: var(--ss-primary); color: #fff; }
.sh-pill-primary:hover { background: var(--ss-primary-dark); color: #fff; }

/* ---- Search + categories: stays under the top bar while scrolling ---- */
.sh-bar { position: sticky; top: 60px; z-index: 1020; background: #f6f7fb; padding: 14px 0 4px; }
.sh-bar-row { display: flex; gap: 10px; }
.sh-search {
    flex: 1 1 auto; display: flex; align-items: center; background: #fff;
    border: 1px solid #d9ddec; border-radius: 12px; padding: 0 10px 0 14px; height: 48px;
}
.sh-search:focus-within { border-color: var(--ss-primary); box-shadow: 0 0 0 3px rgba(63, 81, 181, .12); }
.sh-search input { flex: 1; border: none; outline: none; background: none; font-size: 15px; min-width: 0; }
.sh-sort {
    flex: 0 0 auto; display: flex; align-items: center; gap: 6px; margin: 0; background: #fff;
    border: 1px solid #d9ddec; border-radius: 12px; padding: 0 10px; height: 48px; color: #6b7490;
}
.sh-sort select { border: none; background: none; outline: none; font-size: 14px; color: #1e2a52; cursor: pointer; }
.sh-cats { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 8px; margin: 0; scrollbar-width: none; }
.sh-cats::-webkit-scrollbar { display: none; }
.sh-cats .ss-cat-tab {
    flex: 0 0 auto; white-space: nowrap; border: 1px solid #d9ddec; background: #fff; color: #1e2a52;
    border-radius: 999px; padding: 7px 16px; font-size: 14px; font-weight: 600;
}
.sh-cats .ss-cat-tab.active { background: #1e2a52; border-color: #1e2a52; color: #fff; }

.sh-main { padding-top: 8px; padding-bottom: 40px; }

/* ---- Featured banner: text panel + whole photo ---- */
.sh-banner { position: relative; margin-bottom: 18px; }
.sh-banner-slide {
    display: none; grid-template-columns: 1fr 1fr; min-height: 240px; border-radius: 16px; overflow: hidden;
    background: linear-gradient(120deg, #1e2a52, #3f51b5);
}
.sh-banner-slide.on { display: grid; }
.sh-banner-text { padding: 28px 30px; color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.sh-banner-badge { background: var(--ss-accent); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; margin-bottom: 10px; }
.sh-banner-title { font-size: 26px; font-weight: 800; line-height: 1.2; margin-bottom: 6px; }
.sh-banner-desc { font-size: 14px; opacity: .85; margin-bottom: 10px; }
.sh-banner-price { font-size: 20px; font-weight: 800; margin-bottom: 14px; }
.sh-banner-price s { font-size: 14px; font-weight: 400; opacity: .6; margin-left: 6px; }
.sh-banner-btn { background: #fff; color: #1e2a52; padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 14px; text-decoration: none; }
.sh-banner-btn:hover { background: #eef0fb; color: #1e2a52; text-decoration: none; }
.sh-banner-img { background: #fff; display: flex; align-items: center; justify-content: center; }
.sh-banner-img img { width: 100%; height: 100%; max-height: 300px; object-fit: contain; }
.sh-banner-dots { position: absolute; left: 30px; bottom: 12px; display: flex; gap: 6px; }
.sh-banner-dot { width: 8px; height: 8px; padding: 0; border: none; border-radius: 50%; background: rgba(255, 255, 255, .45); cursor: pointer; }
.sh-banner-dot.on { background: #fff; width: 20px; border-radius: 4px; }

/* ---- Section head + grid ---- */
.sh-section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 0 12px; }
.sh-section-title { font-size: 20px; font-weight: 800; color: #1e2a52; margin: 0; }
.sh-count { font-size: 13px; color: #6b7490; }
.sh-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.sh-grid > .col-12 { grid-column: 1 / -1; }

/* Cards on this page: square photo, clear price, one button. */
.sh-grid .ss-card { border-color: #eceef5; border-radius: 14px; box-shadow: none; }
.sh-grid .ss-card:hover { box-shadow: 0 8px 22px rgba(30, 42, 82, .10); }
.sh-grid .ss-image-container { height: auto; aspect-ratio: 1 / 1; background: #fff; border-radius: 14px 14px 0 0; }
.sh-grid .ss-image-container img { object-fit: contain; }
.sh-grid .ss-image-container::after { display: none; }   /* the grey fade muddied white product shots */
.sh-grid .ss-card-body { padding: 10px 12px 12px; }
.sh-grid .ss-title {
    font-size: 14px; font-weight: 600; min-height: 2.6em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sh-grid .ss-desc { display: none; }
.sh-grid .ss-pricing { margin-bottom: 8px; }
.sh-grid .ss-price { font-size: 17px; }
.sh-grid .ss-btn-cart { border-radius: 10px; padding: 9px 8px; }

/* Loading placeholders */
.sh-skel { background: #fff; border: 1px solid #eceef5; border-radius: 14px; padding: 0 0 12px; overflow: hidden; }
.sh-skel-img, .sh-skel-line, .sh-skel-btn {
    background: linear-gradient(90deg, #eef0f5 25%, #f7f8fb 50%, #eef0f5 75%);
    background-size: 200% 100%; animation: sh-shine 1.2s infinite linear;
}
.sh-skel-img { aspect-ratio: 1 / 1; }
.sh-skel-line { height: 12px; border-radius: 6px; margin: 12px 12px 0; }
.sh-skel-line.short { width: 45%; }
.sh-skel-btn { height: 34px; border-radius: 10px; margin: 14px 12px 0; }
@keyframes sh-shine { to { background-position: -200% 0; } }

.sh-empty { text-align: center; padding: 56px 16px; color: #6b7490; }
.sh-empty-ico { font-size: 34px; color: #c3c8da; margin-bottom: 10px; }
.sh-empty-msg { font-size: 15px; margin-bottom: 14px; }

/* ---- Footer ---- */
.sh-footer { background: #fff; border-top: 1px solid #eceef5; margin-top: 20px; }
.sh-footer-inner { max-width: 1240px; margin: 0 auto; padding: 24px 16px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sh-footer-name { font-weight: 800; color: #1e2a52; font-size: 16px; }
.sh-footer-addr { color: #6b7490; font-size: 13.5px; margin-top: 4px; }
.sh-footer-contact { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.sh-footer-contact a { color: #1e2a52; }
.sh-footer-powered { text-align: center; font-size: 12.5px; color: #8a93a6; padding: 12px 16px 20px; border-top: 1px solid #f0f1f6; }

/* ---- Responsive ---- */
@media (max-width: 1100px) { .sh-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px)  { .sh-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
    .sh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .sh-intro-inner { flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; gap: 12px; }
    .sh-avatar { flex-basis: 52px; width: 52px; height: 52px; font-size: 19px; border-radius: 13px; }
    .sh-store-name { font-size: 19px; }
    .sh-store-sub { font-size: 13px; }
    .sh-intro-actions { width: 100%; }
    .sh-intro-actions .sh-pill { flex: 1; justify-content: center; }
    /* Sort shrinks to its icon; the invisible select on top still opens the list. */
    .sh-sort { position: relative; width: 48px; justify-content: center; padding: 0; }
    .sh-sort select { position: absolute; inset: 0; width: 100%; opacity: 0; }
    .sh-avatar { display: none; }   /* the bar above already shows the badge */
    .sh-grid .ss-stock-qty { display: none; }
    .sh-banner-slide { grid-template-columns: 1fr; }
    .sh-banner-img { order: -1; height: 180px; }
    .sh-banner-text { padding: 18px 18px 30px; }
    .sh-banner-title { font-size: 20px; }
    .sh-banner-dots { left: 18px; }
    .sh-grid .ss-card-body { padding: 8px 10px 10px; }
    .sh-grid .ss-title { font-size: 13.5px; }
    .sh-grid .ss-price { font-size: 16px; }
    .sh-grid .ss-btn-cart { padding: 10px 6px; font-size: 13px; }
}
