:root {
    --black: #111;
    --white: #fff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-400: #9ca3af;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --accent: #111;
    --radius: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,.08);
    --container: 1200px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--gray-900);
    background: var(--white);
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0.85rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.logo {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.logo span { font-weight: 400; color: var(--gray-600); }
.nav-links { display: flex; align-items: center; gap: 1.25rem; font-size: 0.9rem; }
.nav-links a:hover { opacity: 0.85; }
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.25rem;
}
.nav-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    color: var(--gray-900);
    transition: background .15s;
}
.nav-icon:hover { background: var(--gray-100); opacity: 1; }
.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    margin-left: 0.15rem;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.35rem;
    background: var(--black);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}
.btn:hover { opacity: 0.85; color: var(--white); }
.btn-outline {
    background: transparent;
    color: var(--black);
    border: 1px solid var(--gray-800);
}
.btn-outline:hover { background: var(--gray-100); color: var(--black); }

/* Hero — Pixabay-style homepage banner */
.home-hero-wrap {
    padding: 0 1.25rem 1.5rem;
    max-width: var(--container);
    margin: 0 auto;
}
.hero-banner {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    background: #1a2f3a;
}
.hero-slides {
    position: absolute;
    inset: 0;
}
.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease;
}
.hero-slide.active { opacity: 1; }
.hero-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.35) 0%, rgba(0,0,0,.55) 100%);
}
.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 820px;
    padding: 3rem 1.5rem 5rem;
    text-align: center;
}
.hero-content h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.35rem);
    font-weight: 700;
    margin: 0 0 1.5rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}
.hero-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
}
.hero-tabs a {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255,255,255,.85);
    transition: background .2s, color .2s;
}
.hero-tabs a:hover { color: var(--white); background: rgba(255,255,255,.12); }
.hero-tabs a.active {
    background: var(--white);
    color: var(--gray-900);
}
.hero-search-pill {
    display: flex;
    align-items: center;
    max-width: 680px;
    margin: 0 auto 1.25rem;
    background: rgba(255,255,255,.18);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 999px;
    padding: 0.35rem 0.35rem 0.35rem 1.25rem;
    transition: background .2s;
}
.hero-search-pill:focus-within {
    background: rgba(255,255,255,.28);
    border-color: rgba(255,255,255,.4);
}
.hero-search-pill svg {
    flex-shrink: 0;
    opacity: 0.9;
}
.hero-search-pill input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--white);
    font-size: 0.95rem;
    padding: 0.85rem 0.75rem;
    outline: none;
    min-width: 0;
}
.hero-search-pill input::placeholder { color: rgba(255,255,255,.75); }
.hero-search-pill button {
    border: none;
    background: transparent;
    color: var(--white);
    padding: 0.6rem 1rem;
    cursor: pointer;
    border-radius: 999px;
}
.hero-search-pill button:hover { background: rgba(255,255,255,.15); }
.hero-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    max-width: 720px;
    margin: 0 auto;
}
.hero-tags-label {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-right: 0.25rem;
}
.hero-tag {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.2);
    color: var(--white);
    transition: background .2s;
}
.hero-tag:hover { background: rgba(255,255,255,.28); }
.hero-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,.9);
    gap: 1rem;
    flex-wrap: wrap;
}
.hero-credit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.hero-credit-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.5);
}
.hero-credit a { text-decoration: underline; opacity: 0.95; }
.hero-credit a:hover { opacity: 1; }
.hero-dots {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}
.hero-dot {
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,.35);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background .2s;
}
.hero-dot.active { background: var(--white); }
.hero-license { opacity: 0.85; white-space: nowrap; }
.hero-license a { text-decoration: underline; }

@media (max-width: 640px) {
    .hero-banner { min-height: 480px; border-radius: 14px; }
    .hero-content { padding-bottom: 6rem; }
    .hero-bottom { flex-direction: column; align-items: flex-start; }
    .hero-dots { order: -1; align-self: center; }
}

