/* ============================================================
   nibango Components (Apple HIG)
   ============================================================ */

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--r-md);
    transition: background-color var(--t-fast), opacity var(--t-fast), transform 0.1s;
    text-align: center;
    gap: 8px;
    line-height: 1;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-disabled,
.btn[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

.btn:active {
    transform: scale(0.96);
    opacity: 0.8;
}

.btn-primary {
    background-color: var(--b-primary-fill-aa);
    color: #FFFFFF;
}

.btn-primary:hover {
    background-color: var(--b-primary-hover);
    color: #FFFFFF;
}

.btn-secondary {
    background-color: var(--system-gray-5);
    color: var(--b-primary-text-aa);
}

.btn-secondary:hover {
    background-color: var(--system-gray-4);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-block {
    width: 100%;
    margin-top: var(--sp-sm);
}

.btn-outline {
    border: 1px solid var(--separator);
    background: transparent;
    color: var(--text-primary);
}
.btn-outline:hover {
    background: var(--bg-secondary);
}

.btn-danger-outline {
    border: 1.5px solid var(--system-red);
    background: transparent;
    color: var(--text-danger);
}
.btn-danger-outline:hover {
    background: rgba(255,59,48,0.08);
}

.header-nav__auth {
    display: flex;
    gap: var(--sp-sm);
    align-items: center;
}

/* ========== Forms ========== */
.form-group {
    margin-bottom: var(--sp-md);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid var(--separator);
    border-radius: var(--r-md);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color var(--t-fast), background-color var(--t-fast);
    font-family: var(--font-system);
}

.form-input:focus {
    outline: none;
    border-color: var(--b-primary);
    background-color: var(--bg-primary);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

/* ========== Product Cards (iOS Match) ========== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-sm);
}

.product-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--bg-primary);
    border-radius: var(--r-xl);
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform var(--t-fast), box-shadow var(--t-fast);
    overflow: visible;
}

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

.product-card__image-container {
    width: 100%;
    height: 140px;
    background-color: var(--bg-primary);
    overflow: hidden;
    position: relative;
    border-radius: var(--r-lg);
    flex-shrink: 0;
}

.product-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card__image {
    transform: scale(1.03);
}

.product-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--system-gray-6);
    color: var(--text-tertiary);
    font-size: 24px;
}

/* ---- Notch (negative-space cutout for price pill, matches iOS NotchedImageShape) ---- */
/* Clip the image itself so card background shows through the notch.
   iOS params: cornerRadius=16, notchInnerRadius=16, notchBottomCornerRadius=16.
   notchHeight bumped to 34px (vs iOS 29) so top gap ≈ left gap around capsule.
   Each concave/convex arc approximated with 3 intermediate polygon points (22.5° steps). */
.product-card__image-container:has(.product-card__price-capsule) > .product-card__image,
.product-card__image-container:has(.product-card__price-capsule) > .product-card__placeholder {
    clip-path: polygon(
        /* top edge */
        0 0, 100% 0,
        /* right edge down to right concave arc start (H - 34 - 16 = H - 50) */
        100% calc(100% - 50px),
        /* right concave arc: center=(100%-16, 100%-50), R=16, 0°→90° */
        calc(100% - 1.2px) calc(100% - 43.9px),
        calc(100% - 4.7px) calc(100% - 38.7px),
        calc(100% - 9.9px) calc(100% - 35.2px),
        calc(100% - 16px)  calc(100% - 34px),
        /* notch ceiling */
        calc(100% - var(--notch-w, 88px) + 16px) calc(100% - 34px),
        /* left concave arc: center=(100%-nw+16, 100%-18), R=16, 270°→180° */
        calc(100% - var(--notch-w, 88px) + 9.9px) calc(100% - 32.8px),
        calc(100% - var(--notch-w, 88px) + 4.7px) calc(100% - 29.3px),
        calc(100% - var(--notch-w, 88px) + 1.2px) calc(100% - 24.1px),
        calc(100% - var(--notch-w, 88px))          calc(100% - 18px),
        /* notch left wall (2px segment) */
        calc(100% - var(--notch-w, 88px))           calc(100% - 16px),
        /* bottom-left convex arc of notch: center=(100%-nw-16, 100%-16), R=16, 0°→90° */
        calc(100% - var(--notch-w, 88px) - 1.2px)  calc(100% - 9.9px),
        calc(100% - var(--notch-w, 88px) - 4.7px)  calc(100% - 4.7px),
        calc(100% - var(--notch-w, 88px) - 9.9px)  calc(100% - 1.2px),
        calc(100% - var(--notch-w, 88px) - 16px)   100%,
        /* bottom edge */
        0 100%
    );
}

/* Price capsule (sits inside the notch) */
.product-card__price-capsule {
    position: absolute;
    bottom: 3px;
    right: 3px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--separator-opaque);
    padding: 7px 10px 5px;
    border-radius: var(--r-pill);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    z-index: 3;
    font-family: var(--font-system);
}

.product-card__price-capsule--free {
    background: var(--b-success-fill-aa);
    color: #fff;
    border-color: var(--system-green);
}

/* Favorite heart button (top-right on image) */
.product-card__fav {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.15s;
    padding: 0;
}

.product-card__fav:hover {
    transform: scale(1.1);
}

.product-card__fav svg {
    width: 14px;
    height: 14px;
}

.product-card__fav--active svg {
    fill: var(--system-red);
    stroke: var(--system-red);
}

/* Card info section */
.product-card__info {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 6px 0 0;
    min-height: 70px;
}

.product-card__title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.product-card__subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    min-height: 16px;
}

/* Bottom row: type badge left, spacer, etc */
.product-card__bottom {
    display: flex;
    align-items: center;
    margin-top: auto;
    padding-top: 4px;
}

/* Product type badge (bottom of card) */
.product-card__type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    width: fit-content;
}

