/**
 * Market V3 – E-Shop / Stitch design system
 * Design tokens, Rivo header, product cards, dark mode
 */

/* Design tokens */
:root {
    --mv3-primary: #0d93f2;
    --mv3-primary-dark: #0b7ad1;
    --mv3-accent-teal: #14b8a6;
    --mv3-bg-light: #f5f7f8;
    --mv3-bg-dark: #101b22;
    --mv3-text: #1e293b;
    --mv3-text-muted: #64748b;
    --mv3-border: rgba(0, 0, 0, 0.08);
    --mv3-radius: 0.25rem;
    --mv3-radius-lg: 0.5rem;
    --mv3-radius-xl: 0.75rem;
    --mv3-spacing: 16px;
    --mv3-font: 'Plus Jakarta Sans', system-ui, sans-serif;
    --mv3-header-bg: rgba(255, 255, 255, 0.8);
    --mv3-header-border: rgba(226, 232, 240, 1);
}

html.dark {
    --mv3-bg-light: #0f172a;
    --mv3-bg-dark: #020617;
    --mv3-text: #f1f5f9;
    --mv3-text-muted: #94a3b8;
    --mv3-border: rgba(255, 255, 255, 0.1);
    --mv3-header-bg: rgba(16, 27, 34, 0.8);
    --mv3-header-border: rgba(13, 147, 242, 0.2);
}

/* Base */
.market-v3-body {
    font-family: var(--mv3-font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--mv3-text);
    background-color: var(--mv3-bg-light);
    margin: 0;
    min-height: 100vh;
    padding-bottom: 80px;
}

@media (min-width: 768px) {
    .market-v3-body {
        padding-bottom: 0;
    }
}

/* Rivo-style header */
.market-v3-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--mv3-header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--mv3-header-border);
}

.market-v3-header__container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--mv3-spacing);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--mv3-spacing);
}

.market-v3-header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--mv3-text);
    font-weight: 700;
    flex-shrink: 0;
}

.market-v3-header__logo-img {
    max-height: 40px;
    width: auto;
}

.market-v3-header__logo-text {
    font-size: 1.25rem;
}

.market-v3-header__search {
    flex: 1;
    max-width: 420px;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--mv3-bg-light);
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius-lg);
}

@media (min-width: 768px) {
    .market-v3-header__search {
        display: flex;
    }
}

.market-v3-header__search-icon {
    color: var(--mv3-text-muted);
    font-size: 20px;
}

.market-v3-header__search-input {
    flex: 1;
    border: none;
    background: transparent;
    font: inherit;
    color: var(--mv3-text);
    outline: none;
}

.market-v3-header__search-input::placeholder {
    color: var(--mv3-text-muted);
}

.market-v3-header__search-input:focus {
    outline: none;
}

.market-v3-header__search:focus-within {
    border-color: var(--mv3-primary);
    box-shadow: 0 0 0 2px rgba(13, 147, 242, 0.2);
}

.market-v3-header__search-hint {
    font-size: 0.75rem;
    color: var(--mv3-text-muted);
}

.market-v3-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.market-v3-header__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--mv3-radius);
    color: var(--mv3-text);
    text-decoration: none;
    position: relative;
}

.market-v3-header__icon:hover {
    background: var(--mv3-border);
    color: var(--mv3-text);
}

.market-v3-header__icon .material-icons {
    font-size: 24px;
}

.market-v3-header__cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background: var(--mv3-primary);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Theme toggle pill */
.market-v3-theme-toggle {
    display: flex;
    display: inline-flex;
    align-items: center;
    background: rgba(125, 125, 125, 0.15);
    border-radius: 9999px;
    padding: 2px;
    border: 1px solid rgba(125, 125, 125, 0.2);
}

.market-v3-theme-toggle__btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: var(--mv3-text-muted, #64748b);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.market-v3-theme-toggle__btn i,
.market-v3-theme-toggle__btn .material-icons {
    font-size: 16px;
}

.market-v3-theme-toggle__btn:hover {
    color: var(--mv3-text, #1e293b);
}

.market-v3-theme-toggle__btn[aria-pressed="true"] {
    background: var(--mv3-primary, #0d93f2) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.market-v3-theme-toggle__btn[aria-pressed="true"] i {
    color: #ffffff !important;
}

/* Main content */
.market-v3-main {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Mobile bottom nav */
.market-v3-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--mv3-header-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--mv3-header-border);
    z-index: 90;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
}

@media (min-width: 768px) {
    .market-v3-bottom-nav {
        display: none;
    }
}

.market-v3-bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 12px;
    color: var(--mv3-text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    border-radius: var(--mv3-radius);
    position: relative;
}

.market-v3-bottom-nav__item .material-icons {
    font-size: 24px;
}

.market-v3-bottom-nav__item:hover,
.market-v3-bottom-nav__item:focus {
    color: var(--mv3-primary);
}

.market-v3-bottom-nav__cart {
    transform: translateY(-24px);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--mv3-primary);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(13, 147, 242, 0.4);
}

.market-v3-bottom-nav__cart .material-icons {
    font-size: 28px;
}

.market-v3-bottom-nav__cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    background: #ef4444;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer */
.market-v3-footer {
    margin-top: auto;
    padding: var(--mv3-spacing) 0;
    border-top: 1px solid var(--mv3-border);
    background: var(--mv3-footer-bg, var(--mv3-header-bg));
    color: var(--mv3-footer-text, var(--mv3-text));
}

.market-v3-footer__container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--mv3-spacing);
}

.market-v3-footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--mv3-spacing);
    margin-bottom: var(--mv3-spacing);
}

