@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #10b981;
    --primary-dark: #065f46;
    --primary-light: #ecfdf5;
    --secondary: #f59e0b;
    --secondary-light: #fffbeb;
    --accent: #3b82f6;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-dark: #0f172a;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-white: #ffffff;
    --border: #f1f5f9;
    --border-dark: #cbd5e1;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --font-main: 'Plus Jakarta Sans', sans-serif;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 40px rgba(16, 185, 129, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: #0f172a;
    /* Slate 900 background for desktop contrast */
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* CRITICAL: Align to top to prevent top gap and bottom cutoff on mobile */
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* Mobile Container Wrapper */
.app-container {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    height: 100dvh;
    /* Fixes mobile browser address bar overlap */
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--bg-main);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

/* Hide scrollbar for Chrome, Safari and Opera */
.app-container::-webkit-scrollbar,
.scroll-x::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.app-container,
.scroll-x {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* Typography & Utilities */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--text-main);
}

p {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.text-primary {
    color: var(--primary);
}

.text-secondary {
    color: var(--secondary);
}

.text-muted {
    color: var(--text-muted);
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.font-extrabold {
    font-weight: 800;
}

/* Custom Horizontal Scroll */
.scroll-x {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding: 4px 20px 16px 20px;
    margin: 0 -20px;
}

.scroll-x>* {
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* Header Component */
.app-header {
    background-color: var(--bg-card);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #059669);
    color: var(--text-white);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.logo-text {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--bg-dark);
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--primary);
}

.header-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.btn-icon:active {
    transform: scale(0.95);
    background-color: var(--border);
}

.btn-icon .badge-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 1.5px solid var(--bg-card);
}

/* Location and Search Bar */
.location-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.location-selector i {
    color: var(--primary);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 46px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
    background-color: var(--bg-main);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.search-box i.search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}

.search-box .btn-filter {
    position: absolute;
    right: 8px;
    height: 34px;
    width: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #059669);
    color: var(--text-white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
    transition: var(--transition);
}

.search-box .btn-filter:active {
    transform: scale(0.9);
}

/* Hero Promo Banner */
.hero-banner {
    position: relative;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 20px;
    color: var(--text-white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
    margin: 16px 20px;
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
    /* CRITICAL: Prevents flex container from squishing the banner height */
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.hero-content {
    z-index: 1;
    max-width: 60%;
    color: var(--text-white);
}

.hero-title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 6px;
    color: var(--text-white);
}

.hero-desc {
    font-size: 0.8rem;
    color: var(--text-white);
    /* Explicit white color to prevent global p styling overrides */
    opacity: 0.9;
    margin-bottom: 12px;
}

.btn-hero {
    background-color: var(--secondary);
    color: var(--bg-dark);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    transition: var(--transition);
}

.btn-hero:active {
    transform: translateY(1px);
}

.hero-image-container {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.hero-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.15));
}

/* Category Slider */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    margin-top: 8px;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--bg-dark);
}

.section-link {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.category-card {
    background-color: var(--bg-card);
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    height: 34px;
    box-shadow: var(--shadow-sm);
}

/* Similar Ads Card */
.similar-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
    display: flex;
    flex-direction: column;
    width: 140px;
    text-align: left;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.similar-card:active {
    transform: scale(0.97);
}

.category-card:active,
.category-card.active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: var(--text-white) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.category-icon {
    width: auto;
    height: auto;
    border-radius: 0;
    background-color: transparent !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.category-icon svg {
    width: 15px !important;
    height: 15px !important;
    stroke-width: 2.2 !important;
}

.category-card.active .category-icon {
    color: var(--text-white) !important;
}

.category-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.1px;
    transition: var(--transition);
}

.category-card.active .category-name {
    color: var(--text-white) !important;
}

/* Grid & Cards - Ad Listing */
.listings-container {
    padding: 0 20px 120px 20px;
    /* Generous bottom space so last item clears the bottom nav completely */
}

.listing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 8px;
}

.listing-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--transition);
    text-decoration: none;
}

.listing-card:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-dark);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    background-color: #e2e8f0;
}

.card-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.listing-card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

.btn-favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.btn-favorite:active {
    transform: scale(0.9);
}

