:root {
    --bg-paper: #f0f2f5;
    --bg-surface: #ffffff;
    --text-main: #1a1a1a;
    --text-muted: #666666;
    
    --stroke-width: 3px;
    --stroke-color: #000000;
    
    --shadow-depth: 6px;
    --shadow-hover: 3px;
    --shadow-active: 0px;
    
    --accent-primary: #5c7cfa;
    --accent-secondary: #ff922b;
    --accent-success: #51cf66;
    --accent-danger: #ff6b6b;
    --accent-sponsor: #ffd43b;

    --font-heading: 'Space Grotesk', 'Courier New', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    --radius-sm: 4px;
    --radius-md: 12px;
    
    --ease-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-snap: cubic-bezier(0.25, 1, 0.5, 1);
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-paper); border-left: 2px solid #000; }
::-webkit-scrollbar-thumb { background: var(--accent-primary); border: 2px solid #000; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #000; }

body {
    cursor: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 4l14 10l-6.5 2.5L18 26l-4 2l-3-10L6 24V4z' fill='%23000000' stroke='%23ffffff' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E"), auto;
}

*, *::before, *::after {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    height: 100%;
}

body {
    background-color: var(--bg-paper);
    background-image: radial-gradient(var(--text-muted) 1px, transparent 1px);
    background-size: 24px 24px;
    color: var(--text-main);
    font-family: var(--font-body);
    margin: 0;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation; /* Remove 300ms tap delay */
}

img, video {
    max-width: 100%;
    display: block;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    font-weight: 800;
    margin-top: 0;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.button-primary, .button-secondary, .button-advertise {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    border: var(--stroke-width) solid var(--stroke-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.1s var(--ease-snap);
    position: relative;
    user-select: none;
    background-color: var(--bg-surface);
    color: var(--text-main);
    box-shadow: var(--shadow-depth) var(--shadow-depth) 0px var(--stroke-color);
    transform: translate(-2px, -2px);
    touch-action: manipulation; /* Remove 300ms tap delay */
}

.button-primary { background-color: var(--accent-primary); color: #fff; }
.button-advertise { background-color: var(--accent-success); color: var(--text-main); }
.button-secondary { background-color: var(--bg-surface); }

.button-primary:hover, .button-secondary:hover, .button-advertise:hover {
    transform: translate(-1px, -1px);
    box-shadow: var(--shadow-hover) var(--shadow-hover) 0px var(--stroke-color);
}

.button-primary:active, .button-secondary:active, .button-advertise:active {
    transform: translate(0px, 0px);
    box-shadow: var(--shadow-active) var(--shadow-active) 0px var(--stroke-color);
}

.button-primary:disabled, .button-secondary:disabled, .button-advertise:disabled {
    background-color: #ccc;
    color: #666;
    border-color: #999;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}

/* Z-Index: Header 1000 */
.site-header {
    background: var(--bg-surface);
    border-bottom: var(--stroke-width) solid var(--stroke-color);
    padding: 1rem 0;
    position: static;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 5%;
    padding-right: 5%;
}

.logo-container .logo {
    height: 120px;
    filter: drop-shadow(2px 2px 0px rgba(0,0,0,0.2));
}

.advertise-bar { display: none; }

@media(max-width: 768px) {
    .site-header { flex-direction: column; gap: 1rem; }
}

.main-content {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.search-container {
    display: flex;
    max-width: 700px;
    margin: 2rem auto;
    position: relative;
}

/* Prevent iOS Zoom on focus */
input[type="text"], input[type="email"], input[type="password"], 
input[type="number"], input[type="tel"], input[type="search"], 
select, textarea {
    width: 100%;
    padding: 14px;
    font-family: var(--font-body);
    font-size: 16px; /* iOS safe size */
    border: var(--stroke-width) solid var(--stroke-color);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    outline: none;
    transition: box-shadow 0.2s;
    appearance: none; /* Remove default styling */
}

input:focus, select:focus, textarea:focus {
    box-shadow: 4px 4px 0px var(--accent-primary);
}

.listings-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.regular-listings-grid, .sponsored-listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.listing-card {
    background: var(--bg-surface);
    border: var(--stroke-width) solid var(--stroke-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    transition: transform 0.2s var(--ease-snap), box-shadow 0.2s var(--ease-snap);
    box-shadow: var(--shadow-depth) var(--shadow-depth) 0px var(--stroke-color);
}

.listing-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0px var(--stroke-color);
}

.listing-image-container {
    height: 220px;
    border-bottom: var(--stroke-width) solid var(--stroke-color);
    background: #000;
    position: relative;
}

.listing-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sponsored-card {
    border-color: var(--accent-sponsor);
    box-shadow: var(--shadow-depth) var(--shadow-depth) 0px var(--accent-sponsor);
}

.sponsored-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent-sponsor);
    color: var(--text-main);
    font-weight: 800;
    padding: 4px 8px;
    border: 2px solid var(--stroke-color);
    text-transform: uppercase;
    font-size: 0.8rem;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.5);
    z-index: 10;
}

.listing-details { padding: 1.5rem; }

.listing-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin: 0.5rem 0;
}

.listing-specs {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    border-top: 1px solid #eee;
    padding-top: 1rem;
    margin-top: 1rem;
}

.site-footer {
    background: var(--bg-surface);
    border-top: var(--stroke-width) solid var(--stroke-color);
    padding: 4rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    border-bottom: 2px solid var(--accent-secondary);
    display: inline-block;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.footer-links a {
    display: block;
    margin-bottom: 0.5rem;
    transition: padding-left 0.2s;
}

.footer-links a:hover {
    padding-left: 8px;
    color: var(--accent-primary);
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px dashed var(--text-muted);
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Z-Index: Modal 2000 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-surface);
    border: var(--stroke-width) solid var(--stroke-color);
    box-shadow: 10px 10px 0px #000;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

#install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface);
    border: var(--stroke-width) solid var(--stroke-color);
    padding: 1rem;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-depth) var(--shadow-depth) 0px var(--accent-success);
}

.skeleton {
    background: #e0e0e0;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.ad-page-layout-single-column {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .ad-page-layout-single-column { grid-template-columns: 1fr; }
}

.detail-box {
    background: var(--bg-surface);
    border: var(--stroke-width) solid var(--stroke-color);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: var(--radius-md);
    box-shadow: 4px 4px 0px rgba(0,0,0,0.1);
}

.price-box {
    text-align: center;
    border-color: var(--accent-primary);
    background: #f8faff;
}

.ad-price {
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -1px;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: bold;
    border: 2px solid #000;
    text-transform: uppercase;
}
.status-active { background: var(--accent-success); color: #fff; }
.status-pending-payment { background: var(--accent-secondary); color: #fff; }
.status-offline { background: #ccc; color: #000; }