.product-card__type-badge--fixed { background: var(--b-danger-fill-aa); }
.product-card__type-badge--negotiable { background: var(--b-primary-fill-aa); }
.product-card__type-badge--auction { background: var(--b-warning-fill-aa); }
.product-card__type-badge--donation { background: var(--b-success-fill-aa); }

/* ========== Product Type Badge Utility Classes ========== */
.badge-fixed { background: var(--b-danger-fill-aa); color: white; }
.badge-negotiable { background: var(--b-primary-fill-aa); color: white; }
.badge-auction { background: var(--b-warning-fill-aa); color: white; }
.badge-donation { background: var(--b-success-fill-aa); color: white; }

/* Promoted badge */
.product-card__promoted {
    position: absolute;
    top: 6px;
    left: 6px;
    background: linear-gradient(135deg, #FFD700, #FFB800);
    color: rgba(0,0,0,0.8);
    padding: 3px 8px;
    border-radius: var(--r-pill);
    font-size: 10px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* ========== Auth ========== */
.auth-container {
    max-width: 400px;
    margin: var(--sp-2xl) auto;
    padding: 0 var(--sp-md);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--sp-xl);
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--sp-xs);
}

.auth-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
}

.auth-form {
    background-color: var(--bg-tertiary);
    padding: var(--sp-xl);
    border-radius: var(--r-lg);
    border: 1px solid var(--separator);
    box-shadow: var(--shadow-sm);
}

.auth-error {
    color: var(--text-danger);
    font-size: 14px;
    margin-bottom: var(--sp-md);
    text-align: center;
}

.auth-success {
    color: var(--text-success);
    font-size: 14px;
    margin-bottom: var(--sp-md);
    text-align: center;
}

/* ========== Cookie Consent ========== */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    border-top: 1px solid var(--separator);
    padding: var(--sp-md) var(--sp-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-md);
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.cookie-consent__text {
    font-size: 14px;
    color: var(--text-secondary-aa);
    max-width: 600px;
}

.cookie-consent__text a {
    color: var(--b-primary-text-aa);
    text-decoration: underline;
}

.cookie-consent__btn {
    padding: 8px 20px;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    white-space: nowrap;
    background-color: var(--b-primary-fill-aa);
    color: #ffffff;
}

@media (max-width: 600px) {
    .cookie-consent {
        flex-direction: column;
        gap: var(--sp-sm);
        text-align: center;
    }
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: var(--sp-lg) 0;
    color: var(--text-tertiary);
    font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--separator);
}

.auth-divider::before {
    margin-right: .5em;
}

.auth-divider::after {
    margin-left: .5em;
}

.auth-footer {
    text-align: center;
    margin-top: var(--sp-lg);
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--b-primary-text-aa);
    font-weight: 500;
}