.btn-favorite.active {
    color: #ef4444;
    background-color: #ffffff;
}

.badge-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-white);
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.badge-overlay.premium {
    background: linear-gradient(135deg, var(--secondary), #d97706);
}

.badge-overlay.verified {
    background: linear-gradient(135deg, var(--primary), #059669);
}

.card-details {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 38px;
}

.card-price {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: auto;
}

.card-footer span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Sticky Bottom Navigation */
.bottom-nav {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    min-height: 76px;
    background-color: var(--bg-card);
    border-top: 1.5px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 10px calc(18px + env(safe-area-inset-bottom)) 10px;
    /* Safe-area padding for Android and iOS systems */
    z-index: 1000;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.05);
    margin-top: auto;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    flex: 1;
}

.nav-item i {
    font-size: 1.25rem;
    transition: var(--transition);
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    transform: translateY(-2px);
}

/* FAB (Floating Action Button) Post Ad */
.nav-item-post {
    position: relative;
    top: -16px;
    flex: 0 0 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #059669);
    color: var(--text-white) !important;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    border: 4px solid var(--bg-main);
}

.nav-item-post:active {
    transform: scale(0.9) translateY(-14px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

/* Detail Page Carousel & Detail Specifics */
.detail-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent);
}

.btn-overlay {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
    text-decoration: none;
}

.btn-overlay:active {
    transform: scale(0.9);
}

.gallery-container {
    position: relative;
    width: 100%;
    padding-top: 80%;
    /* Width-to-Height Ratio */
    background-color: var(--bg-dark);
}

.gallery-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.gallery-slide {
    min-width: 100%;
    height: 100%;
    scroll-snap-align: start;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-indicators {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 6px 12px;
    border-radius: var(--radius-full);
}

.indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    transition: var(--transition);
}

.indicator.active {
    background-color: var(--text-white);
    width: 16px;
    border-radius: var(--radius-full);
}

.detail-body {
    background-color: var(--bg-main);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: -24px;
    position: relative;
    z-index: 5;
    padding: 24px 20px 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.seller-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-card);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.seller-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seller-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.seller-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
}

.seller-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.seller-status i {
    color: var(--primary);
}

.btn-seller-profile {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background-color: var(--primary-light);
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-seller-profile:active {
    opacity: 0.8;
}

.detail-title-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-price-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.detail-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.detail-title {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.4;
    color: var(--bg-dark);
}

.detail-meta {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.detail-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Attributes Grid */
.attributes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.attribute-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
}

.attribute-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.attribute-details {
    display: flex;
    flex-direction: column;
}

.attribute-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 500;
}

.attribute-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 2px;
}

/* Custom Interactive Audio Player */
.audio-player {
    background: linear-gradient(135deg, #10b981, #047857);
    border-radius: var(--radius-md);
    padding: 16px;
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-lg);
}

.audio-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.audio-title {
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-play {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--text-white);
    color: var(--primary-dark);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.btn-play:active {
    transform: scale(0.9);
}

.progress-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background-color: var(--text-white);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.progress-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    opacity: 0.9;
}

/* Map Preview Card */
.map-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

.map-preview {
    height: 120px;
    width: 100%;
    background-color: #cbd5e1;
    background-image: radial-gradient(var(--text-muted) 0.5px, transparent 0.5px), radial-gradient(var(--text-muted) 0.5px, #e2e8f0 0.5px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    position: relative;
}

.map-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #ef4444;
}

.map-pin i {
    font-size: 2rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.map-pin-pulse {
    position: absolute;
    top: 25px;
    width: 16px;
    height: 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    z-index: -1;
}

.map-details {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map-address {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
}

.map-sub-address {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Floating WhatsApp Button */
.floating-whatsapp-btn {
    position: sticky;
    bottom: 24px;
    align-self: flex-end;
    margin-right: 20px;
    margin-top: -60px;
    /* pull up so it floats over container content */
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
    z-index: 1000;
    transition: var(--transition);
    text-decoration: none;
    border: none;
    cursor: pointer;
    animation: whatsapp-pulse 2s infinite;
    flex-shrink: 0;
    aspect-ratio: 1;
}

.floating-whatsapp-btn:active {
    transform: scale(0.9) translateY(2px);
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.2);
}

.floating-whatsapp-btn i {
    font-size: 1.75rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Filter Slide-up Drawer */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 100vh;
    height: 100dvh;
    /* CRITICAL: Ensures the drawer overlay matches the visible mobile screen, preventing it from sinking below the fold */
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.drawer-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom)) 20px;
    /* Protects bottom elements from system navigation gesture pills */
    z-index: 2001;
    transform: translateY(100%);
    transition: var(--transition);
    max-height: 85%;
    overflow-y: auto;
}

