/**
 * Marketplace Premium eCommerce Design System
 * Inspired by Amazon, Shopify, and modern Global Marketplaces
 */

:root {
    /* Adewire brand palette (matches hero strip) */
    --ade-ink: #052c15;
    --ade-ink-2: #0a2f1a;
    --ade-ink-3: #0f3d24;
    --ade-line: rgba(61, 125, 90, 0.35);
    --ade-gold: #d4b982;
    --ade-gold-hover: #e2c896;
    --ade-muted: #a8b5a8;
    --ade-leaf: #1f8f5f;
    --ade-leaf-soft: #e8f5ec;

    /* Marketplace Color Palette */
    --market-dark: var(--ade-ink);
    --market-sub-dark: var(--ade-ink-2);
    --market-accent: var(--ade-gold);
    --market-accent-hover: var(--ade-gold-hover);
    --market-blue: #146b4a;
    --market-red: #cc0c39;
    --market-bg: #eef5f0;
    --market-card-bg: #ffffff;
    --market-text: #0f1a14;
    --market-text-light: #5a6b60;
    --market-link: #146b4a;
    
    /* UI Tokens */
    --market-radius: 8px;
    --market-shadow: 0 4px 16px rgba(5, 44, 21, 0.1);
    --market-shadow-sm: 0 1px 3px rgba(5, 44, 21, 0.08);
}

body.store-premium {
    font-family: inherit;
    background-color: var(--market-bg) !important;
    color: var(--market-text);
    line-height: 1.5;
}

/* --- Marketplace Header (3-Tier) --- */
.marketplace-header {
    background:
      linear-gradient(180deg, rgba(5, 44, 21, 0.92), rgba(10, 47, 26, 0.98)),
      repeating-linear-gradient(90deg, transparent 0 22px, rgba(90, 160, 120, 0.08) 22px 23px, transparent 23px 46px),
      var(--market-dark);
    color: #fff;
    border-bottom: 1px solid rgba(90, 160, 120, 0.25);
}

.marketplace-main-nav {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    gap: 15px;
}

.marketplace-search-wrap {
    flex-grow: 1;
    display: flex;
    background: #fff;
    border-radius: 4px;
    height: 40px;
    overflow: visible;
    position: relative;
}
.marketplace-search-wrap > form {
    display: flex;
    flex-grow: 1;
    min-width: 0;
    position: relative;
    border-radius: 0 4px 4px 0;
    overflow: visible;
}
.marketplace-search-suggest {
    position: fixed;
    z-index: 20000;
    background: #fff;
    color: #0f1111;
    border: 1px solid #d5d9d9;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(15, 17, 17, 0.22);
    max-height: min(72vh, 460px);
    overflow: auto;
    padding: 0;
    margin: 0;
}
.marketplace-search-suggest__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.marketplace-search-suggest__list > li + li {
    border-top: 1px solid #eee;
}
.marketplace-search-suggest__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    text-decoration: none;
    color: inherit;
    min-height: 52px;
}
.marketplace-search-suggest__item:hover,
.marketplace-search-suggest__item:focus {
    background: #f7f8f8;
    color: inherit;
}
.marketplace-search-suggest__main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
    min-width: 0;
    flex: 1;
}
.marketplace-search-suggest__name {
    font-size: 0.95rem;
    font-weight: 400;
    color: #0f1111;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.marketplace-search-suggest__name strong {
    font-weight: 700;
    color: #0f1111;
}
.marketplace-search-suggest__in {
    font-size: 0.8rem;
    color: #565959;
    line-height: 1.2;
}
.marketplace-search-suggest__in em {
    font-style: normal;
    font-weight: 600;
    color: #146b4a;
}
.marketplace-search-suggest__thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    background: #f0f2f2;
    flex-shrink: 0;
    border: 1px solid #e7e7e7;
}
.marketplace-search-suggest__thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8a8d8d;
}
.marketplace-search-suggest__arrow {
    color: #879596;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.marketplace-search-suggest__empty {
    padding: 0.85rem 0.95rem;
    font-size: 0.875rem;
    color: #565959;
}
.marketplace-search-suggest__all {
    display: block;
    padding: 0.75rem 0.95rem;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    font-weight: 600;
    color: #146b4a;
    text-decoration: none;
    position: sticky;
    bottom: 0;
    background: #fff;
}
.marketplace-search-suggest__all:hover {
    background: #f3faf6;
    color: #0b3d2e;
}