/* Social Login Buttons */
.auth-social {
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: var(--r-md);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
}

.social-btn:hover {
    text-decoration: none;
}

.apple-btn {
    background-color: #000;
    color: #fff;
    border: 1px solid #000;
}
/* Apple HIG: the Apple mark + label stay white on black. Never recolor
   on hover/focus (a global a:hover was turning them blue). */
.apple-btn:hover,
.apple-btn:focus,
.apple-btn:active {
    background-color: #1a1a1a;
    color: #fff;
}
.apple-btn svg { fill: currentColor; }

.google-btn {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--separator);
}
.google-btn:hover,
.google-btn:focus {
    background-color: var(--system-gray-6, #f5f5f7);
    color: var(--text-primary);
}

/* ========== Hero Section ========== */
.hero {
    text-align: center;
    padding: var(--sp-2xl) var(--sp-md);
    background-color: var(--bg-tertiary);
    border-radius: var(--r-lg);
    margin-bottom: var(--sp-xl);
    border: 1px solid var(--separator);
}

.hero__title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--sp-sm);
    letter-spacing: -0.01em;
}

.hero__subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: var(--sp-lg);
}

.hero__search {
    width: 100%;
    max-width: 500px;
    position: relative;
    margin: 0 auto;
}

.hero__search-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border-radius: var(--r-pill);
    border: 1px solid var(--separator);
    background-color: var(--bg-secondary);
    font-size: 16px;
    color: var(--text-primary);
    font-family: var(--font-system);
    transition: background-color var(--t-fast), border-color var(--t-fast);
}

.hero__search-input:focus {
    outline: none;
    background-color: var(--bg-primary);
    border-color: var(--b-primary);
}

.hero__search-input::placeholder {
    color: var(--text-tertiary);
}

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

/* ========== Page Layout ========== */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--sp-lg);
}

/* ========== Error Pages ========== */
.error-page {
    text-align: center;
    padding: var(--sp-3xl) var(--sp-md);
    max-width: 480px;
    margin: 0 auto;
}

.error-page__icon {
    font-size: 64px;
    margin-bottom: var(--sp-lg);
}

.error-page__title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--sp-sm);
}

.error-page__text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: var(--sp-xl);
    line-height: 1.5;
}

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: var(--sp-3xl) 0;
    color: var(--text-secondary);
}

.empty-state__icon {
    font-size: 48px;
    margin-bottom: var(--sp-md);
}

.empty-state__title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--sp-xs);
}

.empty-state__text {
    font-size: 14px;
    margin-bottom: var(--sp-lg);
}

/* ========== Legal Pages ========== */
.legal-section {
    margin-bottom: var(--sp-xl);
}

.legal-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--sp-sm);
}

.legal-section p,
.legal-section li {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.legal-section ul {
    padding-left: var(--sp-lg);
    margin: var(--sp-sm) 0;
}

.legal-section a {
    color: var(--b-primary-text-aa);
}

/* ========== Search Results Header ========== */
.search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-sm) 0;
    margin-bottom: var(--sp-lg);
    font-size: 15px;
    color: var(--text-secondary);
}

.search-results-header__text strong {
    color: var(--text-primary);
}

.search-results-header__clear {
    color: var(--b-primary-text-aa);
    font-weight: 500;
    font-size: 14px;
}

/* ========== Pagination ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-md);
    padding: var(--sp-xl) 0;
}

.pagination__btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--r-pill);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--separator);
    text-decoration: none;
    transition: background-color var(--t-fast);
}

.pagination__btn:hover {
    background-color: var(--system-gray-5);
    text-decoration: none;
}

.pagination__btn--primary {
    background-color: var(--b-primary-fill-aa);
    color: #FFFFFF;
    border-color: var(--b-primary);
}

.pagination__btn--primary:hover {
    background-color: var(--b-primary-hover);
    color: #FFFFFF;
}

.pagination__info {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========== Utility ========== */
.hidden {
    display: none !important;
}

/* ========== Compact Home Search ========== */
.home-search {
    margin-bottom: var(--sp-md);
}

.home-search__inner {
    position: relative;
}