@media (min-width: 640px) {
    .market-v3-footer__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .market-v3-footer__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.market-v3-footer__title {
    display: block;
    color: var(--mv3-footer-text, var(--mv3-text));
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.market-v3-footer__tagline,
.market-v3-footer__list {
    color: var(--mv3-footer-text, var(--mv3-text-muted));
    opacity: 0.85;
    font-size: 0.875rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.market-v3-footer__list a {
    color: var(--mv3-footer-text, var(--mv3-text-muted));
    opacity: 0.75;
    text-decoration: none;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.market-v3-footer__list a:hover {
    opacity: 1;
    color: var(--mv3-primary);
}

.market-v3-footer__copy {
    font-size: 0.8rem;
    color: var(--mv3-text-muted);
    text-align: center;
}

/* Social Media */
.market-v3-footer__social {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.market-v3-footer__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 16px;
}

.market-v3-footer__social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: #fff;
}

.market-v3-footer__social-link:focus {
    outline: 2px solid var(--mv3-primary);
    outline-offset: 2px;
}

/* Hero */
.market-v3-hero {
    padding: calc(var(--mv3-spacing) * 3) var(--mv3-spacing);
    text-align: center;
    background: linear-gradient(135deg, var(--mv3-primary) 0%, var(--mv3-primary-dark) 100%);
    color: #fff;
    border-radius: var(--mv3-radius-lg);
    margin-bottom: var(--mv3-spacing);
}

.market-v3-hero__title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 8px;
}

@media (min-width: 768px) {
    .market-v3-hero__title {
        font-size: 2.5rem;
    }
}

.market-v3-hero__subtitle {
    margin: 0;
    opacity: 0.95;
    font-size: 1rem;
}

/* Hero banner layout (no Bootstrap: container/row/col) */
.market-v3-main .hero-banner-section .container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 var(--mv3-spacing);
}
.market-v3-main .hero-banner-section .row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0 -calc(var(--mv3-spacing) / 2);
}
.market-v3-main .hero-banner-section .col-lg-6 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 calc(var(--mv3-spacing) / 2);
}
@media (min-width: 992px) {
    .market-v3-main .hero-banner-section .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}
.market-v3-main .hero-banner-section .min-vh-50 {
    min-height: 50vh;
}

/* Topbar (home) */
.market-v3-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--mv3-spacing);
    background: var(--mv3-header-bg);
    border-bottom: 1px solid var(--mv3-border);
}
.market-v3-topbar__label {
    font-size: 0.9rem;
    color: var(--mv3-text-muted);
}
.market-v3-btn--sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Featured horizontal scroll */
.market-v3-product-grid--scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: var(--mv3-spacing);
    padding-bottom: var(--mv3-spacing);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.market-v3-product-grid--scroll .market-v3-product-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
}

/* Section CTA */
.market-v3-section__cta {
    margin: var(--mv3-spacing) 0 0;
    text-align: center;
}

/* Section */
.market-v3-section {
    margin-bottom: calc(var(--mv3-spacing) * 2);
}

.market-v3-section__title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 var(--mv3-spacing);
    color: var(--mv3-text);
}

.market-v3-section__empty {
    color: var(--mv3-text-muted);
    margin: 0;
}

/* Categories grid */
.market-v3-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--mv3-spacing);
}

.market-v3-category-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--mv3-spacing);
    background: var(--mv3-header-bg);
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius-lg);
    text-decoration: none;
    color: var(--mv3-text);
    font-weight: 500;
}

.market-v3-category-card:hover {
    border-color: var(--mv3-primary);
    color: var(--mv3-primary);
}

.market-v3-category-card__name {
    text-align: center;
}

/* Product grid & card */
.market-v3-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--mv3-spacing);
}

@media (min-width: 640px) {
    .market-v3-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

.market-v3-product-card {
    background: var(--product-card-bg-color, var(--mv3-header-bg));
    border: var(--product-card-border-width, 1px) var(--product-card-border-style, solid) var(--product-card-border-color, var(--mv3-border));
    border-radius: var(--mv3-card-radius, var(--mv3-radius-lg));
    overflow: hidden;
    text-decoration: none;
    color: var(--mv3-text);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

html.dark .market-v3-product-card {
    background: var(--mv3-card-bg-dark, var(--mv3-header-bg));
}

.market-v3-product-card:hover {
    border-color: var(--mv3-primary);
    box-shadow: var(--product-card-hover-shadow, 0 4px 12px rgba(0, 0, 0, 0.08));
    transform: scale(var(--product-card-hover-scale, 1.05));
}

html.dark .market-v3-product-card:hover {
    box-shadow: var(--product-card-hover-shadow, 0 4px 12px rgba(0, 0, 0, 0.3));
}

.market-v3-product-card__img-wrap {
    aspect-ratio: 1;
    background: var(--mv3-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.market-v3-product-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.market-v3-product-card__placeholder {
    font-size: 48px;
    color: var(--mv3-text-muted);
}

.market-v3-product-card__body {
    padding: var(--product-card-padding, var(--mv3-spacing));
    flex: 1;
}

.market-v3-product-card__title {
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.market-v3-product-card__price {
    margin: 0 0 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mv3-primary);
}

.market-v3-quick-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border: none;
    border-radius: var(--mv3-radius);
    background: var(--mv3-primary);
    color: #fff;
    cursor: pointer;
    font-size: 0.8rem;
}

.market-v3-quick-add .material-icons {
    font-size: 18px;
}

.market-v3-quick-add:hover {
    background: var(--mv3-primary-dark);
}

.market-v3-quick-add:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Back link */
.market-v3-back,
.market-v3-section .market-v3-back {
    display: inline-block;
    margin-bottom: var(--mv3-spacing);
    color: var(--mv3-primary);
    text-decoration: none;
    font-size: 0.9rem;
}

.market-v3-back:hover {
    color: var(--mv3-primary-dark);
}

/* Product detail */
.market-v3-product-detail {
    display: grid;
    gap: var(--mv3-spacing);
}

@media (min-width: 768px) {
    .market-v3-product-detail {
        grid-template-columns: 1fr 1fr;
    }
}

.market-v3-product-detail__img-wrap {
    aspect-ratio: 1;
    background: var(--mv3-border);
    border-radius: var(--mv3-radius-lg);
    overflow: hidden;
}

.market-v3-product-detail__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.market-v3-product-detail__title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 8px;
}

.market-v3-product-detail__price {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--mv3-primary);
    margin: 0 0 var(--mv3-spacing);
}

.market-v3-product-detail__desc {
    margin: 0 0 var(--mv3-spacing);
    color: var(--mv3-text-muted);
    font-size: 0.95rem;
}

.market-v3-product-detail__specs {
    margin-top: var(--mv3-spacing);
}

.market-v3-specs-list {
    margin: 0;
    display: grid;
    gap: 8px;
}

.market-v3-specs-list__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--mv3-spacing);
    padding: 8px 0;
    border-bottom: 1px solid var(--mv3-border);
}