.marketplace-search-cat {
    background: #f3f3f3;
    border-right: 1px solid #ddd;
    color: #555;
    padding: 0 15px;
    font-size: 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    border-radius: 4px 0 0 4px;
    flex-shrink: 0;
}

.marketplace-search-input {
    flex-grow: 1;
    border: none;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
}

.marketplace-search-btn {
    background: var(--market-accent);
    color: var(--ade-ink, #052c15);
    border: none;
    width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    flex-shrink: 0;
}

.marketplace-search-btn:hover { background: var(--market-accent-hover); color: var(--ade-ink, #052c15); }

.marketplace-nav-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 5px 10px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
}

.marketplace-nav-item:hover { border-color: #fff; }

.nav-line-1 { font-size: 12px; color: #ccc; }
.nav-line-2 { font-size: 14px; font-weight: 700; }

.marketplace-sub-nav {
    background: #f7fbf8;
    color: var(--market-text);
    display: flex;
    align-items: stretch;
    padding: 0 12px;
    gap: 0;
    font-size: 14px;
    border-bottom: 1px solid rgba(20, 107, 74, 0.12);
    position: relative;
    z-index: 1040;
    min-height: 42px;
}

.sub-nav-link {
    color: var(--market-text);
    text-decoration: none;
    padding: 10px 12px;
    border: none;
    background: transparent;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
}

.sub-nav-link:hover,
.sub-nav-link:focus-visible {
    color: var(--brand, var(--market-link));
    outline: none;
}

.sub-nav-link--all {
    font-weight: 700;
    gap: 0.35rem;
    border-right: 1px solid #e3e6e6;
    margin-right: 4px;
}

.sub-nav-link--mega {
    font-weight: 600;
}

.sub-nav-link--category {
    font-weight: 500;
}

.marketplace-sub-nav__scroll {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    min-width: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.marketplace-sub-nav__scroll::-webkit-scrollbar {
    display: none;
}

/* Mega menu (Departments / Services) */
.marketplace-mega-nav {
    position: relative;
}

.marketplace-mega-nav.is-open .marketplace-mega-trigger {
    background: rgba(0, 0, 0, 0.04);
}

.marketplace-mega-panel {
    position: absolute;
    left: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #e3e6e6;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    z-index: 1050;
    width: min(820px, calc(100vw - 32px));
}

.marketplace-mega-panel--services {
    width: min(520px, calc(100vw - 32px));
}

.marketplace-mega-panel[hidden] {
    display: none !important;
}

.marketplace-mega-panel__inner {
    display: flex;
    min-height: 280px;
    max-height: min(420px, 65vh);
}

.marketplace-mega-panel__left {
    flex: 0 0 200px;
    border-right: 1px solid #e3e6e6;
    overflow-y: auto;
    padding: 0.5rem 0;
    background: #fafafa;
}

.marketplace-mega-panel__body {
    flex: 1;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.marketplace-mega-panel__left-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--market-text);
    text-decoration: none;
    padding: 0.65rem 1rem 0.65rem 1.15rem;
    font-size: 14px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.marketplace-mega-panel__left-item:hover,
.marketplace-mega-panel__left-item.is-active {
    background: #fff;
    border-left-color: var(--brand, var(--market-link));
    font-weight: 600;
}

.marketplace-mega-dept,
.marketplace-mega-service {
    display: none;
    height: 100%;
    grid-template-columns: 200px 1fr;
    gap: 0;
}

.marketplace-mega-dept.is-active,
.marketplace-mega-service.is-active {
    display: grid;
}

.marketplace-mega-service.is-active {
    display: block;
    overflow-y: auto;
    padding: 0.75rem 1rem 1rem;
}

.marketplace-mega-panel__middle {
    border-right: 1px solid #e3e6e6;
    overflow-y: auto;
    padding: 0.5rem 0;
    background: #fcfcfc;
}

.marketplace-mega-panel__all-link {
    display: block;
    padding: 0.55rem 1rem;
    font-size: 14px;
    font-weight: 700;
    color: var(--market-text);
    text-decoration: none;
    border-bottom: 1px solid #eef1f1;
    margin-bottom: 0.25rem;
}

.marketplace-mega-panel__all-link:hover {
    color: var(--brand, var(--market-link));
}

.marketplace-mega-panel__middle-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--market-text);
    padding: 0.55rem 1rem;
    font-size: 13px;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.marketplace-mega-panel__middle-item:hover,
.marketplace-mega-panel__middle-item.is-active {
    background: #fff;
    border-left-color: var(--brand, var(--market-link));
    font-weight: 600;
}

.marketplace-mega-panel__right {
    overflow-y: auto;
    padding: 0.75rem 1rem 1rem;
    position: relative;
}

.marketplace-mega-group {
    display: none;
}

.marketplace-mega-group.is-active {
    display: block;
}

.marketplace-mega-group__heading {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--market-text);
    text-decoration: none;
    margin-bottom: 0.65rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #eef1f1;
}

.marketplace-mega-group__heading:hover {
    color: var(--brand, var(--market-link));
}

.marketplace-mega-group__list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.marketplace-mega-cat__link {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--market-text);
    text-decoration: none;
    padding: 0.2rem 0;
}

.marketplace-mega-cat__link:hover {
    color: var(--brand, var(--market-link));
    text-decoration: underline;
}

.marketplace-mega-cat__subs {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding-left: 0.75rem;
    margin-bottom: 0.35rem;
}

.marketplace-mega-cat__sub {
    font-size: 12px;
    color: var(--market-text-light);
    text-decoration: none;
}

.marketplace-mega-cat__sub:hover {
    color: var(--brand, var(--market-link));
    text-decoration: underline;
}

.marketplace-mega-panel__empty {
    font-size: 13px;
    color: var(--market-text-light);
    padding: 0.75rem 1rem;
    margin: 0;
}

.marketplace-mega-service__links {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.75rem;
}

.marketplace-mega-service__label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--market-text-light);
    margin: 0.5rem 0 0.35rem;
}

