/* =========================================
   Cottage Food Market — Global Styles
   Inspired by Etsy's clean marketplace UI
   ========================================= */

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

html, body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: #222222;
    background-color: #F7F7F7;
    -webkit-font-smoothing: antialiased;
}

h1:focus { outline: none; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4c5bc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b3a099; }

/* --- Links --- */
a { color: #222222; }
a:hover { color: #E8622A; }

/* --- Blazor error UI --- */
#blazor-error-ui {
    color-scheme: light only;
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(0,0,0,.15);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: .6rem 1.25rem .7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* --- Blazor loading spinner --- */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem;
}
.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: .6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: #E8622A;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * .8), 500%;
    transition: stroke-dasharray .05s ease-in-out;
}
.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 600;
    inset: calc(20vh + 3.25rem) 0 auto .2rem;
}
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }

/* --- Blazor error boundary --- */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 8px;
}
.blazor-error-boundary::after { content: "An error has occurred." }

/* --- Mobile padding for bottom nav --- */
@media (max-width: 600px) {
    .mud-main-content { padding-bottom: 72px !important; }
}

/* =========================================
   Product Card — Etsy-style
   ========================================= */
.cfm-product-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.cfm-product-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.13);
    transform: translateY(-2px);
}
.cfm-product-card__image-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
    background: #f4f0ed;
}
.cfm-product-card__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.cfm-product-card:hover .cfm-product-card__image { transform: scale(1.04); }
.cfm-product-card__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fdf0e6, #fce4c8);
    font-size: 3.5rem;
}
.cfm-product-card__out-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(34,34,34,0.75);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.cfm-product-card__body {
    padding: 10px 12px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.cfm-product-card__vendor {
    font-size: 11px;
    color: #767676;
    margin-bottom: 3px;
    font-weight: 500;
}
.cfm-product-card__name {
    font-size: 13px;
    font-weight: 500;
    color: #222222;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}
.cfm-product-card__price {
    font-size: 16px;
    font-weight: 700;
    color: #222222;
    margin-top: auto;
    padding-top: 8px;
}
.cfm-product-card__rating {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 2px;
}
.cfm-product-card__rating-count { font-size: 11px; color: #767676; }
.cfm-product-card__add {
    margin-top: 10px;
}

/* =========================================
   Category Tile
   ========================================= */
.cfm-category-tile {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 22px 12px 18px;
    text-align: center;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    height: 100%;
    user-select: none;
}
.cfm-category-tile:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    border-color: #E8622A;
}
.cfm-category-tile__icon { font-size: 2.4rem; margin-bottom: 8px; line-height: 1; display: block; }
.cfm-category-tile__name { font-size: 13px; font-weight: 600; color: #222; margin-bottom: 2px; }
.cfm-category-tile__count { font-size: 11px; color: #767676; }

/* =========================================
   Hero Banner
   ========================================= */
.cfm-hero {
    background: linear-gradient(135deg, #2d1208 0%, #5c3217 45%, #8B5E3C 100%);
    border-radius: 12px;
    padding: 56px 48px;
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 36px;
}
.cfm-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 80% 50%, rgba(255,255,255,0.06) 0%, transparent 60%);
    pointer-events: none;
}
@media (max-width: 600px) {
    .cfm-hero { padding: 36px 24px; }
    .cfm-hero__title { font-size: 2rem !important; }
}
.cfm-hero__eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
    margin-bottom: 10px;
}
.cfm-hero__title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3rem;
    font-weight: 700;
    color: white;
    line-height: 1.15;
    margin-bottom: 14px;
}
.cfm-hero__subtitle {
    font-size: 1rem;
    color: rgba(255,255,255,0.80);
    margin-bottom: 28px;
    line-height: 1.6;
    max-width: 420px;
}
.cfm-hero__btn-primary {
    background: #ffffff !important;
    color: #3d1c0c !important;
    font-weight: 700 !important;
    border-radius: 24px !important;
    padding: 0 28px !important;
    height: 44px !important;
    font-size: 14px !important;
}
.cfm-hero__btn-secondary {
    border: 2px solid rgba(255,255,255,0.6) !important;
    color: white !important;
    border-radius: 24px !important;
    padding: 0 24px !important;
    height: 44px !important;
    font-size: 14px !important;
}
.cfm-hero__btn-secondary:hover {
    background: rgba(255,255,255,0.1) !important;
}

/* =========================================
   Stats bar
   ========================================= */
.cfm-stats-bar {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 12px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 36px;
}
.cfm-stat { text-align: center; }
.cfm-stat__value { font-size: 1.6rem; font-weight: 700; color: #E8622A; display: block; line-height: 1.2; }
.cfm-stat__label { font-size: 11px; color: #767676; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; display: block; }

/* =========================================
   Section header row
   ========================================= */
.cfm-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
}
.cfm-section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #222222;
    margin: 0;
}
.cfm-section-link {
    font-size: 13px;
    color: #595959;
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
}
.cfm-section-link:hover { color: #E8622A; }

/* =========================================
   "How it works" steps
   ========================================= */
.cfm-steps {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 36px 24px;
    margin-bottom: 36px;
}
.cfm-step__icon { font-size: 2.2rem; margin-bottom: 10px; display: block; }
.cfm-step__title { font-size: 15px; font-weight: 700; color: #222; margin-bottom: 6px; }
.cfm-step__desc { font-size: 13px; color: #595959; line-height: 1.55; }

/* =========================================
   Vendor CTA banner
   ========================================= */
.cfm-cta {
    background: #222222;
    border-radius: 12px;
    padding: 36px 40px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}
.cfm-cta__title { font-size: 1.2rem; font-weight: 700; color: white; margin-bottom: 4px; }
.cfm-cta__subtitle { font-size: 13px; color: rgba(255,255,255,0.7); }
.cfm-cta__btn {
    background: #E8622A !important;
    color: white !important;
    font-weight: 700 !important;
    border-radius: 24px !important;
    padding: 0 28px !important;
    height: 44px !important;
    white-space: nowrap;
}
.cfm-cta__btn:hover { background: #c44d1a !important; }

/* =========================================
   Search — AppBar pill
   ========================================= */
.cfm-appbar-search {
    flex: 1;
    max-width: 480px;
}
.cfm-search-wrap {
    display: flex;
    align-items: center;
    height: 40px;
    background: #f5f5f5;
    border: 1px solid #d8d8d8;
    border-radius: 24px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cfm-search-wrap:focus-within {
    border-color: #222;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(34,34,34,0.08);
}
.cfm-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 0 14px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: #222;
    outline: none;
}
.cfm-search-input::placeholder { color: #9e9e9e; }
.cfm-search-btn {
    flex-shrink: 0;
    width: 44px;
    height: 100%;
    background: #222;
    border: none;
    border-radius: 0 24px 24px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.15s;
}
.cfm-search-btn:hover { background: #E8622A; }
.cfm-search-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* =========================================
   Search — Hero bar (large, centered)
   ========================================= */
.cfm-hero-search {
    display: flex;
    align-items: center;
    max-width: 560px;
    height: 52px;
    background: #fff;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    margin-top: 28px;
}
.cfm-hero-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 0 20px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: #222;
    outline: none;
}
.cfm-hero-search-input::placeholder { color: #9e9e9e; }
.cfm-hero-search-btn {
    flex-shrink: 0;
    height: 100%;
    padding: 0 24px;
    background: #E8622A;
    border: none;
    border-radius: 0 30px 30px 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: #fff;
    letter-spacing: 0.2px;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.cfm-hero-search-btn:hover { background: #c44d1a; }
@media (max-width: 600px) {
    .cfm-hero-search { max-width: 100%; }
    .cfm-hero-search-btn { padding: 0 16px; font-size: 13px; }
}

/* =========================================
   AppBar logo
   ========================================= */
.cfm-logo {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #222222;
    text-decoration: none;
}
.cfm-logo__dot { color: #E8622A; }

/* =========================================
   Misc utility
   ========================================= */
.cfm-page-container { max-width: 1320px; margin: 0 auto; }