.drawer-overlay.active .drawer-content {
    transform: translateY(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.drawer-title {
    font-size: 1.1rem;
    font-weight: 800;
}

.btn-close-drawer {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--bg-dark);
    margin-bottom: 10px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-main);
    border: 1.5px solid var(--border);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.filter-chip.active {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.price-input-wrapper {
    flex: 1;
    position: relative;
}

.price-input-wrapper span {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.price-field {
    width: 100%;
    padding: 10px 10px 10px 36px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.price-field:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-apply-filters {
    width: 100%;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), #059669);
    color: var(--text-white);
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    margin-top: 10px;
    transition: var(--transition);
}

.btn-apply-filters:active {
    transform: translateY(1px);
}

/* Tab Switching or Page transitions */
.hidden {
    display: none !important;
}

/* Premium Section Divider */
.section-divider {
    border: none;
    height: 1px;
    background-color: var(--border);
    margin: 8px 0;
    opacity: 0.6;
}

/* Prestasi/Achievements Section */
.prestasi-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prestasi-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.prestasi-item:hover {
    border-color: var(--secondary);
    background-color: rgba(245, 158, 11, 0.03);
    /* Amber gold light highlight */
}

.prestasi-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(245, 158, 11, 0.15);
    /* Amber light gold */
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    aspect-ratio: 1;
}

.prestasi-badge.juara-1 {
    background: linear-gradient(135deg, var(--secondary), #d97706);
    color: var(--text-white);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
}

.prestasi-badge i {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.prestasi-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.prestasi-juara {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--secondary-dark);
}

.prestasi-event {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 1px;
}

.prestasi-kelas {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1px;
}

/* Minimalist Tabs Layout (Borderless) */
.detail-tabs-container {
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.detail-tabs-header {
    display: flex;
    border-bottom: 2px solid var(--border);
    background-color: transparent;
    border-radius: 0;
    padding: 0;
    gap: 16px;
    margin-bottom: 16px;
}

.detail-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    background: transparent;
    padding: 12px 4px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    /* overlaps and sits on border-bottom */
}

.detail-tab-btn i {
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.detail-tab-btn.active {
    background-color: transparent;
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
    box-shadow: none;
}

.detail-tab-content {
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   AUCTION (LELANG) CUSTOM PREMIUM STYLES
   ========================================================================== */

/* Timer Overlay on lelang-index Cards */
.countdown-overlay {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background-color: rgba(31, 41, 55, 0.88);
    color: var(--text-white);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(4px);
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timer-dot {
    width: 6px;
    height: 6px;
    background-color: var(--secondary);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px var(--secondary);
    animation: heartBeat 1.5s infinite;
}

/* Lelang Countdown Card on Detail Page */
.lelang-countdown-box {
    background: linear-gradient(135deg, #1f2937, #111827);
    border: 1.5px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-white);
    text-align: center;
}

.countdown-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
}

.pulse-orange-dot {
    width: 6px;
    height: 6px;
    background-color: var(--secondary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--secondary);
    animation: heartBeat 1.5s infinite;
    display: inline-block;
}

.countdown-timer-text {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--secondary);
    text-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
    font-family: monospace;
    letter-spacing: 0.5px;
}

/* Bid History Segmented Page */
.bid-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 2px 0;
}

.bid-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    transition: var(--transition);
}

.bid-history-item.top-bid {
    border-color: var(--secondary);
    background-color: rgba(245, 158, 11, 0.04);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.08);
}

.bidder-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-main);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.top-bid .bidder-avatar {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--secondary);
}