.marketplace-mega-panel__link {
    color: var(--market-text);
    text-decoration: none;
    padding: 0.35rem 0;
    font-size: 14px;
    border-radius: 4px;
}

.marketplace-mega-panel__link:hover {
    color: var(--brand, var(--market-link));
    text-decoration: underline;
}

.marketplace-mega-panel__link.is-bold {
    font-weight: 700;
}

.marketplace-mega-panel__link.is-muted {
    color: var(--market-text-light);
    font-size: 13px;
}

.marketplace-mega-panel__link.is-muted:hover {
    color: var(--market-text-light);
    text-decoration: none;
}

/* --- Marketplace Hero --- */
.marketplace-hero {
    position: relative;
    background: #e3e6e6;
    margin-bottom: -150px;
}

.marketplace-hero-img {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0));
}

.marketplace-quick-cards {
    position: relative;
    z-index: 10;
    margin-top: -300px;
    padding: 0 20px;
}

.quick-card {
    background: #fff;
    padding: 20px;
    height: 100%;
    box-shadow: var(--market-shadow);
}

.quick-card h4 { font-size: 18px; margin-bottom: 15px; font-weight: 700; }

.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.grid-item {
    text-decoration: none;
    color: inherit;
}

.grid-item img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    margin-bottom: 5px;
}

.grid-item span { font-size: 12px; }

/* --- Marketplace Product Cards (compact) --- */
.marketplace-pcard {
    background: #fff;
    padding: 8px 10px 10px;
    border-radius: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.marketplace-pcard:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1); }

/* Square ecommerce product thumbnail (Amazon / Shopify style) */
.pcard-img-wrap,
.cv2-product-card__img-wrap,
.store-product-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    height: auto;
    max-height: none;
    background: #ffffff;
    margin-bottom: 8px;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcard-img-wrap img,
.cv2-product-card__img,
.store-product-thumb__img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    object-position: center;
    padding: 0.65rem;
    display: block;
    background: transparent;
}

