/* ==========================================================================
   footprint.market - Carbon Offset Marketplace
   Seed: corporate gradient saas + medical clean teal
   ========================================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Palette from DESIGN.md */
    --clean-white: #ffffff;
    --page-gray: #f7f8fa;
    --ecosystem-teal: #0d9488;
    --deep-ocean: #134e4a;
    --price-green: #059669;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-subtle: #e5e7eb;
    --gold-tier: #d97706;
    --bronze-tier: #cd7f32;
    --silver-tier: #c0c0c0;

    /* Category stripes */
    --cat-reforestation: #0d9488;
    --cat-ocean: #3b82f6;
    --cat-solar: #eab308;
    --cat-industrial: #6b7280;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--page-gray);
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 23px, rgba(0,0,0,0.02) 23px, rgba(0,0,0,0.02) 24px),
        repeating-linear-gradient(90deg, transparent, transparent 23px, rgba(0,0,0,0.02) 23px, rgba(0,0,0,0.02) 24px);
}

a {
    color: var(--ecosystem-teal);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Hero Section --- */
#hero {
    background: linear-gradient(135deg, var(--ecosystem-teal) 0%, var(--deep-ocean) 100%);
    padding: 3.5rem 1.5rem 2.5rem;
    text-align: center;
}

.hero-inner {
    max-width: 720px;
    margin: 0 auto;
}

.hero-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 2.2rem;
    color: var(--clean-white);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.hero-dot {
    color: var(--gold-tier);
}

.hero-subtitle {
    font-family: 'Manrope', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.65;
    color: rgba(255,255,255,0.85);
    margin-bottom: 1.5rem;
}

/* Search bar */
.search-container {
    position: relative;
    max-width: 560px;
    margin: 0 auto 1.25rem;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

#search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    background: var(--clean-white);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#search-input::placeholder {
    color: var(--text-secondary);
}

#search-input:focus {
    border-color: var(--ecosystem-teal);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.15);
}

/* Filter pills */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.pill {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.35);
    background: transparent;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    transition: all 0.15s ease;
}

.pill:hover {
    background: rgba(255,255,255,0.15);
}

.pill.active {
    background: var(--clean-white);
    color: var(--ecosystem-teal);
    border-color: var(--clean-white);
}

/* --- Stats Bar --- */
.stats-bar {
    background: var(--clean-white);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 1.5rem;
}

.stats-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.stat-value {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.stat-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* --- Marketplace Main --- */
#marketplace {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.marketplace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.results-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-controls label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

#sort-select {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    background: var(--clean-white);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

/* --- Product Card --- */
.product-card {
    background: var(--clean-white);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
}

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

.card-stripe {
    height: 3px;
    width: 100%;
}

.card-stripe.reforestation { background-color: var(--cat-reforestation); }
.card-stripe.ocean { background-color: var(--cat-ocean); }
.card-stripe.solar { background-color: var(--cat-solar); }
.card-stripe.industrial { background-color: var(--cat-industrial); }

.card-body {
    padding: 16px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.card-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.3;
    margin-right: 0.5rem;
}

/* Verification badge (shield shape) */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 32px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    flex-shrink: 0;
    position: relative;
}

.badge.gold { background-color: var(--gold-tier); }
.badge.silver { background-color: var(--silver-tier); }
.badge.bronze { background-color: var(--bronze-tier); }

.badge-icon {
    color: var(--clean-white);
    font-size: 0.65rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    margin-top: 2px;
}

.card-location {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.card-location svg {
    flex-shrink: 0;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.card-price {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
    color: var(--price-green);
}

.card-price .unit {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.card-available {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.eco-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--price-green);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.card-tags {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.65rem;
    flex-wrap: wrap;
}

.card-tag {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    background: var(--page-gray);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

/* --- Detail Panel --- */
.detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
    z-index: 900;
}

.detail-overlay.active {
    opacity: 1;
    visibility: visible;
}

.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 400px;
    background: var(--clean-white);
    box-shadow: -4px 0 16px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    z-index: 1000;
    overflow-y: auto;
}

.detail-panel.active {
    transform: translateX(0);
}

.detail-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s;
    z-index: 10;
}

.detail-close:hover {
    background: var(--page-gray);
}

.detail-content {
    padding: 2rem 1.5rem 1.5rem;
}

/* Detail panel inner styles */
.detail-stripe {
    height: 4px;
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 2px;
}

.detail-stripe.reforestation { background-color: var(--cat-reforestation); }
.detail-stripe.ocean { background-color: var(--cat-ocean); }
.detail-stripe.solar { background-color: var(--cat-solar); }
.detail-stripe.industrial { background-color: var(--cat-industrial); }

.detail-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.detail-category {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.detail-location {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.detail-location svg {
    flex-shrink: 0;
}

.detail-badge-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.detail-badge-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.detail-description {
    font-family: 'Manrope', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.detail-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--page-gray);
    border-radius: 8px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.spec-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.spec-value {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.detail-price-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(13,148,136,0.06) 0%, rgba(5,150,105,0.06) 100%);
    border: 1px solid rgba(13,148,136,0.15);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.detail-price {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 1.5rem;
    color: var(--price-green);
    font-variant-numeric: tabular-nums;
}

.detail-price .unit {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.detail-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--ecosystem-teal);
    color: var(--clean-white);
    border: none;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.2s;
}

.detail-cta:hover {
    background: var(--deep-ocean);
}

.detail-standards {
    margin-top: 1.25rem;
}

.detail-standards h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.standard-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    background: var(--page-gray);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    margin-right: 0.35rem;
    margin-bottom: 0.35rem;
}

/* --- Footer --- */
#footer {
    background: var(--text-primary);
    color: rgba(255,255,255,0.75);
    margin-top: 3rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 1.5rem;
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--clean-white);
    display: block;
    margin-bottom: 0.5rem;
}

.footer-tagline {
    font-family: 'Manrope', sans-serif;
    font-size: 0.85rem;
    line-height: 1.55;
    color: rgba(255,255,255,0.55);
}

.footer-links {
    display: flex;
    gap: 3rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.footer-col h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--clean-white);
    margin-bottom: 0.3rem;
}

.footer-col a {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.6);
    transition: color 0.15s;
}

.footer-col a:hover {
    color: var(--clean-white);
    text-decoration: none;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-bottom p {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
}

/* --- No Results State --- */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
}

.no-results-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.no-results h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.no-results p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .filter-pills {
        gap: 0.4rem;
    }

    .pill {
        font-size: 0.78rem;
        padding: 0.35rem 0.75rem;
    }

    .stats-inner {
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .marketplace-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    /* Detail panel becomes bottom sheet on mobile */
    .detail-panel {
        width: 100%;
        height: 85vh;
        top: auto;
        bottom: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }

    .detail-panel.active {
        transform: translateY(0);
    }

    .footer-inner {
        flex-direction: column;
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    #hero {
        padding: 2.5rem 1rem 2rem;
    }

    .stats-inner {
        gap: 1rem;
    }

    .stat-item {
        min-width: 0;
    }

    .stat-value {
        font-size: 0.95rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }
}