/* Browse / category listing (no hero) */
.browse-page { padding-top: 1.5rem; }
.browse-header { padding: 0 0 1.5rem; }
.browse-header h1 { margin: 0 0 0.35rem; font-size: 1.75rem; }
.browse-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
    max-width: 720px;
}
.browse-toolbar select,
.browse-toolbar input {
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
    background: var(--white);
    margin: 0;
}
.browse-toolbar select { min-width: 160px; }
.browse-toolbar input { flex: 1; min-width: 200px; }
.browse-toolbar .btn { padding: 0.65rem 1.25rem; }

/* Legacy hero for browse/category pages */
.hero {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    background-color: #2d4a3e;
    padding: 3rem 1.25rem;
}
.hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    max-width: 720px;
    margin: 0 auto 0.75rem;
    line-height: 1.25;
}
.hero .subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}
.hero-search {
    display: flex;
    max-width: 640px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.hero-search select {
    border: none;
    border-right: 1px solid var(--gray-200);
    padding: 0 1rem;
    min-width: 140px;
    font-size: 0.9rem;
    background: var(--white);
    color: var(--gray-900);
}
.hero-search input {
    flex: 1;
    border: none;
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
    outline: none;
}
.hero-search button {
    border: none;
    background: var(--black);
    color: var(--white);
    padding: 0 1.5rem;
    font-weight: 600;
    cursor: pointer;
}
.hero-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    opacity: 0.85;
}

/* Category pills */
.category-pills {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
}
.category-pills .scroll {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    min-width: min-content;
    padding: 0.25rem 0;
}
.category-pill {
    text-align: center;
    flex-shrink: 0;
    width: 72px;
}
.category-pill .thumb {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 0.4rem;
    border: 2px solid var(--gray-200);
}
.category-pill .thumb.placeholder {
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.category-pill span {
    font-size: 0.7rem;
    color: var(--gray-600);
    display: block;
    line-height: 1.2;
}

/* Sections */
.section { padding: 3rem 0; }
.section-header { text-align: center; margin-bottom: 2rem; }
.section-header h2 { font-size: 1.75rem; margin: 0 0 0.35rem; }
.section-header p { color: var(--gray-600); margin: 0; font-size: 0.95rem; }
.section-cta { text-align: center; margin-top: 2rem; }

/* Browse categories */
.category-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
@media (max-width: 900px) {
    .category-columns { grid-template-columns: 1fr; }
}
.category-col h3 {
    font-size: 1.1rem;
    margin: 0 0 1rem;
    text-align: center;
}
.category-col .mosaic {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1;
}
.category-col .mosaic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.category-col .mosaic .single {
    grid-column: 1 / -1;
}
.keyword-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
}
.keyword-cloud a {
    font-size: 0.75rem;
    color: var(--gray-600);
    padding: 0.15rem 0.4rem;
}
.keyword-cloud a:hover { color: var(--black); text-decoration: underline; }

/* Image catalog cards (browse, home, related) */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.image-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .2s;
}
.image-card:hover { box-shadow: var(--shadow); }
.image-card-media {
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--gray-100);
}
.image-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.image-card:hover .image-card-media img { transform: scale(1.03); }
.image-card-body { padding: 1rem; }
.image-card-title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    line-height: 1.35;
}
.image-card-title a { color: var(--gray-900); }
.image-card-title a:hover { text-decoration: underline; }
.image-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}
.image-card-tag {
    font-size: 0.75rem;
    color: var(--gray-600);
    background: var(--gray-100);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}
.image-card-tag:hover { color: var(--black); background: var(--gray-200); }
.image-card-desc {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin: 0 0 0.35rem;
    line-height: 1.45;
}
.image-card-keywords {
    font-size: 0.78rem;
    margin: 0 0 0.35rem;
    line-height: 1.4;
}
.image-card-meta { font-size: 0.75rem; margin: 0; }

