body,h1,h2,h3,h4,h5,h6,p,a,span{
  font-family: "Cairo", sans-serif !important;
}

/* Platform primary color customization */
:root {
  --bs-primary: #c02130;
  --bs-link-color: #c02130;
  --bs-link-hover-color: #a61b28;
}

.btn-primary {
  --bs-btn-bg: #c02130;
  --bs-btn-border-color: #c02130;
  --bs-btn-hover-bg: #a61b28;
  --bs-btn-hover-border-color: #a61b28;
}

.bg-primary { background-color: #c02130 !important; }
.text-primary { color: #c02130 !important; }
.badge.bg-primary { background-color: #c02130 !important; }

/* Modern Compact Horizontal Ad Card component */
.ad-horizontal-card {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    transition: all 0.3s ease;
    position: relative;
    z-index: 5;
}
.ad-horizontal-card:hover,
.ad-horizontal-card:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.05) !important;
    border-color: #cbd5e1;
    z-index: 100 !important;
}
.ad-horizontal-card .dropdown-menu {
    z-index: 9999 !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
}
.ad-img-wrapper {
    position: relative;
    background-color: #f1f5f9;
    overflow: hidden;
    border-radius: 8px;
}
.ad-img-wrapper img {
    transition: transform 0.5s ease;
}
.ad-horizontal-card:hover .ad-img-wrapper img {
    transform: scale(1.08);
}
.badge-status {
    padding: 4px 8px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 11px;
}
.badge-expiry {
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.badge-expiry-success {
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}
.badge-expiry-warning {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}
.badge-expiry-danger {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.btn-manage-ad {
    border-radius: 6px;
    font-weight: 700;
    padding: 6px 12px;
    font-size: 13px;
    transition: all 0.3s ease;
}
.btn-manage-ad:hover {
    background-color: #1e3c72;
    color: #ffffff;
    border-color: #1e3c72;
}
.empty-state-card {
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    padding: 40px 20px;
}

/* Page Layout Contexts */
.bg-soft-ash {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.text-primary-gradient {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* Unified ad card (grid + horizontal) */
.ad-card--grid {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.ad-card--grid:hover {
    border-color: #d5dee8;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}
.ad-card__media-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.ad-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #f1f5f9;
    overflow: hidden;
}
.ad-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.ad-card--grid:hover .ad-card__img {
    transform: scale(1.04);
}
.ad-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 2.5rem;
}
.ad-card__price-badge {
    position: absolute;
    bottom: 10px;
    inset-inline-start: 10px;
    background: rgba(255, 255, 255, 0.95);
    color: #c02130;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 4px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.ad-card__condition-badge {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    background: rgba(15, 23, 42, 0.75);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}
.ad-card__body {
    padding: 12px 14px 10px;
    flex: 1;
}
.ad-card__title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ad-card__title a:hover {
    color: #c02130 !important;
}
.ad-card__location {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin: 0 0 4px;
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.35;
}
.ad-card__location i {
    color: #c02130;
    margin-top: 2px;
    flex-shrink: 0;
}
.ad-card__desc {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ad-card__category,
.ad-card__time {
    margin: 0;
}
.ad-card__actions {
    display: flex;
    gap: 8px;
    padding: 0 12px 12px;
    margin-top: auto;
}
.ad-card__actions .btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 700;
    border-radius: 8px;
    min-height: 38px;
}
.ad-card__btn-chat {
    border-color: #c02130;
    color: #c02130;
}
.ad-card__btn-chat:hover {
    background: #c02130;
    color: #fff;
}

/* Unified store card (grid listings) */
.store-card {
    border: 1px solid #e8edf3;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.store-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.store-card__banner {
    height: 150px;
    background-size: cover;
    background-position: center;
    border-radius: 12px 12px 0 0;
}
.store-card__banner--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
}
.store-card__logo-wrap {
    position: relative;
}
.store-card__logo {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}
.store-card__logo-img,
.store-card__logo-fallback {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #fff;
    object-fit: cover;
}
.store-card__logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}
.store-card__body {
    padding-top: 2.5rem !important;
}
.store-card__title a:hover {
    color: #c02130 !important;
}
.store-card__desc {
    margin-top: 0.5rem;
    margin-bottom: 0;
}
.store-card__stats {
    margin: 1rem 0;
}
.store-card__stat--border {
    border-inline-end: 1px solid #e8edf3;
}
.store-card__meta {
    margin-bottom: 0.5rem;
}
.store-card__meta:last-of-type {
    margin-bottom: 1rem;
}
.store-card__cta .btn {
    font-weight: 700;
    border-radius: 8px;
}

/* Profile avatar picker (camera + modal) */
.profile-avatar-picker__wrap { line-height: 0; }
.profile-avatar-picker__img,
.profile-avatar-picker__placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-avatar-picker__trigger {
    cursor: pointer;
    display: block;
}
.profile-avatar-picker__trigger:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 3px;
}
.profile-avatar-picker__camera {
    position: absolute;
    bottom: 0;
    inset-inline-end: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 3px solid #fff;
    z-index: 2;
}
.profile-avatar-picker__modal-preview {
    width: 200px;
    height: 200px;
}
.profile-avatar-picker__modal-preview img,
.profile-avatar-picker__modal-placeholder {
    width: 200px;
    height: 200px;
    object-fit: cover;
}
#profileAvatarSaveBtn:disabled { opacity: 0.55; }

/* Customer portal sidebar (profile, ads, notifications, …) */
:root {
    --customer-sidebar-width: 280px;
    --marketplace-header-height: 120px;
}

.customer-sidebar {
    position: fixed;
    top: var(--marketplace-header-height, 120px);
    inset-inline-start: 0;
    width: var(--customer-sidebar-width);
    height: calc(100vh - var(--marketplace-header-height, 120px));
    height: calc(100dvh - var(--marketplace-header-height, 120px));
    background: #fff;
    border-inline-end: 1px solid #e0e0e0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1020;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 12px rgba(15, 23, 42, 0.04);
}

[dir="rtl"] .customer-sidebar {
    box-shadow: 2px 0 12px rgba(15, 23, 42, 0.04);
}

.customer-sidebar .sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 12px 20px;
    color: #333;
    font-size: 15px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    border-inline-start: 3px solid transparent;
}

.customer-sidebar .sidebar-nav .nav-link:hover {
    background: #f8f9fa;
    color: #667eea;
}

.customer-sidebar .sidebar-nav .nav-link.active {
    background: #f0f4ff;
    color: #667eea;
    font-weight: 600;
    border-inline-start-color: #667eea;
}

.customer-sidebar .sidebar-nav .nav-link i {
    width: 24px;
    margin-inline-end: 12px;
    font-size: 18px;
    flex-shrink: 0;
    text-align: center;
}

.customer-sidebar .sidebar-nav .nav-link .badge {
    font-size: 11px;
    padding: 4px 8px;
    margin-inline-start: auto;
}

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    inset-inline: 0;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1025;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-items {
    display: flex;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 4px;
    gap: 0;
    /* Center items when they fit, scroll when they don't */
    justify-content: safe center;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.bottom-nav-items::-webkit-scrollbar {
    display: none;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    color: #666;
    text-decoration: none;
    transition: color 0.2s, transform 0.15s;
    flex: 0 0 auto;       /* don't shrink, fixed width */
    min-width: 64px;
    position: relative;
}

.bottom-nav-item i {
    font-size: 20px;
    margin-bottom: 3px;
}

.bottom-nav-label {
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.bottom-nav-item.active {
    color: #667eea;
}

/* Active indicator dot on top */
.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: #667eea;
    border-radius: 0 0 4px 4px;
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

.bottom-nav-badge {
    position: absolute;
    top: 0;
    inset-inline-end: 50%;
    transform: translateX(12px);
}

[dir="rtl"] .bottom-nav-badge {
    transform: translateX(-12px);
}

@media (min-width: 992px) {
    .customer-content-wrapper {
        margin-inline-start: var(--customer-sidebar-width);
        min-height: calc(100vh - var(--marketplace-header-height, 120px));
    }
}

@media (max-width: 991.98px) {
    body:has(.mobile-bottom-nav) {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
}

/* Home hero banner — full image, no crop */
.home-hero-banner__slide {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-color: #f8f9fa;
    line-height: 0;
}
.home-hero-banner__slide a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.home-hero-banner__slide img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 220px;
    object-fit: contain;
}
/* Mobile: scale by width so wide banners show in full (no side crop) */
@media (max-width: 767.98px) {
    .home-hero-banner__slide img {
        width: 100%;
        max-width: 100%;
        max-height: none;
        height: auto;
        object-fit: contain;
    }
}
.home-hero-banner .carousel-control-prev,
.home-hero-banner .carousel-control-next {
    width: 2.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.home-hero-banner:hover .carousel-control-prev,
.home-hero-banner:hover .carousel-control-next {
    opacity: 1;
}