/* "Choose a city…" under the location button while the feed is not local. */
.home-search__hint {
    margin: var(--sp-xs) 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

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

.home-search__input {
    width: 100%;
    height: 44px;
    padding: 0 40px 0 44px;
    border-radius: var(--r-pill);
    border: 1px solid var(--separator);
    background-color: var(--bg-primary);
    font-size: 16px;
    color: var(--text-primary);
    font-family: var(--font-system);
    transition: background-color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* ========== Dark Mode Overrides ========== */






.home-search__input:focus {
    border-color: var(--b-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.home-search__input::placeholder {
    color: var(--text-tertiary);
}

/* ========== Filter Bar ========== */
.filter-bar {
    margin-bottom: var(--sp-md);
}

.filter-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-md);
    padding: 0 16px;
    height: 44px;
    background: var(--bg-tertiary);
    border-radius: 16px;
    border: 1px solid var(--separator);
}

/* Icon button (grid/list toggle, filters). 44x44 hit target like iOS. */
.filter-bar__icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: color var(--t-fast), background var(--t-fast);
}

.filter-bar__icon-btn:hover {
    color: var(--text-primary);
    background: var(--system-gray-5);
}

.filter-bar__icon-btn--active { color: var(--b-primary-text-aa); }
.filter-bar__filter-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    background: var(--b-primary-fill-aa);
    border-radius: 50%;
}

/* ========== List View Mode (matches iOS RealProductListItemView) ========== */
.product-grid--list {
    grid-template-columns: 1fr !important;
}

.product-grid--list .product-card {
    flex-direction: row;
    height: 110px;
    border-radius: var(--r-xl);
    padding: 10px;
    overflow: visible;
}

.product-grid--list .product-card__image-container {
    width: 90px;
    min-width: 90px;
    height: 90px;
    border-radius: 20px;
}

.product-grid--list .product-card__info {
    flex: 1;
    justify-content: space-between;
    padding: 0 8px 0 12px;
    min-height: auto;
}

.product-grid--list .product-card__title {
    font-size: 17px;
}

.product-grid--list .product-card__subtitle {
    font-size: 12px;
}

/* In list view, price goes in bottom row — remove notch clip */
.product-grid--list .product-card__image-container > .product-card__image,
.product-grid--list .product-card__image-container > .product-card__placeholder {
    clip-path: none !important;
}
.product-grid--list .product-card__price-capsule {
    position: static;
    display: inline-block;
}

.product-grid--list .product-card__bottom {
    justify-content: space-between;
}

.product-grid--list .product-card__fav {
    position: static;
    flex-shrink: 0;
}

/* ========== Desktop ========== */
@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hero {
        padding: var(--sp-3xl) var(--sp-xl);
    }

    .hero__title {
        font-size: 36px;
    }

}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .product-grid--list .product-card {
        height: 120px;
    }

    .product-grid--list .product-card__image-container {
        width: 100px;
        min-width: 100px;
        height: 100px;
        border-radius: 20px;
    }
}

/* ========== Toast Notifications ========== */
#toast-container {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background: var(--system-gray);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
    max-width: 90vw;
    text-align: center;
}

.toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.toast--success { background: var(--b-success-fill-aa); }
.toast--error { background: var(--b-danger-fill-aa); }
.toast--info { background: var(--b-primary-fill-aa); }
.toast--warning { background: var(--b-warning-fill-aa); }

/* ========== Settings Utilities ========== */
.settings-row-btn {
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.pw-strength-seg {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--separator);
    transition: background 0.2s;
}

.verify-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.verify-item__icon { font-size: 20px; }

.modal-option-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.modal-footer {
    margin-top: 16px;
    text-align: right;
}

.text-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.text-sm { font-size: 13px; }

.check-auto { margin-left: auto; }

/* ========== Report / Overlay Modals ========== */
.overlay-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    align-items: center;
    justify-content: center;
}

.overlay-modal.open { display: flex; }

.overlay-modal__box {
    background: var(--bg-primary);
    border-radius: var(--r-lg);
    padding: var(--sp-lg);
    width: 90%;
    max-width: 400px;
}

.report-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid var(--separator);
    border-radius: var(--r-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
    font-family: var(--font-system);
}

/* ========== Similar Listings ========== */
.similar-section {
    margin: var(--sp-xl) 0;
    padding: 0 var(--sp-md);
}

.similar-section__title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: var(--sp-md);
    color: var(--text-primary);
}