/* Image grid (compact thumbs) */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}
@media (max-width: 1100px) { .photo-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 700px) { .photo-grid { grid-template-columns: repeat(2, 1fr); } }
.photo-grid a {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
}
.photo-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.photo-grid a:hover img { transform: scale(1.05); }

/* Newsletter */
.newsletter {
    background: var(--gray-50);
    padding: 3rem 0;
}
.newsletter .inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}
@media (max-width: 768px) {
    .newsletter .inner { grid-template-columns: 1fr; }
}
.newsletter h2 { margin: 0 0 0.5rem; font-size: 1.5rem; }
.newsletter-form {
    display: flex;
    gap: 0.5rem;
}
.newsletter-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
}

/* Blog */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
@media (max-width: 900px) { .blog-grid { grid-template-columns: 1fr; } }
.blog-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}
.blog-card .blog-img {
    height: 180px;
    background: var(--gray-200);
}
.blog-card .blog-body { padding: 1.25rem; }
.blog-card h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.blog-card .date { font-size: 0.8rem; color: var(--gray-400); margin-bottom: 0.75rem; }
.blog-card .read-more { font-size: 0.85rem; font-weight: 600; text-decoration: underline; }

/* Footer */
.site-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 3rem 0 1.5rem;
    font-size: 0.85rem;
}
.site-footer .footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #374151;
}
.site-footer .footer-logo { color: var(--white); font-size: 1.25rem; font-weight: 700; }
.site-footer .social { display: flex; gap: 0.75rem; margin-top: 1rem; }
.site-footer .social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 0.75rem;
}
.footer-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}
@media (max-width: 900px) {
    .footer-columns { grid-template-columns: repeat(2, 1fr); }
}
.footer-columns h4 {
    color: var(--white);
    font-size: 0.9rem;
    margin: 0 0 1rem;
}
.footer-columns ul { list-style: none; padding: 0; margin: 0; }
.footer-columns li { margin-bottom: 0.4rem; }
.footer-columns a:hover { color: var(--white); }
.footer-bottom { text-align: center; margin-top: 2rem; padding-top: 1.5rem; font-size: 0.8rem; }

/* Browse / detail */
main.main-content { min-height: 50vh; }
.browse-header { padding: 2rem 0 1rem; }
.browse-header h1 { margin: 0 0 0.5rem; }
.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.9rem;
}
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    padding: 2rem 0;
}
@media (max-width: 900px) {
    .detail-layout { grid-template-columns: 1fr; }
}
.detail-preview img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.detail-sidebar {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.detail-sidebar .price { font-size: 1.75rem; font-weight: 700; margin: 0.5rem 0 1rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 1rem 0; }
.tag {
    background: var(--gray-100);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
}
.muted { color: var(--gray-600); font-size: 0.875rem; }
.pager { margin: 2rem 0; text-align: center; }
.pager a, .pager strong {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    margin: 0 0.15rem;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 0.85rem;
}
.detail-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.detail-actions form { margin: 0; }

/* Cart */
.cart-link { position: relative; }
.cart-badge {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--black);
    color: var(--white);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
.cart-table { border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; }
.cart-row {
    display: grid;
    grid-template-columns: 80px 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
}
.cart-row:last-child { border-bottom: none; }
.cart-thumb img { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; }
.cart-price { font-weight: 700; white-space: nowrap; }
.btn-remove {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--gray-400);
    padding: 0.25rem 0.5rem;
}
.btn-remove:hover { color: var(--black); }
.cart-summary {
    max-width: 320px;
    margin-left: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}
.payment-summary {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin: 1.5rem 0;
    background: var(--gray-50);
}
.payment-amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
}
.category-col h3 a { color: inherit; }
.category-col h3 a:hover { text-decoration: underline; }

@media (max-width: 600px) {
    .cart-row { grid-template-columns: 64px 1fr; }
    .cart-price, .btn-remove { grid-column: 2; }
}

/* Auth forms */
.auth-wrap {
    max-width: 420px;
    margin: 3rem auto;
    padding: 2rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}
.auth-wrap label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; font-weight: 500; }
.auth-wrap input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
