/* AssetLux Main Stylesheet */
:root {
    --primary-bg: #131921;
    --secondary-bg: #232f3e;
    --accent-gold: #febd69;
    --accent-orange: #f08804;
    --text-white: #ffffff;
    --text-dark: #111111;
    --border-gray: #dddddd;
    --luxury-gold: #d4af37;
    --luxury-gold-light: #f4d03f;
    --luxury-gold-dark: #b8860b;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

img,
video,
iframe {
    max-width: 100%;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background-color: #f8f9fa;
    padding-top: 100px;
    overflow-x: hidden;
    max-width: 100vw;
}

main {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* --- Marketplace (category / search) pages --- */
.marketplace-container {
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
    width: 100%;
}

.marketplace-hero {
    background-color: #f1f3f6;
    padding: 40px 0;
    border-bottom: 1px solid #e0e0e0;
}

.marketplace-filter-panel {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid #ddd;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.marketplace-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(100px, 120px);
    gap: 15px;
    align-items: end;
}

.marketplace-filter-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.marketplace-filter-label {
    display: block;
    font-weight: 700;
    font-size: 0.65rem;
    margin-bottom: 5px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.marketplace-filter-input,
.marketplace-filter-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #eee;
    border-radius: 6px;
    font-size: 0.8rem;
    background: #fafafa;
    outline: none;
}

.marketplace-price-row {
    display: flex;
    gap: 8px;
}

.marketplace-assets-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.marketplace-assets-grid > * {
    min-width: 0;
}

.marketplace-asset-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.marketplace-asset-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.marketplace-asset-card__image {
    height: 250px;
    overflow: hidden;
}

.marketplace-asset-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.marketplace-asset-card__body {
    padding: 20px;
}

.marketplace-asset-card__title {
    margin: 0 0 12px;
    font-size: 1.3rem;
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.3;
    word-wrap: break-word;
}

.marketplace-asset-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
    flex-wrap: wrap;
}

.marketplace-results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

/* Form styling improvements */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fafafa;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--luxury-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    background: white;
}

/* Flash message improvements */
.alert {
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-left: 4px solid;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.alert-success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* --- Header Styles --- */
header {
    background-color: var(--primary-bg);
    color: var(--text-white);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100vw;
    z-index: 3000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: visible;
}

.header-main {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    gap: 20px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-gold);
    text-decoration: none;
    text-transform: lowercase;
    letter-spacing: -1px;
    transition: color 0.3s ease, transform 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.logo:hover {
    color: var(--luxury-gold-light);
    transform: scale(1.02);
}

.nav-tool {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    font-size: 13px;
    padding: 8px;
    border: 1px solid transparent;
}

.nav-tool:hover {
    border: 1px solid white;
    border-radius: 2px;
}

.nav-tool strong {
    font-size: 14px;
    font-weight: 700;
}

.nav-label-short {
    display: none;
}

.header-toolbar {
    display: contents;
}

.header-prefs {
    display: flex;
    gap: 15px;
    align-items: center;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 15px;
    margin-left: 5px;
    flex-shrink: 0;
}

.header-main .logo { order: 1; }
.header-main .nav-location { order: 2; }
.header-main .search-bar { order: 3; flex: 1; }
.header-main .account-dropdown-trigger { order: 4; }
.header-main .header-prefs { order: 5; }
.header-main .nav-inquiries { order: 6; }

.nav-location > .fa-caret-down {
    display: none;
}

.header-prefs select,
.header-prefs .lang-dropdown-trigger {
    font-size: 0.7rem;
}

/* Language selector */
.lang-dropdown-trigger {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    gap: 5px;
}

.lang-dropdown-trigger:hover .lang-dropdown,
.lang-dropdown.is-open {
    display: block;
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: white;
    min-width: 160px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 8px 0;
    z-index: 3100;
    color: #333;
    border: 1px solid #ddd;
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.lang-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    text-decoration: none;
    color: #444;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.lang-link:hover {
    background: #f8f9fa;
    color: var(--luxury-gold);
}

.lang-link.active {
    background: #fff9e6;
    color: var(--luxury-gold);
    font-weight: 700;
}

.flag-icon {
    font-size: 1.1rem;
}

.lang-menu-overlay {
    display: none;
}

.search-bar {
    flex-grow: 1;
    display: flex;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    height: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.search-bar:focus-within {
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.search-select {
    background: #f3f3f3;
    border: none;
    padding: 0 10px;
    border-right: 1px solid #ccc;
    cursor: pointer;
    font-family: inherit;
}

.search-input {
    flex-grow: 1;
    border: none;
    padding: 0 10px;
    font-size: 15px;
    outline: none;
    background: transparent;
}

.search-btn {
    background: var(--accent-gold);
    border: none;
    padding: 0 15px;
    cursor: pointer;
    font-size: 18px;
    color: #333;
    transition: background 0.3s ease, transform 0.2s ease;
}

.search-btn:hover {
    background: #f3a847;
    transform: scale(1.05);
}

.sub-nav {
    background-color: var(--secondary-bg);
    padding: 5px 20px;
    display: flex;
    gap: 15px;
    font-size: 14px;
    align-items: center;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.sub-nav::-webkit-scrollbar {
    display: none;
}

.sub-nav a {
    color: white;
    text-decoration: none;
    padding: 5px 8px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    flex: 0 0 auto;
}

.sub-nav a:hover {
    border: 1px solid white;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
}

/* Sub-nav scroll indicator wrapper */
.sub-nav-wrapper {
    position: relative;
}

.sub-nav-wrapper::before,
.sub-nav-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sub-nav-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--secondary-bg) 0%, transparent 100%);
}

.sub-nav-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--secondary-bg) 0%, transparent 100%);
}