.similar-scroll {
    display: flex;
    gap: var(--sp-md);
    overflow-x: auto;
    padding-bottom: var(--sp-sm);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.similar-scroll::-webkit-scrollbar { display: none; }

.similar-scroll .product-card {
    flex: 0 0 160px;
    min-width: 160px;
}

/* ========== Star Rating (Mark Sold) ========== */
.star-rating {
    display: flex;
    gap: 8px;
    margin-bottom: var(--sp-md);
    justify-content: center;
}

.star-rating__btn {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 0;
}

/* ========== Badge Grid ========== */
.badge-page { max-width: 600px; margin: 0 auto; padding-bottom: var(--sp-3xl); }
.badge-page__title { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: var(--sp-lg); }
.badge-section { padding: 0 24px; margin-bottom: var(--sp-xl); }
.badge-section--locked { padding: 0 24px; }
.badge-section__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}
.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.badge-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--separator);
    border-radius: var(--r-lg);
    padding: 16px;
    text-align: center;
}
.badge-card--locked {
    background: var(--bg-secondary);
    border: 1px solid var(--separator);
    border-radius: var(--r-lg);
    padding: 16px;
    text-align: center;
    opacity: 0.5;
}
.badge-card__icon { font-size: 36px; margin-bottom: 8px; }
.badge-card__icon img { width: 48px; height: 48px; object-fit: contain; margin-bottom: 8px; }
.badge-card__name { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.badge-card__desc { font-size: 12px; color: var(--text-secondary); }

/* ========== Back Link ========== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    padding: 0 24px;
    margin-bottom: var(--sp-lg);
}

/* ========== Empty State (web) ========== */
.empty-state-web {
    text-align: center;
    padding: var(--sp-3xl) 24px;
    color: var(--text-secondary);
}
.empty-state-web__icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-web__title { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.empty-state-web__desc { font-size: 14px; }
/* ==========================================================
   Row component (web/_components/row.html)
   ----------------------------------------------------------
   Universal "icon + label + chevron" row used in profile,
   settings, notifications and every modal list. Mirrors iOS
   AppStyle row dimensions (16px padding, 32px icon bubble,
   r-lg border-radius).
   ========================================================== */
.row {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    width: calc(100% - 48px);
    padding: 14px 16px;
    margin: 0 24px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--separator);
    border-radius: var(--r-lg);
    text-decoration: none;
    color: var(--text-primary);
    cursor: pointer;
    font-family: var(--font-system);
    font-size: inherit;
    text-align: left;
    transition: background var(--t-fast);
}
.row:hover { background: var(--bg-secondary); text-decoration: none; }

.row__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
.row__icon svg { width: 18px; height: 18px; }
.row__icon--blue   { background: rgba(0, 122, 255, 0.12);   color: var(--b-primary-text-aa); }
.row__icon--green  { background: rgba(52, 199, 89, 0.12);   color: var(--text-success); }
.row__icon--orange { background: rgba(255, 149, 0, 0.12);   color: var(--text-warning); }
.row__icon--red    { background: rgba(255, 59, 48, 0.12);   color: var(--text-danger); }
.row__icon--purple { background: rgba(175, 82, 222, 0.12);  color: var(--system-purple); }
.row__icon--cyan   { background: rgba(90, 200, 250, 0.12);  color: var(--system-teal); }
.row__icon--indigo { background: rgba(88, 86, 214, 0.12);   color: var(--system-indigo); }
.row__icon--gray   { background: rgba(142, 142, 147, 0.12); color: var(--system-gray); }

.row__label    { flex: 1; font-size: 15px; font-weight: 500; }
.row__trail    { color: var(--text-tertiary); font-size: 13px; }
.row__chevron  { color: var(--text-tertiary); flex-shrink: 0; display: flex; align-items: center; }
.row__chevron svg { width: 14px; height: 14px; }

button.row { background: var(--bg-tertiary); border: 1px solid var(--separator); }
.row--disabled { opacity: 0.45; pointer-events: none; }
.row--danger .row__label { color: var(--text-danger); }

/* Section: title + a stack of rows. Mirrors iOS profileTitleFont. */
.section { margin-bottom: var(--sp-lg); }
.section__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0 24px;
    margin-bottom: 12px;
}

/* Social sign-in buttons are POST forms (AUTH-9): the form adds no box. */
.social-form {
    display: contents;
}

button.social-btn {
    width: 100%;
    font-family: inherit;
}
