/* Manage Mobiles Central Marketplace - Premium Mobile-First CSS */

:root {
    --primary: #0071e3;
    --primary-hover: #005bb5;
    --primary-gradient: linear-gradient(135deg, #0071e3 0%, #358bfa 100%);
    --wa-green: #25D366;
    --wa-green-dark: #1da851;
    --bg-page: #f5f5f7;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --border-color: #e5e5ea;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-muted: #86868b;
    --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    --card-hover-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-page: #0f1115;
    --bg-card: #191c23;
    --bg-glass: rgba(25, 28, 35, 0.85);
    --border-color: #2a2e38;
    --text-primary: #f0f2f5;
    --text-secondary: #a0a5b1;
    --text-muted: #717784;
    --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    --card-hover-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

a {
    text-decoration: none !important;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    padding-bottom: 60px !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 16px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo, 
.brand-logo:hover, 
.brand-logo:focus, 
.brand-logo:visited, 
.brand-logo:active, 
.brand-logo *, 
.brand-title, 
.brand-badge {
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: pointer;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #0071e3, #9b51e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.1;
}

.brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-primary);
    transition: transform var(--transition-fast);
}

.icon-btn:active {
    transform: scale(0.92);
}

.seller-btn {
    background: rgba(0, 113, 227, 0.1);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: background 0.2s ease;
}

.seller-btn:hover {
    background: rgba(0, 113, 227, 0.2);
}

/* Layout Container */
.main-layout {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* Hero Section */
.hero-banner {
    position: relative;
    text-align: center;
    padding: 24px 16px 16px;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 150px;
    background: radial-gradient(circle, rgba(0, 113, 227, 0.25) 0%, rgba(0, 113, 227, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.hero-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: rgba(0, 113, 227, 0.1);
    color: var(--primary);
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.gradient-text {
    background: linear-gradient(135deg, #0071e3 0%, #9b51e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 20px;
    position: relative;
    z-index: 1;
}

/* Search Box */
.search-box-wrapper {
    max-width: 540px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.search-input-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 6px 14px;
    box-shadow: var(--card-shadow);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

.search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
    margin-right: 10px;
}

.search-input-box input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
    padding: 8px 0;
}

.clear-btn {
    background: var(--border-color);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Stories / Shops Carousel */
.shops-stories-container {
    margin: 20px 0;
}

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

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.section-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
}

.stories-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none; /* Firefox */
}

.stories-scroll::-webkit-scrollbar {
    display: none;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex-shrink: 0;
    width: 72px;
    text-align: center;
}

.story-avatar-wrapper {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #0071e3, #25D366);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.story-item:hover .story-avatar-wrapper,
.story-item.active .story-avatar-wrapper {
    transform: scale(1.08);
}

.story-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-card);
    background: #fff;
}

.story-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Filters */
.filters-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.chip-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.chip-scroll::-webkit-scrollbar {
    display: none;
}

.chip {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chip.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.chip-sub {
    font-size: 0.78rem;
    padding: 6px 12px;
}

.chip-sub.active {
    background: var(--text-primary);
    color: var(--bg-card);
    border-color: var(--text-primary);
    box-shadow: none;
}

/* Results Bar */
.results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.results-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.sort-wrapper select {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
}

/* Phone Cards Grid */
.phone-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 18px;
}

@media (min-width: 580px) {
    .phone-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
    .phone-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1200px) {
    .phone-grid { grid-template-columns: repeat(4, 1fr); }
}

.phone-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    padding: 14px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.phone-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-hover-shadow);
}

.card-media {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #ffffff;
}

.carousel-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.phone-card:hover .carousel-img {
    transform: scale(1.04);
}

.card-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    z-index: 2;
}

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

.phone-model {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 6px;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.sell-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
}

.specs-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.spec-badge {
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.remarks-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Shop Info Footer in Card */
.card-shop-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
    margin-top: auto;
    margin-bottom: 12px;
}

.shop-mini-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.shop-mini-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.shop-mini-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-mini-addr {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action CTA Buttons */
.card-actions {
    display: flex;
    gap: 8px;
}

.btn-wa {
    flex: 1;
    background: var(--wa-green);
    color: #ffffff;
    border: none;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s ease, transform var(--transition-fast);
    text-decoration: none;
}

.btn-wa:hover {
    background: var(--wa-green-dark);
}

.btn-wa:active {
    transform: scale(0.97);
}

.btn-secondary-action {
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-secondary-action:hover {
    background: var(--border-color);
}

/* Skeletons */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--border-color) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-card {
    height: 380px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.open {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    position: relative;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.modal-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--bg-page);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-primary);
    z-index: 10;
}

/* Sticky Bottom Floating Bar */
.sticky-bottom-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--border-color);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1500;
}

/* Fixed App Footer - Attached directly to bottom of display screen */
.app-footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 10px 16px !important;
    text-align: center;
    z-index: 2000 !important;
}

.footer-text {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 1100px;
    margin: 0 auto;
}

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






/* T&C Modal Custom Styles */
.tc-modal-content {
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.tc-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 6px;
    padding-right: 30px;
}

.tc-effective {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.tc-body {
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    padding-right: 6px;
    margin-bottom: 20px;
}

.tc-body h4 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 14px 0 4px;
}

.tc-body p {
    margin-bottom: 10px;
}

.sticky-info {
    display: flex;
    flex-direction: column;
}

.sticky-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sticky-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.sticky-wa-btn {
    background: var(--wa-green);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