.market-v3-specs-list__row:last-child {
    border-bottom: none;
}

.market-v3-specs-list dt {
    margin: 0;
    font-weight: 500;
    color: var(--mv3-text);
}

.market-v3-specs-list dd {
    margin: 0;
    color: var(--mv3-text-muted);
}

/* Sticky product CTA */
.market-v3-product-cta {
    margin-top: var(--mv3-spacing);
    padding: var(--mv3-spacing);
    background: var(--mv3-header-bg);
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius-lg);
}

@media (min-width: 768px) {
    .market-v3-product-cta {
        position: sticky;
        top: 80px;
    }
}

.market-v3-product-cta__price {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--mv3-primary);
    margin-bottom: 8px;
}

.market-v3-product-cta__actions {
    display: flex;
    align-items: center;
    gap: var(--mv3-spacing);
}

.market-v3-product-cta__actions .market-v3-field__input {
    width: 60px;
    text-align: center;
}

.market-v3-product-cta__out {
    margin: 0;
    color: var(--mv3-text-muted);
    font-size: 0.9rem;
}

/* Cart */
.market-v3-cart__list {
    list-style: none;
    margin: 0 0 var(--mv3-spacing);
    padding: 0;
}

.market-v3-cart__item {
    display: flex;
    gap: var(--mv3-spacing);
    padding: var(--mv3-spacing);
    background: var(--mv3-header-bg);
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius-lg);
    margin-bottom: 8px;
}

.market-v3-cart__item-img {
    width: 80px;
    min-width: 80px;
    height: 80px;
    border-radius: var(--mv3-radius);
    overflow: hidden;
    background: var(--mv3-border);
}

.market-v3-cart__item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.market-v3-cart__item-body {
    flex: 1;
}

.market-v3-cart__item-title {
    font-size: 1rem;
    font-weight: 500;
    margin: 0 0 4px;
}

.market-v3-cart__item-price {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: var(--mv3-text-muted);
}

.market-v3-cart__item-actions {
    display: flex;
    align-items: center;
    gap: var(--mv3-spacing);
}

.market-v3-cart__qty {
    display: flex;
    align-items: center;
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius);
    overflow: hidden;
}

.market-v3-cart__qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--mv3-bg-light);
    color: var(--mv3-text);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.market-v3-cart__qty-input {
    width: 44px;
    text-align: center;
    border: none;
    background: transparent;
    font: inherit;
    color: var(--mv3-text);
}

.market-v3-cart__remove {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 0.85rem;
}

.market-v3-cart__footer {
    padding: var(--mv3-spacing);
    background: var(--mv3-header-bg);
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius-lg);
}

.market-v3-cart__total {
    margin: 0 0 var(--mv3-spacing);
    font-size: 1.1rem;
}

.market-v3-cart__footer .market-v3-btn {
    width: 100%;
}

.market-v3-cart__actions {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.market-v3-cart__actions .market-v3-btn {
    flex: 1;
}

.market-v3-btn--secondary {
    background: transparent;
    border: 1px solid var(--mv3-primary);
    color: var(--mv3-primary);
}

.market-v3-btn--secondary:hover {
    background: var(--mv3-border);
}

.market-v3-cart__share-msg {
    margin: 0;
    font-size: 0.85rem;
    color: var(--mv3-text-muted);
}

.market-v3-product-card__link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.market-v3-quick-add--compare {
    margin-top: 8px;
    align-self: flex-start;
}

.market-v3-cart__banner {
    padding: 10px 12px;
    border-radius: var(--mv3-radius);
    margin-bottom: var(--mv3-spacing);
    font-size: 0.9rem;
}

.market-v3-cart__banner--success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #059669;
}

.market-v3-cart__banner--error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

/* Order detail (customer) */
.market-v3-order-detail__meta {
    margin-bottom: var(--mv3-spacing);
    padding: var(--mv3-spacing);
    background: var(--mv3-header-bg);
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius-lg);
}

.market-v3-order-detail__meta p {
    margin: 0 0 8px;
    font-size: 0.95rem;
}

.market-v3-order-detail__meta p:last-child {
    margin-bottom: 0;
}

.market-v3-order-detail__items {
    margin-top: var(--mv3-spacing);
}

.market-v3-order-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.market-v3-order-item {
    display: flex;
    gap: var(--mv3-spacing);
    padding: 10px 0;
    border-bottom: 1px solid var(--mv3-border);
}

.market-v3-order-item:last-child {
    border-bottom: none;
}

.market-v3-order-item__img {
    width: 56px;
    min-width: 56px;
    height: 56px;
    border-radius: var(--mv3-radius);
    overflow: hidden;
    background: var(--mv3-border);
}

.market-v3-order-item__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.market-v3-order-item__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.market-v3-order-item__title {
    font-weight: 500;
}

