/**
 * Product Gallery Component Styles
 * Updated to match DroneBOM Pro v2.0 Premium Dark Theme
 * Color system: Obsidian + Sapphire + Emerald
 */

.product-gallery-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.product-gallery {
    position: relative;
}

.main-image-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid rgba(59, 130, 246, 0.12);
}

.main-image-wrapper {
    position: relative;
    width: 100%;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
    cursor: zoom-in;
}

.fullscreen-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.fullscreen-btn:hover {
    background: rgba(37, 99, 235, 0.6);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.gallery-nav:hover {
    background: rgba(37, 99, 235, 0.6);
}

.gallery-nav.prev { left: 16px; }
.gallery-nav.next { right: 16px; }

.thumbnails-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
}

.thumbnail {
    flex: 0 0 80px;
    height: 80px;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.3s ease;
    padding: 0;
    background: none;
}

.thumbnail.active {
    border-color: #2563eb;
}

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

/* Fullscreen Viewer */
.fullscreen-viewer {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(3, 7, 18, 0.97);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-viewer.hidden { display: none; }

.fullscreen-content {
    position: relative;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-fullscreen {
    position: absolute;
    top: 24px; right: 24px;
    background: rgba(15, 23, 42, 0.06);
    color: white;
    border: none;
    border-radius: 12px;
    width: 48px; height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.close-fullscreen:hover { background: rgba(255, 255, 255, 0.16); }

.fullscreen-nav {
    position: absolute;
    background: rgba(15, 23, 42, 0.06);
    color: white;
    border: none;
    border-radius: 14px;
    width: 56px; height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.fullscreen-nav:hover { background: rgba(37, 99, 235, 0.35); }
.fullscreen-nav.prev { left: 24px; }
.fullscreen-nav.next { right: 24px; }

.fullscreen-image-container {
    position: relative;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fullscreen-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.1s ease;
}

.zoom-controls {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: #f1f5f9;
    padding: 8px 16px;
    border-radius: 14px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.zoom-controls button {
    background: rgba(15, 23, 42, 0.06);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 14px;
    font-weight: 600;
}

.zoom-controls button:hover { background: rgba(37, 99, 235, 0.25); }

/**
 * Enhanced Filter System Styles
 * Premium dark theme compatible
 */

.enhanced-filters {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: start;
}

.filter-sidebar {
    background: #f8fafc;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.12);
    position: sticky;
    top: 100px;
    backdrop-filter: blur(12px);
}

.filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.filter-section h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

.btn-link {
    background: none;
    border: none;
    color: #60a5fa;
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
    padding: 0;
}

.btn-link:hover { color: #2563eb; }

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    min-height: 32px;
}

.active-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(37, 99, 235, 0.08);
    color: #60a5fa;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid rgba(37, 99, 235, 0.16);
}

.active-filter-remove {
    background: none;
    border: none;
    color: #60a5fa;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    width: 16px; height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.active-filter-remove:hover { color: #2563eb; }

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

.filter-group h4 {
    margin: 0 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 13px;
    color: #64748b;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px; height: 18px;
    cursor: pointer;
    accent-color: #2563eb;
}

.filter-checkbox span:first-of-type { flex: 1; }

.filter-count {
    color: #4b5e7a;
    font-size: 12px;
}

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

.price-range-inputs input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 8px;
    font-size: 13px;
    background: rgba(255,255,255,0.03);
    color: #1e293b;
}

.price-range-inputs span { color: #64748b; }

.filter-history-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.filter-history-section h4 {
    margin: 0 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

.filter-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-history p {
    color: #4b5e7a;
    font-size: 13px;
    font-style: italic;
}

.filter-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease;
    font-size: 13px;
    text-align: left;
}

.filter-history-item:hover {
    background: rgba(37, 99, 235, 0.05);
    border-color: rgba(37, 99, 235, 0.16);
}

.history-time { color: #4b5e7a; font-size: 12px; }
.history-filters { color: #64748b; font-weight: 500; }

/* Products Main Area */
.products-main { width: 100%; }

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.results-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
}

.results-info span:first-child {
    font-weight: 700;
    color: #1e293b;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-options label { font-size: 13px; color: #64748b; }

.sort-options select {
    padding: 8px 12px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 8px;
    font-size: 13px;
    background: rgba(255,255,255,0.03);
    color: #1e293b;
    cursor: pointer;
}

/* Enhanced Product Cards */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.product-card {
    background: #f8fafc;
    border: 1px solid rgba(59, 130, 246, 0.12);
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    backdrop-filter: blur(12px);
}

.product-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.30), 0 0 48px rgba(37, 99, 235, 0.12);
    transform: translateY(-4px);
    border-color: rgba(56, 130, 220, 0.24);
}

.product-card__image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card__image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-count {
    position: absolute;
    bottom: 8px; right: 8px;
    background: #f1f5f9;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    backdrop-filter: blur(8px);
}

.product-card__family {
    display: block;
    padding: 12px 16px 4px;
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.product-card h3 {
    margin: 4px 16px 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

.product-card h3 a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-card h3 a:hover { color: #60a5fa; }

.product-card p {
    margin: 0 16px 12px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
}

.product-card strong {
    display: block;
    margin: 0 16px 12px;
    font-size: 13px;
    color: #60a5fa;
    font-weight: 600;
}

.product-card__actions {
    display: flex;
    gap: 8px;
    padding: 0 16px 16px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.22);
}

.btn-secondary {
    background: rgba(255,255,255,0.04);
    color: #64748b;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.btn-secondary:hover {
    background: rgba(15, 23, 42, 0.06);
    border-color: rgba(255,255,255,0.12);
}

.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: #64748b;
}

.no-products p { font-size: 16px; margin-bottom: 16px; }

#reset-filters { display: inline-block; margin-top: 16px; }

/* Responsive Design */
@media (max-width: 1024px) {
    .enhanced-filters { grid-template-columns: 1fr; }
    .filter-sidebar { position: relative; top: 0; }
}

@media (max-width: 768px) {
    .products-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
    .product-card__image-wrapper { height: 180px; }
    .main-image-wrapper { height: 400px; }
    .thumbnails-container { justify-content: center; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; }
    .product-card__actions { flex-direction: column; }
    .zoom-controls { width: 90%; justify-content: center; }
    .fullscreen-nav { width: 48px; height: 48px; }
}