.bidder-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bidder-name {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-bid-badge {
    font-size: 0.62rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--secondary), #d97706);
    color: var(--text-white);
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.bid-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.bid-amount {
    font-size: 0.9rem;
    font-weight: 850;
    color: var(--text-main);
}

.top-bid .bid-amount {
    color: var(--secondary-dark);
}

/* Lelang Sticky Action Footer */
.lelang-action-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border-top: 1.5px solid var(--border);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 100;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

.lelang-footer-price {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--secondary-dark);
    margin-top: 2px;
}

.btn-ajukan-bid {
    flex-grow: 1;
    background: linear-gradient(135deg, var(--secondary), #d97706);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 18px;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
    transition: var(--transition);
}

.btn-ajukan-bid:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2);
}

/* Bidding Drawer Inner Calculator */
.bid-calc-box {
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-top: 12px;
}

.bid-increments-row {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.btn-increment-chip {
    flex: 1;
    border: 1px solid var(--border);
    background-color: var(--bg-card);
    color: var(--text-main);
    padding: 10px;
    font-size: 0.78rem;
    font-weight: 800;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-increment-chip.active {
    background-color: var(--secondary);
    border-color: var(--secondary);
    color: var(--text-white);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
}

.custom-bid-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid var(--border);
    background-color: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-top: 6px;
}

.custom-bid-input-row span {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-muted);
}

.custom-bid-input-row input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
    font-weight: 850;
    color: var(--text-main);
}

.bid-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.bid-summary-row strong {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--secondary-dark);
}

.btn-konfirmasi-bid {
    width: 100%;
    background: linear-gradient(135deg, var(--secondary), #d97706);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    padding: 14px;
    font-size: 0.95rem;
    font-weight: 800;
    margin-top: 16px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
    transition: var(--transition);
}

.btn-konfirmasi-bid:active {
    transform: translateY(1px);
}

/* Success Pop-up Overlay (Confetti Modal) */
.success-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(4px);
    animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.success-popup-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 320px;
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9) translateY(20px);
    animation: cardSlideUp 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes cardSlideUp {
    to {
        transform: scale(1) translateY(0);
    }
}

.success-icon-container {
    width: 58px;
    height: 58px;
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 14px auto;
}

.btn-success-close {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
    transition: var(--transition);
}

.btn-success-close:active {
    transform: translateY(1px);
}

/* Stepper Stepping active click zoom */
.btn-bid-step:active:not([style*="not-allowed"]) {
    transform: scale(0.9);
}

/* Clickable Bid Badge scaling zoom */
.detail-meta span.text-primary:active {
    transform: scale(0.94);
    opacity: 0.85;
}

/* Disable scroll on body when drawers are open */
body.no-scroll {
    overflow: hidden !important;
    height: 100vh !important;
    height: 100dvh !important;
}

/* Prevent scroll chaining on overlays and scroll areas */
.drawer-content,
.drawer-overlay,
.bid-history-list {
    overscroll-behavior: contain !important;
}

/* Buy it now button click active state */
.btn-buy-now:active {
    transform: scale(0.95) !important;
    opacity: 0.9;
}

/* Category Selection Drawer Grid Styles */
.category-drawer-item {
    background-color: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.category-drawer-item:active {
    transform: scale(0.95);
}

.category-drawer-item.active {
    background: var(--primary-light);
    border-color: var(--primary);
}

.category-drawer-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.category-drawer-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.2 !important;
}

.category-drawer-item.active .category-drawer-icon {
    background-color: var(--primary);
    color: var(--text-white);
}

.category-drawer-name {
    font-size: 0.82rem;
    font-weight: 750;
    color: var(--text-main);
}

.category-drawer-item.active .category-drawer-name {
    color: var(--primary-dark);
}

/* Support Amber Theme Category Drawer inside lelang page */
.app-container:has(.nav-item.active[href="auction-index.html"]) .category-drawer-item.active {
    background: rgba(245, 158, 11, 0.08) !important;
    border-color: var(--secondary) !important;
}

.app-container:has(.nav-item.active[href="auction-index.html"]) .category-drawer-item.active .category-drawer-icon {
    background-color: var(--secondary) !important;
    color: var(--text-white) !important;
}

.app-container:has(.nav-item.active[href="auction-index.html"]) .category-drawer-item.active .category-drawer-name {
    color: var(--secondary-dark) !important;
}