.market-v3-order-item__qty {
    font-size: 0.9rem;
    color: var(--mv3-text-muted);
}

/* Profile */
.market-v3-profile__card {
    padding: var(--mv3-spacing);
    background: var(--mv3-header-bg);
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius-lg);
    margin-bottom: var(--mv3-spacing);
    text-align: center;
}

.market-v3-profile__avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--mv3-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.market-v3-profile__avatar .material-icons {
    font-size: 36px;
}

.market-v3-profile__name {
    margin: 0 0 4px;
    font-size: 1.25rem;
    font-weight: 600;
}

.market-v3-profile__username {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: var(--mv3-text-muted);
}

.market-v3-profile__contact {
    margin-top: var(--mv3-spacing);
    padding-top: var(--mv3-spacing);
    border-top: 1px solid var(--mv3-border);
    text-align: left;
    font-size: 0.9rem;
}

.market-v3-profile__contact p {
    margin: 0 0 8px;
}

.market-v3-profile__contact a {
    color: var(--mv3-primary);
    text-decoration: none;
}

.market-v3-profile__since {
    color: var(--mv3-text-muted) !important;
}

.market-v3-profile__links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--mv3-spacing);
}

/* Address cards */
.market-v3-addresses {
    display: grid;
    gap: var(--mv3-spacing);
    margin-bottom: var(--mv3-spacing);
}

.market-v3-address-card {
    padding: var(--mv3-spacing);
    background: var(--mv3-header-bg);
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius-lg);
}

.market-v3-address-card__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.market-v3-address-card__text {
    margin: 0 0 4px;
    font-size: 0.95rem;
    color: var(--mv3-text);
}

.market-v3-address-card__city {
    margin: 0;
    font-size: 0.85rem;
    color: var(--mv3-text-muted);
}

/* Filter pills (product listing) */
.market-v3-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--mv3-spacing);
}

.market-v3-filter-pill {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 9999px;
    background: var(--mv3-border);
    color: var(--mv3-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.market-v3-filter-pill:hover {
    color: var(--mv3-text);
    background: var(--mv3-header-bg);
}

.market-v3-filter-pill--active {
    background: var(--mv3-primary);
    color: #fff;
}

/* Pagination */
.market-v3-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--mv3-spacing);
    flex-wrap: wrap;
    margin-top: var(--mv3-spacing-lg);
    padding: var(--mv3-spacing) 0;
}

.market-v3-pagination__link {
    padding: 8px 16px;
    border-radius: var(--mv3-radius);
    background: var(--mv3-primary);
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
}

.market-v3-pagination__link:hover {
    opacity: 0.9;
    color: #fff;
}

.market-v3-pagination__info {
    color: var(--mv3-text-muted);
    font-size: 0.9rem;
}

/* 404 page (Market V3) */
.market-v3-404 {
    text-align: center;
    padding: var(--mv3-spacing-xl) var(--mv3-spacing);
    max-width: 480px;
    margin: 0 auto;
}

.market-v3-404__title {
    font-size: 4rem;
    font-weight: 700;
    color: var(--mv3-primary);
    margin: 0 0 8px;
}

.market-v3-404__subtitle {
    font-size: 1.25rem;
    color: var(--mv3-text);
    margin: 0 0 8px;
}

.market-v3-404__message {
    color: var(--mv3-text-muted);
    margin: 0 0 var(--mv3-spacing-lg);
}

.market-v3-404__actions {
    display: flex;
    gap: var(--mv3-spacing);
    justify-content: center;
    flex-wrap: wrap;
}

/* Search form */
.market-v3-search__form {
    display: flex;
    gap: 8px;
    margin-bottom: var(--mv3-spacing);
    max-width: 400px;
}

.market-v3-search__form .market-v3-field__input {
    flex: 1;
}

/* Order cards (customer) */
.market-v3-orders {
    display: grid;
    gap: var(--mv3-spacing);
}

.market-v3-order-card {
    display: block;
    padding: var(--mv3-spacing);
    background: var(--mv3-header-bg);
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius-lg);
    text-decoration: none;
    color: var(--mv3-text);
}

.market-v3-order-card:hover {
    border-color: var(--mv3-primary);
}

.market-v3-order-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.market-v3-order-card__id {
    font-weight: 600;
}

.market-v3-order-card__total {
    margin: 0 0 4px;
    font-size: 1rem;
    color: var(--mv3-primary);
}

.market-v3-order-card__date {
    margin: 0;
    font-size: 0.85rem;
    color: var(--mv3-text-muted);
}

/* Dashboard cards */
.market-v3-dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--mv3-spacing);
    margin-top: var(--mv3-spacing);
}

.market-v3-dashboard-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--mv3-spacing);
    background: var(--mv3-header-bg);
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius-lg);
    text-decoration: none;
    color: var(--mv3-text);
}

.market-v3-dashboard-card:hover {
    border-color: var(--mv3-primary);
}

.market-v3-dashboard-card__icon {
    font-size: 32px;
    color: var(--mv3-primary);
    margin-bottom: 8px;
}

.market-v3-dashboard-card__label {
    font-size: 0.9rem;
    text-align: center;
}

.market-v3-dashboard-card__value {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 4px;
    color: var(--mv3-primary);
}