.sub-nav-wrapper.scroll-right::after {
    opacity: 1;
}

.sub-nav-wrapper.scroll-left::before {
    opacity: 1;
}

/* Sub-nav scroll arrows for small laptops */
.sub-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sub-nav-wrapper:hover .sub-nav-arrow {
    opacity: 1;
}

.sub-nav-arrow:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sub-nav-arrow--left {
    left: 5px;
}

.sub-nav-arrow--right {
    right: 5px;
}

/* M-Pesa verification responsive */
@media (max-width: 1024px) {
    #main-container {
        grid-template-columns: 1fr !important;
        max-width: 550px !important;
        gap: 30px !important;
    }
}

/* --- Luxury Theme Overrides --- */
.luxury-card {
    background: transparent;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    transition: all 0.3s ease;
}

.luxury-card:hover {
    transform: translateY(-5px);
}

.btn-premium {
    background: linear-gradient(135deg, var(--luxury-gold) 0%, var(--luxury-gold-dark) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    white-space: normal;
    text-align: center;
}

.btn-premium:hover {
    background: linear-gradient(135deg, var(--luxury-gold-light) 0%, var(--luxury-gold) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-premium:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

.price-tag {
    color: var(--luxury-gold);
    font-size: 1.5rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-wrap: anywhere;
}

/* --- Footer --- */
.site-footer {
    background: linear-gradient(180deg, var(--secondary-bg) 0%, var(--primary-bg) 100%);
    color: #b8c4ce;
    margin-top: 60px;
    border-top: 3px solid var(--luxury-gold);
}

.footer-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 40px;
    padding: 48px 0 40px;
}

.footer-brand .footer-logo {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent-gold);
    text-decoration: none;
    text-transform: lowercase;
    letter-spacing: -0.5px;
    display: inline-block;
    margin-bottom: 14px;
}

.footer-brand p {
    margin: 0 0 20px;
    font-size: 0.9rem;
    line-height: 1.65;
    color: #9aa8b5;
    max-width: 280px;
}

.footer-location {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #e8edf2;
    padding: 8px 14px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 6px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
    transition: border-color 0.2s, color 0.2s;
}

.footer-location:hover {
    border-color: var(--luxury-gold);
    color: var(--luxury-gold);
}

.footer-column h4 {
    margin: 0 0 18px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--luxury-gold);
}

.footer-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-column li {
    margin-bottom: 10px;
}

.footer-column a {
    color: #b8c4ce;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s, padding-left 0.3s ease;
    display: inline-block;
}

.footer-column a:hover {
    color: var(--accent-gold);
    padding-left: 4px;
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #b8c4ce;
    font-size: 1rem;
    transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.3s ease;
}

.footer-social a:hover {
    background: rgba(212, 175, 55, 0.12);
    border-color: var(--luxury-gold);
    color: var(--luxury-gold);
    padding-left: 0;
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 22px 0 28px;
    text-align: center;
}

/* Hide legacy CMS HTML blocks (category link columns, etc.) */
.footer-bottom > div,
.footer-bottom > section,
.footer-bottom > nav,
.footer-bottom > ul,
.footer-bottom table {
    display: none !important;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.85rem;
    color: #7a8a99;
    line-height: 1.6;
}

