* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Side spacing of the page; grows on bigger screens */
:root {
    --gutter: 16px;
}

@media (min-width: 768px) {
    :root {
        --gutter: 32px;
    }
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #ffffff;
    color: #333333;
    line-height: 1.6;
    overflow-x: clip; /* never scroll sideways, without breaking the sticky nav */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px var(--gutter) 40px;
    min-height: 100vh;
}

/* ---------- Header ---------- */
.search-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    z-index: 100;
    cursor: pointer;
}

.search-toggle {
    width: 24px;
    height: 24px;
    cursor: pointer;
    stroke: #666;
    stroke-width: 2;
    fill: none;
    transition: all 0.2s ease;
}

.search-toggle:hover {
    stroke: #333;
}

.search-input {
    position: relative;
    width: 0;
    height: 32px;
    padding: 0 12px;
    margin-left: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    background-color: #fff;
    font-size: 16px; /* 16px stops iPhones zooming in when typing */
    outline: none;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.search-input.active {
    width: min(240px, 60vw);
    opacity: 1;
    pointer-events: all;
}

.search-input:focus {
    border-color: #333;
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 12px 0 20px;
}

.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #f5f5f5;
    border: 2px solid #e0e0e0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.profile-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.profile-description {
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* ---------- Social Media Icons ---------- */
.social-section {
    margin-bottom: 20px;
    text-align: center;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
}

.social-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    transition: all 0.2s ease;
}

.social-icon svg {
    width: 20px;
    height: 20px;
}

.email-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #333;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 16px;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    text-align: center;
    max-width: calc(100vw - 32px);
    overflow-wrap: anywhere;
}

.email-popup.show {
    display: block;
}

.email-address {
    font-size: 13px;
    font-style: italic;
    font-weight: 500;
}

/* ---------- Search ---------- */
.no-results {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 20px 0;
    display: none;
}

.hidden {
    display: none !important;
}

/* ---------- Category Navigation ---------- */
.category-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    gap: 18px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 10px var(--gutter) 8px;
    margin: 0 calc(-1 * var(--gutter)) 20px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.category-nav::-webkit-scrollbar {
    display: none;
}

/* Centred when everything fits, scrollable from the left when it doesn't */
.nav-pill:first-child { margin-left: auto; }
.nav-pill:last-child { margin-right: auto; }

.nav-pill {
    flex: 0 0 auto;
    padding-bottom: 3px;
    font-size: 12px;
    color: #aaa;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-pill.active {
    color: #333;
    border-bottom-color: #333;
}

/* ---------- Sections & carousels ---------- */
.section {
    padding: 28px 0 4px;
    border-top: 1px solid #f0f0f0;
    scroll-margin-top: 40px; /* keeps titles clear of the sticky nav */
}

.section:first-child {
    border-top: none;
    padding-top: 4px;
}

/* Title on the left, arrows on the right */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    min-height: 32px;
}

.section-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #333;
}

.carousel-controls {
    display: none; /* phones swipe; arrows appear on computers below */
    gap: 6px;
}

.carousel-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding-bottom: 2px;
    border-radius: 50%;
    border: 1px solid #e5e5e5;
    background: #fff;
    color: #333;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.carousel-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

/* The carousel runs into the page margins so cards can use the full screen width */
.carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
    margin: 0 calc(-1 * var(--gutter));
    padding: 4px var(--gutter) 12px; /* room for the hover lift and shadow */
}

.carousel::-webkit-scrollbar {
    display: none;
}

/* Small bar under each row showing how far along you are */
.carousel-progress {
    width: 56px;
    height: 3px;
    margin: 4px auto 0;
    border-radius: 3px;
    background: #ececec;
    overflow: hidden;
}

.carousel-progress span {
    display: block;
    height: 100%;
    width: 30%;
    border-radius: 3px;
    background: #999;
    transition: transform 0.1s linear;
}

/* Phones: one big card with the next one peeking in, snapping into place */
.product-card {
    flex: 0 0 min(calc(100% - 24px), 360px);
    scroll-snap-align: start;
    background-color: #f9f9f9;
    border-radius: 12px;
    padding: 14px;
    border: 1px solid #e0e0e0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: none) {
    .carousel {
        scroll-snap-type: x mandatory;
    }
}

@media (min-width: 768px) {
    .carousel {
        gap: 16px;
        /* Soft fade where cards run off the edge */
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%);
    }

    .product-card {
        flex-basis: 300px;
        padding: 16px;
    }

    .section {
        padding-top: 36px;
    }

    .section-title {
        font-size: 19px;
    }
}

.product-card > a { /* the whole-card link, not the small store buttons */
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    background-color: #e8e8e8;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 6px;
    color: #333;
}

.product-description {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Cards with several store buttons */
.product-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.product-header .product-title {
    margin-bottom: 0;
}

.product-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mini-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 7px;
    font-size: 11px;
    line-height: 1.2;
    text-decoration: none;
    border-radius: 4px;
    white-space: nowrap;
    background: #333;
    color: #fff;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.mini-btn.amazon {
    background: #ff9900;
    color: #000;
}

/* Computers with a mouse: arrows, drag cursor and hover effects */
@media (hover: hover) and (pointer: fine) {
    .carousel-controls {
        display: flex;
    }

    .carousel-arrow:not(:disabled):hover {
        background: #333;
        border-color: #333;
        color: #fff;
    }

    .carousel {
        cursor: grab;
    }

    .carousel.dragging {
        cursor: grabbing;
        scroll-behavior: auto;
        user-select: none;
    }

    .product-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .mini-btn:hover {
        opacity: 0.9;
        transform: translateY(-1px);
    }

    .social-icon:hover {
        background-color: #333;
        color: #fff;
        transform: translateY(-2px);
    }

    .nav-pill:hover {
        color: #666;
    }

    .category-link:hover {
        background-color: #333;
        color: #fff;
        transform: translateY(-1px);
    }
}

/* ---------- Media kit link ---------- */
.section-divider {
    border: none;
    border-top: 1px solid rgba(128, 128, 128, 0.6);
    margin: 32px calc(-1 * var(--gutter));
}

.section#categories {
    max-width: 480px;
    margin: 32px auto 0;
}

.category-link {
    display: block;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
}

.category-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.category-description {
    font-size: 14px;
    opacity: 0.8;
}

/* ---------- "Open in browser" panel (only inside Instagram/TikTok/... browsers) ---------- */
.browser-sheet {
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.browser-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.browser-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 480px;
    margin: 0 auto;
    padding: 10px 24px calc(24px + env(safe-area-inset-bottom));
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(100%);
    transition: transform 0.25s ease;
    text-align: center;
}

.browser-sheet.open .browser-sheet-backdrop { opacity: 1; }
.browser-sheet.open .browser-sheet-panel { transform: translateY(0); }

.browser-sheet-handle {
    width: 36px;
    height: 4px;
    margin: 0 auto 18px;
    border-radius: 2px;
    background: #e0e0e0;
}

.browser-sheet-panel h3 {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.browser-sheet-panel p {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 18px;
}

.browser-sheet-steps {
    list-style: none;
    counter-reset: step;
    text-align: left;
    background: #f7f7f7;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.browser-sheet-steps li {
    counter-increment: step;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
    padding: 4px 0;
}

.browser-sheet-steps li::before {
    content: counter(step);
    flex: 0 0 22px;
    height: 22px;
    border-radius: 50%;
    background: #333;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.browser-sheet-dots {
    display: inline-block;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.5;
}

.browser-sheet-secondary {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    color: #666;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}
