/* Wheel Gallery — Styles */

:root {
    --wg-primary: #0A0A0A;
    --wg-primary-light: #C9A84C;
    --wg-accent: #C9A84C;
    --wg-bg: #f5f5f5;
    --wg-card-bg: #ffffff;
    --wg-text: #1a1a1a;
    --wg-text-muted: #6b7280;
    --wg-border: #e5e7eb;
    --wg-radius: 12px;
    --wg-shadow: 0 2px 12px rgba(0,0,0,0.06);
    --wg-shadow-hover: 0 12px 32px rgba(0,0,0,0.15);
    --wg-transition: 0.25s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--wg-bg);
    color: var(--wg-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Gallery Hero Banner ── */
.wg-hero {
    background: linear-gradient(135deg, #0A0A0A 0%, #1a1a1a 40%, #2a2014 100%);
    padding: 80px 0 40px;
    margin-top: 60px;
    border-bottom: 3px solid var(--wg-primary-light);
}

.wg-hero__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.wg-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}

/* ── Breadcrumbs (inside hero) ── */
.wg-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 0 12px;
    font-size: 14px;
}

.wg-breadcrumbs a {
    color: var(--wg-primary-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.wg-breadcrumbs a:hover { text-decoration: underline; color: #E2C47A; }
.wg-crumb-sep { color: rgba(255,255,255,0.3); font-size: 13px; }
.wg-crumb-current { color: rgba(255,255,255,0.8); font-weight: 600; }

/* ── Page title (inside hero) ── */
.wg-page-title {
    font-size: 38px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0;
}

.wg-subtitle {
    color: var(--wg-text-muted);
    font-size: 15px;
    margin-bottom: 24px;
    font-weight: 500;
}

.wg-empty {
    color: var(--wg-text-muted);
    font-size: 16px;
    text-align: center;
    padding: 60px 20px;
    background: var(--wg-card-bg);
    border-radius: var(--wg-radius);
    border: 2px dashed var(--wg-border);
}

/* ── Search Bar ── */
.wg-search-bar { margin-bottom: 24px; }

.wg-search-input {
    width: 100%;
    max-width: 420px;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--wg-border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: var(--wg-text);
    background: var(--wg-card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 14px center / 18px no-repeat;
    transition: border-color var(--wg-transition), box-shadow var(--wg-transition);
}

.wg-search-input:focus {
    outline: none;
    border-color: var(--wg-primary-light);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}

.wg-search-input::placeholder { color: var(--wg-text-muted); }

/* ── Card Grid ── */
.wg-grid {
    display: grid;
    gap: 24px;
}

.wg-grid-brands,
.wg-grid-models {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.wg-grid-finishes {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.wg-grid-cars {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ── Cards ── */
.wg-card {
    position: relative;
    background: var(--wg-card-bg);
    border-radius: var(--wg-radius);
    overflow: hidden;
    box-shadow: var(--wg-shadow);
    text-decoration: none;
    color: var(--wg-text);
    border: 1px solid rgba(0,0,0,0.04);
    transition: transform var(--wg-transition), box-shadow var(--wg-transition);
}

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

.wg-card-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f0f0f0;
}

.wg-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.wg-card:hover .wg-card-img img {
    transform: scale(1.06);
}

.wg-grid-brands .wg-card-img,
.wg-grid-models .wg-card-img,
.wg-grid-finishes .wg-card-img {
    background: #ffffff;
    padding: 16px;
}

.wg-grid-brands .wg-card-img img,
.wg-grid-models .wg-card-img img,
.wg-grid-finishes .wg-card-img img {
    object-fit: contain;
}

.wg-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #9ca3af;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

.wg-card-body {
    padding: 16px 18px;
    border-top: 1px solid rgba(0,0,0,0.04);
}

.wg-card-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--wg-text);
}

.wg-card:hover .wg-card-title { color: var(--wg-primary-light); }

.wg-card-count {
    font-size: 13px;
    color: var(--wg-text-muted);
    font-weight: 500;
}

/* ── Admin card controls ── */
.wg-card-admin {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--wg-transition);
    z-index: 5;
}

.wg-card:hover .wg-card-admin { opacity: 1; }

.wg-card-admin-btn {
    background: rgba(0,0,0,0.65);
    color: white;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--wg-transition);
}

.wg-card-admin-btn:hover { background: rgba(0,0,0,0.85); }
.wg-card-admin-del:hover { background: #dc2626; }

/* ── Admin bar ── */
.wg-admin-bar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 24px;
}

/* ── Upload bar ── */
.wg-upload-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

/* ── Buttons ── */
.wg-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--wg-transition);
}

