/* ============================================================
   Botpey Marketplace — home & browse pages design system
   Companion to css/home.css (bp-* tokens). Tailwind CDN powers
   most utilities; this file adds carousel & hero helpers.

   App-spec tokens (v2): brand #1BAC4B, canvas #FAFAFA,
   borders #EEEEEE, ink #212121 / #757575 / #9E9E9E / #BDBDBD,
   danger #F75555. Pill radii + soft shadows.
   ============================================================ */

/* --- spec palette as CSS vars --- */
:root {
    --mp-brand: #147a45;
    --mp-brand-dark: #0f6237;
    --mp-brand-light: #eaf5ee;
    --mp-canvas: #f5f6f5;
    --mp-line: #dfe3df;
    --mp-ink: #18201b;
    --mp-ink-muted: #56605a;
    --mp-ink-faint: #737d76;
    --mp-placeholder: #BDBDBD;
    --mp-danger: #F75555;
}

/* --- Alpine x-cloak --- */
[x-cloak] {
    display: none !important;
}

/* --- hide scrollbars on horizontal carousels --- */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* --- carousel snap --- */
.carousel-snap {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.carousel-snap > * {
    scroll-snap-align: start;
}

/* --- soft fade-in-up for sections --- */
@keyframes mp-fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
.mp-fade-up {
    animation: mp-fade-up .55s ease-out both;
}

/* --- hero decorations (blurred blobs + grid) --- */
.mp-hero-grid {
    background-image:
        linear-gradient(rgba(255,255,255,.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.14) 1px, transparent 1px);
    background-size: 42px 42px;
}
.mp-blob {
    position: absolute;
    border-radius: 9999px;
    filter: blur(70px);
    pointer-events: none;
}

/* --- store logo fallback avatar --- */
.mp-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #059669, #65a30d);
}

/* --- product image placeholder --- */
.mp-product-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a7f3d0;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
}

/* --- price styling --- */
.mp-price {
    color: var(--mp-brand);
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* --- banner dots --- */
.mp-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: rgba(255,255,255,.45);
    transition: all .25s ease;
}
.mp-dot--active {
    background: #fff;
    width: 22px;
}

/* --- suggestion dropdown --- */
.mp-suggest {
    animation: mp-fade-up .18s ease-out both;
}

/* --- bottom nav safe area for iOS --- */
.mp-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Marketplace v3: compact, dependable, Android-inspired commerce UI */
.mp-app {
    min-width: 320px;
    color: var(--mp-ink);
    background: var(--mp-canvas);
    font-family: "Noto Sans", Roboto, system-ui, sans-serif;
    font-feature-settings: "tnum" 1;
    padding: 0;
}
.mp-app main { min-height: calc(100vh - 128px); }
.mp-app .font-extrabold { font-weight: 700; }
.mp-app .shadow-card { box-shadow: 0 1px 2px rgba(24,32,27,.06); }
.mp-app .shadow-float { box-shadow: 0 6px 18px rgba(24,32,27,.10); }
.mp-app .rounded-3xl { border-radius: 16px; }
.mp-app .rounded-2xl { border-radius: 12px; }
.mp-app button, .mp-app a { -webkit-tap-highlight-color: transparent; }
.mp-app button:focus-visible, .mp-app a:focus-visible, .mp-app input:focus-visible,
.mp-app select:focus-visible, .mp-app textarea:focus-visible {
    outline: 3px solid rgba(20,122,69,.22);
    outline-offset: 2px;
}
.mp-app-header { box-shadow: 0 1px 4px rgba(24,32,27,.08); }
.mp-location-trigger {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
    min-height: 40px; padding: 5px 10px; border-left: 1px solid var(--mp-line);
}
.mp-icon-button {
    width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: var(--mp-ink-muted); border-radius: 50%;
}
.mp-icon-button:hover { color: var(--mp-brand); background: var(--mp-brand-light); }
.mp-search-input {
    width: 100%; height: 46px; padding: 0 48px; border: 1px solid #aeb7b1;
    border-radius: 10px; background: #fff; color: var(--mp-ink); font-size: 14px;
    font-weight: 500; outline: none; transition: border-color .15s, box-shadow .15s;
}
.mp-search-input:focus { border-color: var(--mp-brand); box-shadow: 0 0 0 3px rgba(20,122,69,.12); }
.mp-search-filter {
    position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    color: var(--mp-brand-dark); border-left: 1px solid var(--mp-line);
}
.mp-language-button {
    min-height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 0 8px;
    color: var(--mp-ink-muted); font-size: 12px; font-weight: 700;
}
.mp-language-button:hover { color: var(--mp-brand); }
.mp-language-menu {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 100; width: 250px;
    max-height: min(70vh, 480px); overflow-y: auto; background: white;
    border: 1px solid var(--mp-line); border-radius: 12px; box-shadow: 0 12px 32px rgba(24,32,27,.16);
}
.mp-language-title { padding: 14px 16px 8px; color: var(--mp-ink-faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.mp-language-option { min-height: 48px; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; color: var(--mp-ink); }
.mp-language-option:hover, .mp-language-option.is-active { background: var(--mp-brand-light); color: var(--mp-brand-dark); }
.mp-language-option strong, .mp-language-option small { display: block; }
.mp-language-option strong { font-size: 14px; font-weight: 600; }
.mp-language-option small { color: var(--mp-ink-faint); font-size: 11px; }
.mp-desktop-nav { display: none; height: 40px; border-top: 1px solid var(--mp-line); background: #fff; }
.mp-desktop-nav a { height: 40px; display: inline-flex; align-items: center; color: var(--mp-ink-muted); font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent; }
.mp-desktop-nav a:hover, .mp-desktop-nav a.is-active { color: var(--mp-brand-dark); border-bottom-color: var(--mp-brand); }
.mp-offer-slide { background-size: cover; background-position: center; }
.mp-offer-slide__scrim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,15,11,.92) 0%, rgba(5,15,11,.68) 38%, rgba(5,15,11,.05) 72%); }
@media (min-width: 768px) {
    .mp-desktop-nav { display: block; }
    .mp-app main { min-height: calc(100vh - 176px); }
    .mp-bottom-nav { display: none !important; }
    .mp-app > .h-16, .mp-app main + .h-16 { display: none; }
}

@media (max-width: 639px) {
    .mp-app-header > div:first-child { padding: 8px 12px 10px; }
    .mp-app-header img { height: 28px; max-width: 74px; object-fit: contain; }
    .mp-location-trigger { max-width: 112px; padding-inline: 6px; }
    .mp-location-trigger span { min-width: 0; }
    .mp-location-trigger span span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mp-icon-button { width: 38px; height: 38px; }
    .mp-app-header .mp-icon-button[href*="notifications"] { display: none; }
    .mp-app-header a[aria-label="Profile"] { display: none; }
    .mp-search-input { height: 44px; }
    .mp-app main { padding-bottom: env(safe-area-inset-bottom, 0); }
    .mp-offer-slide { background-position: 58% center; }
    .mp-offer-slide__scrim { background: linear-gradient(90deg, rgba(5,15,11,.94) 0%, rgba(5,15,11,.72) 58%, rgba(5,15,11,.10) 100%); }
}