/* Checkout */
/* Checkout step indicator */
.market-v3-checkout-steps {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.25rem;
    margin-bottom: var(--mv3-spacing);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--mv3-border);
}
.market-v3-checkout-steps__item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--mv3-text-muted);
    text-decoration: none;
}
.market-v3-checkout-steps__item--current {
    color: var(--mv3-primary);
    font-weight: 600;
}
.market-v3-checkout-steps__item--done {
    color: var(--mv3-text);
}
.market-v3-checkout-steps__item--done[href]:hover {
    color: var(--mv3-primary);
    text-decoration: underline;
}
.market-v3-checkout-steps__item--next {
    color: var(--mv3-text-muted);
}
.market-v3-checkout-steps__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.8rem;
    border-radius: 50%;
    background: var(--mv3-border);
    color: var(--mv3-text-muted);
}
.market-v3-checkout-steps__item--current .market-v3-checkout-steps__num {
    background: var(--mv3-primary);
    color: #fff;
}
.market-v3-checkout-steps__item--done .market-v3-checkout-steps__num {
    background: rgba(25, 135, 84, 0.2);
    color: var(--mv3-success, #198754);
}
.market-v3-checkout-steps__sep {
    width: 1.5rem;
    height: 1px;
    background: var(--mv3-border);
}
.market-v3-checkout-steps__sep::before {
    content: '';
    display: none;
}

.market-v3-checkout__summary,
.market-v3-checkout__summary-card {
    margin-bottom: var(--mv3-spacing);
    padding: var(--mv3-spacing);
    background: var(--mv3-header-bg);
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.market-v3-checkout__summary h3,
.market-v3-checkout__summary-title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
}

.market-v3-checkout__list {
    margin: 0 0 12px;
    padding-left: 1.2rem;
}

.market-v3-checkout__total,
.market-v3-checkout__total-row {
    margin: 0;
    font-size: 1.1rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--mv3-border);
}
.market-v3-checkout__total-amount {
    color: var(--mv3-primary);
    font-weight: 600;
}

.market-v3-checkout__form {
    max-width: 400px;
}

.market-v3-checkout__form .market-v3-field {
    margin-bottom: var(--mv3-spacing);
}

.market-v3-checkout__form textarea.market-v3-field__input {
    min-height: 80px;
    resize: vertical;
}

/* Checkout page grid layout */
.market-v3-checkout-page .market-v3-checkout-grid {
    display: grid;
    gap: var(--mv3-spacing);
    margin-top: var(--mv3-spacing);
}

@media (min-width: 768px) {
    .market-v3-checkout-page .market-v3-checkout-grid {
        grid-template-columns: 1fr 1fr;
    }
    .market-v3-checkout-page .market-v3-checkout__address-col {
        order: 1;
    }
    .market-v3-checkout-page .market-v3-checkout__summary-col {
        order: 2;
    }
}

@media (max-width: 767px) {
    .market-v3-checkout-page .market-v3-checkout__summary-col {
        order: 1;
    }
    .market-v3-checkout-page .market-v3-checkout__address-col {
        order: 2;
    }
}

.market-v3-checkout__address-card,
.market-v3-checkout__summary-card {
    padding: var(--mv3-spacing);
    background: var(--mv3-header-bg);
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.market-v3-checkout__card-title {
    margin: 0 0 var(--mv3-spacing);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--mv3-text);
}

.market-v3-checkout__address-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.market-v3-checkout__address-list .list-group-item,
.market-v3-checkout__address-list .list-group-item-action {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius);
    background: var(--mv3-bg-light);
    cursor: pointer;
}

.market-v3-checkout__address-list .list-group-item:hover,
.market-v3-checkout__address-list .list-group-item-action:hover {
    border-color: var(--mv3-primary);
}

.market-v3-checkout__divider {
    margin: var(--mv3-spacing) 0;
    border-color: var(--mv3-border);
}

.market-v3-checkout__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.85rem;
    background: var(--mv3-primary);
    color: #fff;
    border-radius: 9999px;
}

.market-v3-checkout__cart-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--mv3-spacing);
}

.market-v3-checkout__cart-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--mv3-border);
    transition: opacity 0.3s ease;
}

.market-v3-checkout__cart-item.removing {
    opacity: 0.5;
}

.market-v3-checkout__cart-item-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.market-v3-checkout__cart-item-title {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--mv3-text);
}

.market-v3-checkout__cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.market-v3-checkout__qty-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius);
    overflow: hidden;
}

.market-v3-checkout__qty-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--mv3-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.market-v3-checkout__qty-btn:hover {
    color: var(--mv3-primary);
}

.market-v3-checkout__qty-input {
    width: 40px;
    padding: 0.25rem;
    border: none;
    border-left: 1px solid var(--mv3-border);
    border-right: 1px solid var(--mv3-border);
    text-align: center;
    font-size: 0.9rem;
    background: transparent;
    -moz-appearance: textfield;
}

.market-v3-checkout__qty-input::-webkit-outer-spin-button,
.market-v3-checkout__qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.market-v3-checkout__remove-btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius);
    background: transparent;
    color: var(--mv3-text-muted);
    cursor: pointer;
}

.market-v3-checkout__remove-btn:hover {
    border-color: #dc3545;
    color: #dc3545;
}

.market-v3-checkout__cart-item-price {
    text-align: right;
}

.market-v3-checkout__cart-item-each {
    display: block;
    font-size: 0.8rem;
    color: var(--mv3-text-muted);
}

.market-v3-checkout__totals {
    padding-top: var(--mv3-spacing);
    border-top: 1px solid var(--mv3-border);
}

.market-v3-checkout__total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.95rem;
}

.market-v3-checkout__total-row--final {
    font-size: 1.1rem;
    font-weight: 600;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--mv3-border);
}

.market-v3-checkout__total-row--final strong {
    color: var(--mv3-primary);
}

.market-v3-checkout__wa-order {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--mv3-border);
}

.market-v3-checkout__wa-order .market-v3-btn--success {
    font-weight: 600;
}

.market-v3-checkout__wa-hint {
    line-height: 1.45;
}

.market-v3-checkout__coupon-wrap {
    padding: 0.75rem 0;
}

.market-v3-checkout__coupon-input-group {
    display: flex;
    gap: 0.5rem;
}

.market-v3-checkout__coupon-input-group .market-v3-field__input {
    flex: 1;
}