.pcard-title {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    margin-bottom: 4px;
    height: 32px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pcard-rating {
    color: #ffa41c;
    font-size: 10px;
    margin-bottom: 4px;
}

.pcard-rating .x-small,
.pcard-rating span { font-size: 10px !important; }

.pcard-price {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: flex-start;
    line-height: 1.2;
}

.pcard-price .currency { font-size: 10px; margin-top: 2px; }

.marketplace-pcard-body .text-muted.x-small,
.marketplace-pcard-body .badge { font-size: 10px !important; }

.pcard-deal {
    background: var(--market-red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 2px;
    display: inline-block;
    margin-bottom: 4px;
}

@media (min-width: 1200px) {
    .pcard-img-wrap img,
    .cv2-product-card__img,
    .store-product-thumb__img {
        padding: 0.75rem;
    }
}

/* --- Mobile Bottom Nav --- */
.marketplace-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid rgba(20, 107, 74, 0.14);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 -6px 20px rgba(5, 44, 21, 0.08);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #5a6b60;
    font-size: 10px;
}

.mobile-nav-item i { font-size: 22px; margin-bottom: 2px; }
.mobile-nav-item.active { color: var(--ade-leaf, #1f8f5f); }

/* --- Footer --- */
.marketplace-footer {
    --footer-link: #cfe3d6;
    --footer-link-hover: #ffffff;
    --footer-muted: #9bb5a5;
    --footer-bar: #0a2418;
    font-family: inherit;
    background:
      linear-gradient(180deg, rgba(10, 47, 26, 0.96), rgba(5, 44, 21, 1)),
      var(--market-sub-dark);
    color: #fff;
    margin-top: 50px;
    margin-bottom: 0;
    letter-spacing: 0.01em;
    border-top: 1px solid rgba(90, 160, 120, 0.28);
}

.footer-back-to-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    border: 0;
    background: var(--footer-bar);
    padding: 0.875rem 1rem;
    text-align: center;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    color: #fff;
    transition: background-color 0.2s ease;
}

.footer-back-to-top:hover,
.footer-back-to-top:focus-visible {
    background: #12452c;
    color: #fff;
}

.footer-back-to-top i {
    font-size: 0.75rem;
    opacity: 0.9;
}

.footer-main {
    padding: 2.75rem 1.25rem 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-main__inner {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem 2.5rem;
    max-width: 72rem;
    margin: 0 auto;
}

.footer-col {
    min-width: 0;
}

.footer-col__title {
    margin: 0 0 0.875rem;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
}

.footer-col__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-col__list li + li {
    margin-top: 0.625rem;
}

.footer-col__list a {
    display: inline-block;
    color: var(--footer-link);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.45;
    transition: color 0.15s ease;
}

.footer-col__list a:hover,
.footer-col__list a:focus-visible {
    color: var(--footer-link-hover);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-bottom {
    background: var(--market-dark);
    padding: 2rem 1.25rem 2.25rem;
    color: var(--footer-muted);
}

.footer-bottom__inner {
    max-width: 72rem;
    margin: 0 auto;
    text-align: center;
}

.footer-bottom__brand-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.footer-brand-link {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    text-decoration: none;
}

.footer-brand-logo {
    display: block;
    height: 2rem;
    width: auto;
    max-width: 7.5rem;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

.footer-locale-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.625rem;
}

.footer-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    color: #e3e6e8;
    white-space: nowrap;
}

.footer-chip i {
    font-size: 0.8rem;
    opacity: 0.9;
}

.footer-copyright {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--footer-muted);
}

@media (max-width: 991.98px) {
    .footer-main__inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .footer-main {
        padding: 2rem 1rem 2.5rem;
    }

    .footer-main__inner {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .footer-col__title {
        font-size: 0.875rem;
        margin-bottom: 0.75rem;
    }

    .footer-col__list a {
        font-size: 0.8125rem;
    }

    .footer-bottom {
        padding: 1.5rem 1rem 1.75rem;
    }

    .footer-bottom__brand-row {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-locale-chips {
        width: 100%;
    }

    .footer-chip {
        flex: 1 1 auto;
        justify-content: center;
        min-width: calc(50% - 0.5rem);
        white-space: normal;
        text-align: center;
    }
}

/* Utilities */
.reveal-up { animation: revealUp 0.6s ease-out forwards; }
@keyframes revealUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.store-page-px { padding-left: 20px; padding-right: 20px; }
@media (max-width: 991.98px) {
  .store-page-px { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 768px) {
  .store-page-px { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 575.98px) {
  .store-page-px { padding-left: 18px; padding-right: 18px; }
}
