/**
 * Sahasra Tech - Clean & Minimal Creator Storefront Stylesheet
 *
 * Inspired by Linktree Creator Shop (clean, minimal, mobile-first).
 * Typography: Space Grotesk (Headings/Numbers) + Inter (UI/Body).
 * Palette: Purple & White with dark high-contrast accents.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --st-font-heading: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    --st-font-body: 'Inter', system-ui, -apple-system, sans-serif;

    /* Core Palette */
    --st-purple-primary: #6C2BD9;
    --st-purple-deep: #4C1D95;
    --st-purple-secondary: #7C3AED;
    --st-purple-light: #F3E8FF;
    --st-purple-very-light: #FAF7FF;
    --st-white: #FFFFFF;
    --st-dark: #121212;
    --st-dark-surface: #1E1E1E;
    --st-text-primary: #171717;
    --st-text-secondary: #6B7280;
    --st-text-muted: #9CA3AF;
    --st-border: #E9DDF7;
    --st-border-light: #F1E9FA;
    --st-pill-bg: #EFE6FA;
    --st-card-bar-bg: #121212;

    --st-radius-pill: 9999px;
    --st-radius-card: 16px;
    --st-shadow-card: 0 4px 14px rgba(0, 0, 0, 0.05);
    --st-shadow-hover: 0 8px 24px rgba(108, 43, 217, 0.12);
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--st-font-body);
    background-color: var(--st-purple-very-light);
    color: var(--st-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Page Layout Container */
.st-container {
    width: 100%;
    max-width: 680px; /* Clean Linktree-style column width */
    margin: 0 auto;
    padding: 0 16px;
}

/* 1. Top Action Navigation Bar */
.st-top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 8px 0;
}

.st-brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--st-text-primary);
}

.st-brand-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid var(--st-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--st-purple-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.st-brand-logo-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.st-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--st-white);
    border: 1px solid var(--st-border);
    color: var(--st-text-primary);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.st-nav-btn:hover {
    background: var(--st-purple-light);
    color: var(--st-purple-primary);
    border-color: var(--st-purple-primary);
    transform: scale(1.04);
}

.st-nav-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* 2. Creator Profile Section */
.st-profile-section {
    text-align: center;
    padding: 8px 0 16px 0;
}

.st-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
}

.st-avatar {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--st-white);
    box-shadow: 0 0 0 3px var(--st-purple-primary), 0 8px 20px rgba(108, 43, 217, 0.2);
    display: block;
    background: var(--st-purple-light);
}

.st-avatar-placeholder {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    border: 3px solid var(--st-white);
    box-shadow: 0 0 0 3px var(--st-purple-primary), 0 8px 20px rgba(108, 43, 217, 0.2);
    background: linear-gradient(135deg, var(--st-purple-primary), var(--st-purple-deep));
    color: var(--st-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--st-font-heading);
    font-size: 32px;
    font-weight: 700;
}

.st-creator-name {
    font-family: var(--st-font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--st-text-primary);
    margin: 0 0 6px 0;
    letter-spacing: -0.5px;
}

.st-creator-bio {
    font-family: var(--st-font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--st-text-secondary);
    max-width: 440px;
    margin: 0 auto 14px auto;
    line-height: 1.5;
}

/* 3. Social Media Icons (Clean & Minimal) */
.st-social-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 18px;
}

.st-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--st-text-primary);
    background: transparent;
    transition: transform 0.15s ease, color 0.15s ease;
}

.st-social-btn:hover {
    color: var(--st-purple-primary);
    transform: scale(1.15);
}

.st-social-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* 4. Sleek Pill Switcher: Shop 1st | Links 2nd */
.st-tab-switch-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.st-tab-switch {
    display: inline-flex;
    background: #E5DCF3;
    padding: 3px;
    border-radius: var(--st-radius-pill);
    gap: 2px;
}

.st-tab-btn {
    padding: 8px 24px;
    border-radius: var(--st-radius-pill);
    font-family: var(--st-font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--st-text-primary);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.st-tab-btn.active {
    background: var(--st-dark);
    color: var(--st-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 5. Minimal Pill Search Bar with Typing Animation */
.st-search-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.st-search-wrapper.is-sticky {
    position: sticky;
    top: 10px;
    z-index: 100;
}

.st-search-inner {
    display: flex;
    align-items: center;
    background: var(--st-white);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius-pill);
    padding: 8px 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.st-search-inner:focus-within {
    border-color: var(--st-purple-primary);
    box-shadow: 0 0 0 3px rgba(108, 43, 217, 0.12);
}

.st-search-icon {
    color: var(--st-text-secondary);
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.st-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--st-font-body);
    font-size: 14px;
    color: var(--st-text-primary);
    outline: none;
    padding: 4px 0;
}

.st-search-input::placeholder {
    color: #9CA3AF;
    transition: opacity 0.15s ease;
}

.st-search-clear {
    background: none;
    border: none;
    color: #9CA3AF;
    font-size: 18px;
    cursor: pointer;
    display: none;
    padding: 0 4px;
    line-height: 1;
}

.st-search-clear.visible {
    display: block;
}

/* Autocomplete Dropdown */
.st-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: var(--st-white);
    border: 1px solid var(--st-border);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    z-index: 150;
    max-height: 380px;
    overflow-y: auto;
    display: none;
}

.st-autocomplete-dropdown.open {
    display: block;
}

.st-ac-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--st-border-light);
    text-decoration: none;
    color: var(--st-text-primary);
    gap: 12px;
    transition: background 0.1s ease;
}

.st-ac-item:last-child {
    border-bottom: none;
}