.market-v3-checkout__promo-msg {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.market-v3-btn--block {
    width: 100%;
}

.market-v3-btn--sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.market-v3-checkout__map {
    height: 280px;
    width: 100%;
    border-radius: var(--mv3-radius);
    border: 1px solid var(--mv3-border);
}

.market-v3-modal .modal-content {
    background: var(--mv3-header-bg);
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius-lg);
}

.market-v3-modal .modal-header {
    border-bottom-color: var(--mv3-border);
}

.market-v3-modal .modal-footer {
    border-top-color: var(--mv3-border);
}

/* Order Success Page - Rivo/Stitch design */
.market-v3-order-success-page {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--mv3-spacing) 0;
}

.market-v3-order-success__loading,
.market-v3-order-success__error {
    padding: var(--mv3-spacing);
}

.market-v3-order-success__icon-wrap--error {
    background: rgba(220, 53, 69, 0.1);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.market-v3-order-success__header {
    text-align: center;
    margin-bottom: 2rem;
}

.market-v3-order-success__icon-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--mv3-primary) 10%, transparent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.market-v3-order-success__check-icon {
    font-size: 3rem;
    color: var(--mv3-primary);
}

.market-v3-order-success__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--mv3-text);
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}

.market-v3-order-success__order-id {
    font-size: 1.1rem;
    color: var(--mv3-text);
    margin: 0 0 1rem;
}

.market-v3-order-success__order-id-num {
    color: var(--mv3-primary);
}

.market-v3-order-success__progress-wrap {
    max-width: 400px;
    margin: 1.5rem auto 0;
}

.market-v3-order-success__progress-label,
.market-v3-order-success__progress-status {
    font-size: 0.9rem;
    font-weight: 500;
}

.market-v3-order-success__progress-status {
    color: var(--mv3-primary);
}

.market-v3-order-success__progress-bar {
    width: 100%;
    height: 8px;
    background: var(--mv3-border);
    border-radius: 9999px;
    overflow: hidden;
}

.market-v3-order-success__progress-fill {
    height: 100%;
    background: var(--mv3-primary);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.market-v3-order-success__card {
    background: var(--mv3-header-bg);
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: var(--mv3-spacing);
}

.market-v3-order-success__card--summary .market-v3-order-success__card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--mv3-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.market-v3-order-success__card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--mv3-text);
}

.market-v3-order-success__print-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mv3-primary);
    text-decoration: none;
}

.market-v3-order-success__print-link:hover {
    text-decoration: underline;
    color: var(--mv3-primary);
}

.market-v3-order-success__items {
    padding: 0;
}

.market-v3-order-success__item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--mv3-border);
}

.market-v3-order-success__item:last-of-type {
    border-bottom: none;
}

.market-v3-order-success__item-img {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: var(--mv3-radius);
    border: 1px solid var(--mv3-border);
    overflow: hidden;
    background: var(--mv3-bg-light);
}

.market-v3-order-success__item-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.market-v3-order-success__item-img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mv3-text-muted);
    font-size: 1.5rem;
}

.market-v3-order-success__item-body {
    flex: 1;
    min-width: 0;
}

.market-v3-order-success__item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--mv3-text);
    margin: 0 0 0.25rem;
}

.market-v3-order-success__item-qty {
    font-size: 0.9rem;
    color: var(--mv3-text-muted);
    margin: 0;
}

.market-v3-order-success__item-price {
    font-size: 1rem;
    font-weight: 600;
    color: var(--mv3-text);
}

.market-v3-order-success__totals {
    padding: 1.25rem 1.5rem;
    background: var(--mv3-bg-light);
}

.market-v3-order-success__total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--mv3-text-muted);
    padding: 0.35rem 0;
}

.market-v3-order-success__total-row--final {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--mv3-text);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--mv3-border);
}

.market-v3-order-success__total-amount {
    color: var(--mv3-primary);
}

.market-v3-order-success__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--mv3-spacing);
    margin-bottom: var(--mv3-spacing);
}

@media (min-width: 768px) {
    .market-v3-order-success__grid {
        grid-template-columns: 1fr 1fr;
    }
}

.market-v3-order-success__address-card,
.market-v3-order-success__payment-card {
    padding: 1.25rem 1.5rem;
}

.market-v3-order-success__card-icon-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.market-v3-order-success__card-icon {
    color: var(--mv3-primary);
    font-size: 1.25rem;
}

.market-v3-order-success__address-text,
.market-v3-order-success__payment-text {
    font-size: 0.9rem;
    color: var(--mv3-text);
    line-height: 1.6;
    margin: 0;
}

.market-v3-order-success__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.market-v3-order-success__action-btn {
    min-width: 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
}

.market-v3-order-success__support {
    text-align: center;
    padding-bottom: 2rem;
}

.market-v3-order-success__support-text {
    font-size: 0.9rem;
    color: var(--mv3-text-muted);
    margin-bottom: 1rem;
}

.market-v3-order-success__support-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.market-v3-order-success__support-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mv3-primary);
    text-decoration: none;
}

.market-v3-order-success__support-link:hover {
    text-decoration: underline;
    color: var(--mv3-primary);
}

/* Comparison table */
.market-v3-comparison-wrap {
    overflow-x: auto;
    margin-bottom: var(--mv3-spacing);
    -webkit-overflow-scrolling: touch;
}

.market-v3-comparison {
    width: 100%;
    min-width: 400px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.market-v3-comparison th,
.market-v3-comparison td {
    padding: 10px 12px;
    border: 1px solid var(--mv3-border);
    text-align: left;
    vertical-align: top;
}

.market-v3-comparison thead th {
    background: var(--mv3-header-bg);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
}

.market-v3-comparison__pin {
    position: sticky;
    left: 0;
    background: var(--mv3-header-bg);
    z-index: 1;
    min-width: 140px;
}

.market-v3-comparison thead th.market-v3-comparison__pin {
    z-index: 3;
}

.market-v3-comparison tbody tr:nth-child(even) .market-v3-comparison__pin {
    background: var(--mv3-bg-light);
}

.market-v3-comparison__product {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--mv3-text);
}