.wg-btn-primary {
    background: var(--wg-primary-light);
    color: #0A0A0A;
}

.wg-btn-primary:hover { background: #E2C47A; }

.wg-btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.wg-btn-outline {
    background: transparent;
    border: 2px solid var(--wg-border);
    color: var(--wg-text);
}

.wg-btn-outline:hover {
    border-color: var(--wg-primary-light);
    color: var(--wg-primary-light);
}

.wg-btn-icon { font-size: 18px; font-weight: 700; }

/* ── Photo Grid ── */
.wg-photo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.wg-inline-progress {
    background: var(--wg-card-bg);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--wg-shadow);
}

.wg-inline-progress .wg-progress-bar {
    height: 8px;
    background: var(--wg-border);
    border-radius: 4px;
    overflow: hidden;
}

.wg-inline-progress .wg-progress-fill {
    height: 100%;
    background: var(--wg-primary-light);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.wg-inline-progress p {
    font-size: 13px;
    color: var(--wg-text-muted);
    margin-top: 8px;
    text-align: center;
}

.wg-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.wg-photo-item {
    position: relative;
    border-radius: var(--wg-radius);
    overflow: hidden;
    background: #e5e7eb;
    aspect-ratio: 4 / 3;
    cursor: pointer;
    box-shadow: var(--wg-shadow);
}

.wg-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.wg-photo-item:hover img {
    transform: scale(1.06);
}

.wg-photo-date {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity var(--wg-transition);
}

.wg-photo-item:hover .wg-photo-date { opacity: 1; }

/* Admin photo controls */
.wg-photo-admin {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity var(--wg-transition);
}

.wg-photo-item:hover .wg-photo-admin { opacity: 1; }

.wg-btn-delete {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #dc2626;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wg-btn-delete:hover { background: #b91c1c; }

.wg-btn-feature {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: var(--wg-accent);
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wg-btn-feature:hover { background: #A8893A; }

.wg-btn-rotate {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(201,168,76,0.85);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.wg-btn-rotate:hover { background: #A8893A; }
.wg-btn-rotate:disabled { opacity: 0.5; cursor: wait; }

/* ── Lightbox ── */
.wg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wg-lb-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wg-lb-content img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}

.wg-lb-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: white;
    font-size: 36px;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
    transition: opacity var(--wg-transition);
}

.wg-lb-close:hover { opacity: 1; }

.wg-lb-prev,
.wg-lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 28px;
    width: 50px;
    height: 80px;
    cursor: pointer;
    border-radius: 8px;
    transition: background var(--wg-transition);
}

.wg-lb-prev { left: 16px; }
.wg-lb-next { right: 16px; }
.wg-lb-prev:hover,
.wg-lb-next:hover { background: rgba(255,255,255,0.2); }

.wg-lb-rotate {
    position: absolute;
    top: 20px;
    right: 72px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(201,168,76,0.85);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 12;
    opacity: 0.7;
    transition: opacity var(--wg-transition);
}

.wg-lb-rotate:hover { opacity: 1; background: #A8893A; }
.wg-lb-rotate:disabled { opacity: 0.4; cursor: wait; }

.wg-lb-caption {
    color: #d1d5db;
    font-size: 14px;
    margin-top: 12px;
    text-align: center;
}

.wg-lb-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #9ca3af;
    font-size: 14px;
}

/* ── Modal ── */
.wg-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wg-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.wg-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--wg-border);
}

.wg-modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--wg-text);
}

.wg-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--wg-text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
}

.wg-modal-close:hover {
    background: var(--wg-bg);
    color: var(--wg-text);
}

.wg-modal-body { padding: 24px; position: relative; }

.wg-modal-info {
    color: var(--wg-text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ── Upload form ── */
.wg-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.wg-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--wg-text);
    margin-bottom: 4px;
}