.footer-copyright {
    color: #7a8a99;
}

.footer-bottom .footer-powered {
    margin-top: 10px;
    font-size: 0.78rem;
    color: #5c6b78;
}

.footer-bottom .footer-powered strong {
    color: var(--luxury-gold);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .site-footer {
        margin-top: 40px;
        margin-bottom: 0;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 36px 0 28px;
    }
    .footer-brand p {
        max-width: none;
    }
    .footer-bottom {
        padding-bottom: 36px;
    }
}

@media (max-width: 1100px) {
    .marketplace-assets-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    body {
        padding-top: 112px;
    }

    .header-main {
        gap: 12px;
        padding-left: 14px;
        padding-right: 14px;
    }

    .logo {
        font-size: 1.25rem;
        letter-spacing: 0;
    }

    .nav-tool {
        padding: 6px;
        font-size: 0.72rem;
    }

    .nav-tool strong {
        font-size: 0.78rem;
    }

    .header-prefs {
        gap: 8px;
        padding-left: 10px;
    }

    .search-select {
        max-width: 135px;
    }

    .sub-nav {
        gap: 5px;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        font-size: 12px;
        padding: 5px 12px;
    }

    .sub-nav a {
        padding: 4px 6px;
        font-size: 12px;
    }

    .sub-nav::-webkit-scrollbar {
        display: none;
    }
}

/* Small laptop adjustments (1024px - 1366px) */
@media (max-width: 1366px) and (min-width: 1181px) {
    .sub-nav {
        gap: 6px;
        font-size: 13px;
        padding: 5px 15px;
    }

    .sub-nav a {
        padding: 4px 6px;
        font-size: 13px;
    }
}

/* --- Mobile Responsive Rules --- */
@media (max-width: 768px) {
    body {
        padding-top: 205px;
    }

    .marketplace-hero {
        padding: 24px 0;
    }

    .marketplace-hero h1,
    .marketplace-page-title {
        font-size: 1.5rem !important;
        letter-spacing: 0 !important;
    }

    .marketplace-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .marketplace-filter-panel {
        padding: 16px;
    }

    .marketplace-filter-grid,
    .marketplace-filter-grid--compact {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .marketplace-filter-grid .filter-submit-cell {
        grid-column: 1;
    }

    .marketplace-assets-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .marketplace-asset-card__image {
        height: 200px;
    }

    .asset-carousel {
        overflow: hidden !important;
        margin-left: -4px;
        margin-right: -4px;
        padding: 0 4px 4px;
    }

    .asset-carousel-track {
        gap: 14px !important;
    }

    .asset-carousel-track .luxury-card {
        min-width: min(88vw, 360px) !important;
        width: min(88vw, 360px) !important;
        flex-shrink: 0 !important;
        border-radius: 8px;
        margin-bottom: 0;
    }

    .asset-carousel-image {
        height: 205px !important;
    }

    .asset-carousel-body {
        padding: 15px !important;
    }

    .asset-carousel-title {
        font-size: 1.1rem !important;
        line-height: 1.35 !important;
    }

    .asset-carousel-footer {
        align-items: stretch !important;
        flex-direction: column;
        gap: 8px;
    }

    .asset-carousel-action {
        width: 100%;
    }

    main > div[style*="max-width: 1300px"] {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    main > div[style*="max-width: 1300px"] > div[style*="grid-template-columns: 1.5fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 22px !important;
    }

    #main-gallery-image {
        height: clamp(240px, 68vw, 380px) !important;
    }

    .gallery-thumb {
        height: 64px !important;
    }

    main div[style*="position: sticky"] {
        position: static !important;
        top: auto !important;
    }

    main div[style*="padding: 40px"] {
        padding: 24px !important;
    }

    .price-tag {
        font-size: 1.6rem !important;
    }
}

@media (max-width: 560px) {
    main div[style*="grid-template-columns: repeat(2, 1fr)"],
    main div[style*="grid-template-columns: 1fr 1fr"],
    main div[style*="grid-template-columns: 1fr 120px"],
    main div[style*="grid-template-columns: 1fr 160px"],
    #messaging-system > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .marketplace-price-row {
        flex-direction: column;
    }

    .footer-location {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 360px) {
    .asset-carousel-track .luxury-card {
        min-width: calc(100vw - 32px) !important;
        width: calc(100vw - 32px) !important;
    }

    .asset-carousel-image {
        height: 185px !important;
    }
}