.market-v3-comparison__img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--mv3-radius);
}

.market-v3-comparison__img-placeholder {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.06);
    color: var(--mv3-text-muted);
    border-radius: var(--mv3-radius);
}

.market-v3-comparison__img-placeholder .material-icons-round {
    font-size: 1.5rem;
}

.market-v3-comparison__title {
    font-weight: 500;
    text-align: center;
    color: var(--mv3-text);
}

.market-v3-comparison__price {
    font-weight: 600;
    color: var(--mv3-primary);
}

/* Login form */
.market-v3-login {
    max-width: 400px;
    margin: 0 auto;
}

.market-v3-login__card {
    padding: calc(var(--mv3-spacing) * 2);
    background: var(--mv3-header-bg);
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius-lg);
}

.market-v3-login__title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 4px;
}

.market-v3-login__subtitle {
    color: var(--mv3-text-muted);
    margin: 0 0 var(--mv3-spacing);
    font-size: 0.9rem;
}

.market-v3-login__form {
    margin-bottom: var(--mv3-spacing);
}

.market-v3-field {
    margin-bottom: var(--mv3-spacing);
}

.market-v3-field__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--mv3-text);
}

.market-v3-field__input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius);
    background: var(--mv3-bg-light);
    color: var(--mv3-text);
    font: inherit;
}

.market-v3-field__input:focus {
    outline: none;
    border-color: var(--mv3-primary);
    box-shadow: 0 0 0 2px rgba(13, 147, 242, 0.2);
}

.market-v3-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--mv3-btn-padding, 10px 16px);
    border-radius: var(--mv3-radius);
    font-family: var(--mv3-btn-font, inherit);
    font-weight: 500;
    cursor: pointer;
    border: none;
}

.market-v3-btn--primary {
    background: var(--mv3-primary);
    color: #fff;
    width: 100%;
}

.market-v3-btn--primary:hover {
    background: var(--mv3-primary-dark);
}

.market-v3-btn--success {
    background: #25d366;
    color: #fff;
}

.market-v3-btn--success:hover {
    background: #1faa52;
    color: #fff;
}

.market-v3-btn--success .fab.fa-whatsapp {
    font-size: 1.1em;
    line-height: 1;
    margin-right: 0.35rem;
}

.market-v3-login__submit {
    margin-top: 8px;
}

.market-v3-login__error {
    margin-top: var(--mv3-spacing);
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--mv3-radius);
    color: #dc2626;
    font-size: 0.875rem;
}

.market-v3-login__footer {
    margin: 0;
    font-size: 0.9rem;
    color: var(--mv3-text-muted);
}

.market-v3-login__footer a {
    color: var(--mv3-primary);
    text-decoration: none;
}

.market-v3-login__forgot {
    margin: 6px 0 0;
    font-size: 0.85rem;
}

.market-v3-login__forgot a {
    color: var(--mv3-primary);
    text-decoration: none;
}

.market-v3-login__success {
    margin-top: var(--mv3-spacing);
    padding: 8px 12px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--mv3-radius);
    color: #059669;
    font-size: 0.875rem;
}