.st-ac-item:hover, .st-ac-item:active {
    background: var(--st-purple-very-light);
}

.st-ac-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    background: #F3F4F6;
    flex-shrink: 0;
}

.st-ac-info {
    flex: 1;
    min-width: 0;
}

.st-ac-number {
    font-family: var(--st-font-heading);
    font-size: 12px;
    font-weight: 700;
    color: var(--st-purple-primary);
}

.st-ac-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--st-text-primary);
}

.st-ac-merchant {
    font-size: 11px;
    color: var(--st-text-secondary);
}

.st-ac-action {
    font-size: 14px;
    color: var(--st-purple-primary);
    font-weight: 700;
    flex-shrink: 0;
}

/* 6. Minimal Category Chips */
.st-chips-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 16px 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.st-chips-scroll::-webkit-scrollbar {
    display: none;
}

.st-chip {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 6px 14px;
    border-radius: var(--st-radius-pill);
    font-family: var(--st-font-body);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    background: var(--st-white);
    border: 1px solid var(--st-border);
    color: var(--st-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.st-chip:hover {
    border-color: var(--st-dark);
    color: var(--st-dark);
}

.st-chip.active {
    background: var(--st-dark);
    border-color: var(--st-dark);
    color: var(--st-white);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* 7. Product Grid Layout (2-Column Linktree Style) */
.st-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (min-width: 640px) {
    .st-grid {
        gap: 16px;
    }
}

/* 8. Product Card (Exact Linktree Creator Aesthetic: # Number badge + Only Title in bar) */
.st-card {
    background: var(--st-white);
    border-radius: var(--st-radius-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--st-shadow-card);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.04);
    -webkit-tap-highlight-color: transparent;
}

.st-card:hover, .st-card:active {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.09);
}

/* Image Canvas: 1:1 Aspect Ratio (Zero CLS) */
.st-card-image-wrap {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #FFFFFF;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.st-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    transition: transform 0.25s ease;
}

.st-card:hover .st-card-img {
    transform: scale(1.05);
}

.st-card-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D1D5DB;
    background: #F9FAFB;
}

/* Crisp # Number Badge on Card Image */
.st-card-num-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    color: var(--st-purple-primary);
    font-family: var(--st-font-heading);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--st-radius-pill);
    border: 1px solid var(--st-border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    letter-spacing: 0.3px;
    z-index: 2;
}

/* Sleek Bottom Dark Bar (Only Product Title + Options Icon) */
.st-card-bar {
    background: var(--st-card-bar-bg);
    color: var(--st-white);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 48px;
}

.st-card-bar-title {
    font-family: var(--st-font-body);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    color: #FFFFFF;
}

.st-card-bar-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9CA3AF;
    flex-shrink: 0;
    padding: 2px;
}

.st-card:hover .st-card-bar-action {
    color: var(--st-white);
}

/* 9. Curated Links Tab (Linktree Classic List) */
.st-links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.st-link-item {
    display: flex;
    align-items: center;
    background: var(--st-white);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius-pill);
    padding: 14px 20px;
    text-decoration: none;
    color: var(--st-text-primary);
    box-shadow: var(--st-shadow-card);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.st-link-item:hover, .st-link-item:active {
    transform: translateY(-2px);
    border-color: var(--st-purple-primary);
    box-shadow: var(--st-shadow-hover);
}

.st-link-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--st-purple-light);
    color: var(--st-purple-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 14px;
}

.st-link-content {
    flex: 1;
    text-align: center;
}

.st-link-title {
    font-family: var(--st-font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--st-text-primary);
    margin: 0;
}

.st-link-desc {
    font-size: 11px;
    color: var(--st-text-secondary);
    margin: 2px 0 0 0;
}

.st-link-arrow {
    color: var(--st-text-secondary);
    font-size: 16px;
    flex-shrink: 0;
}

/* 10. Load More & Zero Results */
.st-load-more-wrap {
    text-align: center;
    margin: 16px 0 36px 0;
}

.st-btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--st-white);
    border: 1px solid var(--st-border);
    color: var(--st-text-primary);
    padding: 10px 24px;
    border-radius: var(--st-radius-pill);
    font-family: var(--st-font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease;
}

.st-btn-load-more:hover {
    border-color: var(--st-purple-primary);
    color: var(--st-purple-primary);
}

.st-zero-results {
    text-align: center;
    padding: 40px 20px;
    background: var(--st-white);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius-card);
    grid-column: 1 / -1;
}

.st-zero-results h3 {
    font-family: var(--st-font-heading);
    font-size: 16px;
    color: var(--st-text-primary);
    margin: 0 0 4px 0;
}

.st-zero-results p {
    font-size: 13px;
    color: var(--st-text-secondary);
    margin: 0;
}

/* 11. Footer */
.st-footer {
    padding: 24px 0 36px 0;
    text-align: center;
    font-size: 11px;
    color: var(--st-text-secondary);
}

.st-disclosure {
    max-width: 480px;
    margin: 0 auto 12px auto;
    line-height: 1.45;
}

.st-footer-links {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 8px;
}

.st-footer-links a {
    color: var(--st-text-secondary);
    text-decoration: none;
}

.st-footer-links a:hover {
    color: var(--st-purple-primary);
}

/* Toast notification */
.st-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--st-dark);
    color: var(--st-white);
    padding: 10px 20px;
    border-radius: var(--st-radius-pill);
    font-family: var(--st-font-body);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 99999;
    pointer-events: none;
}

.st-toast.active {
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 360px) {
    .st-card-bar-title {
        font-size: 11px;
    }
    .st-creator-name {
        font-size: 20px;
    }
}