.wg-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--wg-border);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: var(--wg-text);
    cursor: pointer;
    font-family: inherit;
}

.wg-form-group select:focus {
    outline: none;
    border-color: var(--wg-primary-light);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}

/* ── Dropzone ── */
.wg-dropzone {
    border: 2px dashed var(--wg-border);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--wg-transition);
    background: var(--wg-bg);
}

.wg-dropzone:hover,
.wg-dropzone.wg-dragover {
    border-color: var(--wg-primary-light);
    background: #faf6ed;
}

.wg-dropzone-icon { font-size: 40px; display: block; margin-bottom: 8px; }
.wg-dropzone-content p { margin: 4px 0; }
.wg-dropzone-sub { font-size: 14px; color: var(--wg-primary-light); font-weight: 600; }
.wg-dropzone-hint { font-size: 12px; color: var(--wg-text-muted); margin-top: 8px !important; }

/* ── Preview grid ── */
.wg-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin: 16px 0;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: var(--wg-bg);
    border-radius: 8px;
}

.wg-preview-thumb {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.wg-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wg-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Upload actions ── */
.wg-upload-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.wg-upload-actions span {
    font-size: 14px;
    color: var(--wg-text-muted);
    font-weight: 500;
}

/* ── Progress bar ── */
.wg-progress { margin-top: 20px; }

.wg-progress-bar {
    height: 8px;
    background: var(--wg-border);
    border-radius: 4px;
    overflow: hidden;
}

.wg-progress-fill {
    height: 100%;
    background: var(--wg-primary-light);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.wg-progress p {
    font-size: 13px;
    color: var(--wg-text-muted);
    margin-top: 8px;
    text-align: center;
}

/* ── HEIC Conversion Overlay ── */
#wg-conversion-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.95);
    z-index: 10;
    border-radius: 12px;
}

.wg-conv-box {
    text-align: center;
    padding: 40px 30px;
    max-width: 360px;
}

.wg-conv-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    border: 4px solid var(--wg-border);
    border-top-color: var(--wg-primary-light);
    border-radius: 50%;
    animation: wg-spin 0.8s linear infinite;
}

@keyframes wg-spin {
    to { transform: rotate(360deg); }
}

.wg-conv-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--wg-text);
    margin: 0 0 8px;
}

.wg-conv-status {
    font-size: 14px;
    color: var(--wg-primary-light);
    font-weight: 500;
    margin: 0 0 16px;
    min-height: 20px;
}

.wg-conv-bar {
    height: 6px;
    background: var(--wg-border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

.wg-conv-fill {
    height: 100%;
    background: var(--wg-primary-light);
    border-radius: 3px;
    width: 0%;
    transition: width 0.4s ease;
}

.wg-conv-hint {
    font-size: 12px;
    color: var(--wg-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .wg-hero { padding: 70px 0 28px; }
    .wg-wrap { padding: 24px 16px 40px; }
    .wg-page-title { font-size: 26px; }
    .wg-grid-brands,
    .wg-grid-models { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .wg-grid-cars { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .wg-photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .wg-form-row { grid-template-columns: 1fr; }
    .wg-lb-prev, .wg-lb-next { width: 40px; height: 60px; font-size: 22px; }
    .wg-card-title { font-size: 15px; }
}

@media (max-width: 480px) {
    .wg-grid-brands,
    .wg-grid-models,
    .wg-grid-finishes { grid-template-columns: 1fr 1fr; gap: 12px; }
    .wg-photo-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Force dark header on gallery pages (both themes, scrolled or not) ── */
.header,
.header.scrolled {
    background-color: rgba(10,10,10,0.97) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.header .nav__list a { color: rgba(255,255,255,0.85) !important; }
.header .nav__list a:hover { color: #C9A84C !important; }
.header__logo .logo-light { display: block !important; }
.header__logo .logo-dark { display: none !important; }
.header .hamburger__line { background-color: #fff !important; }
.header .theme-toggle { border-color: rgba(255,255,255,0.2) !important; color: #fff !important; }
.header .header__phone a { color: #C9A84C !important; }
.header .btn--primary { background-color: #C9A84C !important; color: #0A0A0A !important; }