/* Status badges (pill with dot) */
.market-v3-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.market-v3-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.market-v3-badge--in-stock {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.market-v3-badge--low-stock {
    background: rgba(245, 158, 11, 0.2);
    color: #d97706;
}

.market-v3-badge--out-of-stock {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.market-v3-badge--new {
    background: rgba(13, 147, 242, 0.15);
    color: var(--mv3-primary);
}

/* Accordions (technical specs) */
.market-v3-accordion {
    border: 1px solid var(--mv3-border);
    border-radius: var(--mv3-radius);
    background: var(--mv3-header-bg);
    margin-bottom: 8px;
}

.market-v3-accordion__head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: none;
    background: transparent;
    font: inherit;
    font-weight: 500;
    color: var(--mv3-text);
    cursor: pointer;
    text-align: left;
}

.market-v3-accordion__head .material-icons {
    font-size: 20px;
    transition: transform 0.2s;
    color: var(--mv3-text-muted);
}

.market-v3-accordion--open .market-v3-accordion__head .material-icons {
    transform: rotate(180deg);
}

.market-v3-accordion__body {
    padding: 0 16px 12px;
    display: none;
    font-size: 0.9rem;
    color: var(--mv3-text-muted);
}

.market-v3-accordion--open .market-v3-accordion__body {
    display: block;
}

/* Product card list variant */
.market-v3-product-card--list {
    flex-direction: row;
    text-align: left;
}

.market-v3-product-card--list .market-v3-product-card__img-wrap {
    width: 120px;
    min-width: 120px;
    aspect-ratio: 1;
}

.market-v3-product-card--list .market-v3-product-card__body {
    flex: 1;
}

/* ==========================================================================
   MarketV3 Dynamic Theme Component Bindings
   ========================================================================== */

/* Pre-Header Links & Welcome Message */
.market-pre-header {
    background-color: var(--mv3-bg-light) !important;
    color: var(--mv3-text-muted) !important;
}
.market-pre-header a, .market-pre-header-link {
    color: var(--mv3-text-muted) !important;
    text-decoration: none;
    transition: color 0.2s ease;
}
.market-pre-header a:hover, .market-pre-header-link:hover {
    color: var(--mv3-primary) !important;
}

/* CTA & Action Buttons */
.btn-primary, .btn-cta, .btn-view-all, .btn-theme-primary, .btn-view-all-products {
    background-color: var(--mv3-primary) !important;
    border-color: var(--mv3-primary) !important;
    color: #ffffff !important;
    border-radius: var(--mv3-radius, 8px) !important;
    font-family: var(--mv3-font-display, inherit) !important;
    transition: transform 0.15s ease, opacity 0.2s ease;
}
.btn-primary:active, .btn-cta:active, .btn-view-all:active, .btn-theme-primary:active {
    transform: scale(var(--mv3-btn-active-scale, 0.95)) !important;
}

/* Category Card "View All" Links */
.category-card a, .category-card .view-all-link, a.view-all {
    color: var(--mv3-primary) !important;
    font-weight: 600;
}

/* Badges & Product Cards */
.badge-hot, .badge-discount, .badge-primary, .badge-sale, .market-v3-badge {
    background-color: var(--mv3-card-badge-bg, var(--mv3-primary)) !important;
    color: #ffffff !important;
    border-radius: 4px !important;
}

.product-card .add-to-cart-btn, .product-card .btn-cart, .market-v3-product-card__cart-btn {
    background-color: var(--mv3-primary) !important;
    border-color: var(--mv3-primary) !important;
    color: #ffffff !important;
    border-radius: 8px !important;
}

/* ==========================================================================
   Header Dark Mode Robustness Overrides
   ========================================================================== */
html.dark .market-pre-header,
html.dark .market-main-header,
html.dark .sticky-top,
html.dark nav,
html.dark header {
    background-color: var(--mv3-bg-light, #0f172a) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark .market-pre-header a,
html.dark .market-pre-header span,
html.dark .market-pre-header i,
html.dark .market-pre-header .text-dark,
html.dark .market-main-header a,
html.dark .market-main-header button,
html.dark .market-main-header i,
html.dark .market-main-header span:not(.badge),
html.dark .sticky-top a:not(.btn-primary),
html.dark .sticky-top button:not(.btn-primary),
html.dark .sticky-top i,
html.dark .sticky-top span:not(.badge) {
    color: var(--mv3-text, #f1f5f9) !important;
}

html.dark .market-pre-header .text-dark,
html.dark .market-main-header .text-dark,
html.dark .sticky-top .text-dark,
html.dark .market-pre-header .text-secondary,
html.dark .sticky-top .text-secondary {
    color: var(--mv3-text, #f1f5f9) !important;
}

html.dark .market-pre-header .text-muted,
html.dark .market-main-header .text-muted,
html.dark .sticky-top .text-muted {
    color: var(--mv3-text-muted, #94a3b8) !important;
}

html.dark .sticky-top form {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

html.dark .sticky-top input {
    color: var(--mv3-text, #f1f5f9) !important;
    background-color: transparent !important;
}


/* --- Partdo Auto Parts (Home 2) Theme Styles & Overrides --- */

/* Dark Mode Partdo Header Overrides */
html.dark .partdo-main-header {
    background-color: var(--mv3-bg-light, #0f172a) !important;
}

html.dark .partdo-search-group {
    background-color: rgba(255, 255, 255, 0.04) !important;
    border-color: var(--mv3-primary, #fbc02d) !important;
}

html.dark .partdo-search-select {
    color: var(--mv3-text, #f1f5f9) !important;
    border-right-color: rgba(255, 255, 255, 0.15) !important;
}
html[dir="rtl"].dark .partdo-search-select {
    border-left-color: rgba(255, 255, 255, 0.15) !important;
}

html.dark .partdo-search-input {
    color: var(--mv3-text, #f1f5f9) !important;
}

html.dark .partdo-action-btn {
    color: var(--mv3-text, #f1f5f9) !important;
}

html.dark .partdo-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

html.dark .partdo-navbar {
    background-color: var(--mv3-primary, #fbc02d) !important;
}

html.dark .partdo-nav-link {
    color: var(--mv3-secondary, #0f172a) !important;
}

html.dark .partdo-dept-btn {
    background-color: var(--mv3-secondary, #0f172a) !important;
    color: #ffffff !important;
}

/* Partdo stock progress indicator slider */
.partdo-stock-progress-container .progress {
    background-color: rgba(0, 0, 0, 0.08) !important;
}
html.dark .partdo-stock-progress-container .progress {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Circular Categories Layout styling */
.circular-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.circular-cat-item {
    text-align: center;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease-in-out;
}

.circular-cat-item:hover {
    transform: translateY(-4px);
}

.circular-cat-img-wrap {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.04);
    border: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.circular-cat-item:hover .circular-cat-img-wrap {
    border-color: var(--mv3-primary, #fbc02d);
    box-shadow: 0 4px 12px rgba(253, 192, 45, 0.2);
}

html.dark .circular-cat-img-wrap {
    background-color: rgba(255, 255, 255, 0.05);
}

.circular-cat-img {
    width: 60%;
    height: 60%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.circular-cat-item:hover .circular-cat-img {
    transform: scale(1.1);
}

.circular-cat-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mv3-text, #1e293b);
    margin: 0;
    line-height: 1.2;
}

/* Brands slide row styling */
.partdo-brands-section {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 3rem 0;
}
html.dark .partdo-brands-section {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.brands-slider-track {
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
}

.brand-logo-link {
    display: inline-block;
    transition: transform 0.2s;
}

.brand-logo-link:hover {
    transform: scale(1.08);
}

.brand-logo-img {
    max-height: 40px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.5;
    transition: filter 0.2s, opacity 0.2s;
}

.brand-logo-link:hover .brand-logo-img {
    filter: grayscale(0%);
    opacity: 1;
}
html.dark .brand-logo-img {
    filter: grayscale(100%) invert(100%);
    opacity: 0.6;
}
html.dark .brand-logo-link:hover .brand-logo-img {
    filter: grayscale(0%) invert(0%);
    opacity: 1;
}
