/**
 * NEJRÁMY Sync - Frontend Styles
 *
 * Styly pro šablony produktů, kategorií a značek.
 */

/* ==========================================================================
   Variables
   ========================================================================== */

:root {
    --nejramy-primary: #1a365d;
    --nejramy-primary-hover: #2c5282;
    --nejramy-secondary: #e53e3e;
    --nejramy-text: #2d3748;
    --nejramy-text-light: #718096;
    --nejramy-border: #e2e8f0;
    --nejramy-bg-light: #f7fafc;
    --nejramy-white: #ffffff;
    --nejramy-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --nejramy-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --nejramy-radius: 8px;
    --nejramy-radius-sm: 4px;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.nejramy-breadcrumbs {
    padding: 1rem 0;
    font-size: 0.875rem;
    color: var(--nejramy-text-light);
}

.nejramy-breadcrumbs a {
    color: var(--nejramy-primary);
    text-decoration: none;
}

.nejramy-breadcrumbs a:hover {
    text-decoration: underline;
}

.nejramy-breadcrumbs .separator {
    margin: 0 0.5rem;
    color: var(--nejramy-text-light);
}

.nejramy-breadcrumbs .current {
    color: var(--nejramy-text);
}

/* ==========================================================================
   Archive Layout
   ========================================================================== */

.nejramy-archive-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nejramy-archive-header {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--nejramy-border);
}

.nejramy-archive-title {
    font-size: 2rem;
    color: var(--nejramy-primary);
    margin-bottom: 0.5rem;
}

.nejramy-archive-description {
    color: var(--nejramy-text-light);
    max-width: 600px;
    margin: 0 auto;
}

.nejramy-archive-count {
    font-size: 0.875rem;
    color: var(--nejramy-text-light);
    margin-top: 0.5rem;
}

.nejramy-archive-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .nejramy-archive-layout {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.nejramy-archive-sidebar {
    padding: 1rem;
    margin-top: 1.5rem;
    background: var(--nejramy-bg-light);
    border-radius: var(--nejramy-radius);
    height: fit-content;
    position: sticky;
    top: 1rem;
}

.nejramy-filter-section {
    margin-bottom: 1.5rem;
}

.nejramy-filter-section:last-child {
    margin-bottom: 0;
}

.nejramy-filter-section h3 {
    font-size: 1rem;
    color: var(--nejramy-primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--nejramy-primary);
}

.nejramy-category-list,
.nejramy-brand-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nejramy-category-list li,
.nejramy-brand-list li {
    margin-bottom: 0.5rem;
}

.nejramy-category-list a,
.nejramy-brand-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    color: var(--nejramy-text);
    text-decoration: none;
    border-radius: var(--nejramy-radius-sm);
    transition: background 0.2s;
}

.nejramy-category-list a:hover,
.nejramy-brand-list a:hover {
    background: var(--nejramy-white);
}

.nejramy-category-list li.current a,
.nejramy-brand-list li.current a {
    background: var(--nejramy-primary);
    color: var(--nejramy-white);
}

.nejramy-category-list .count,
.nejramy-brand-list .count {
    font-size: 0.75rem;
    color: var(--nejramy-text-light);
}

.nejramy-category-list li.current .count,
.nejramy-brand-list li.current .count {
    color: rgba(255, 255, 255, 0.7);
}

.nejramy-model-list {
    list-style: none;
    padding-left: 1rem;
    margin-top: 0.25rem;
}

.nejramy-model-list li {
    margin-bottom: 0.25rem;
}

.nejramy-model-list a {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

/* ==========================================================================
   Products Grid
   ========================================================================== */

.nejramy-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.nejramy-product-card {
    background: var(--nejramy-white);
    border-radius: var(--nejramy-radius);
    box-shadow: var(--nejramy-shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.nejramy-product-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.nejramy-product-thumb {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--nejramy-bg-light);
}

.nejramy-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.nejramy-product-card:hover .nejramy-product-thumb img {
    transform: scale(1.05);
}

.nejramy-product-thumb.nejramy-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nejramy-text-light);
    font-size: 0.875rem;
}

.nejramy-product-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--nejramy-text);
    padding: 1rem;
    margin: 0;
    line-height: 1.4;
}

.nejramy-product-card-brand,
.nejramy-product-card-category {
    font-size: 0.75rem;
    color: var(--nejramy-text-light);
    padding: 0 1rem 1rem;
    margin: -0.5rem 0 0;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.nejramy-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem 0;
}

.nejramy-pagination a,
.nejramy-pagination span {
    padding: 0.5rem 1rem;
    background: var(--nejramy-white);
    border: 1px solid var(--nejramy-border);
    border-radius: var(--nejramy-radius-sm);
    color: var(--nejramy-text);
    text-decoration: none;
}

.nejramy-pagination a:hover {
    background: var(--nejramy-bg-light);
}

.nejramy-pagination .current {
    background: var(--nejramy-primary);
    border-color: var(--nejramy-primary);
    color: var(--nejramy-white);
}

/* ==========================================================================
   Model Navigation
   ========================================================================== */

.nejramy-model-navigation {
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--nejramy-bg-light);
    border-radius: var(--nejramy-radius);
}

.nejramy-model-navigation h3 {
    font-size: 0.875rem;
    color: var(--nejramy-text-light);
    margin-bottom: 0.75rem;
}

.nejramy-model-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nejramy-model-tabs li a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--nejramy-white);
    border: 1px solid var(--nejramy-border);
    border-radius: var(--nejramy-radius-sm);
    color: var(--nejramy-text);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.nejramy-model-tabs li a:hover {
    border-color: var(--nejramy-primary);
    color: var(--nejramy-primary);
}

.nejramy-model-tabs li.active a {
    background: var(--nejramy-primary);
    border-color: var(--nejramy-primary);
    color: var(--nejramy-white);
}

.nejramy-model-tabs .count {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ==========================================================================
   Single Product
   ========================================================================== */

.nejramy-single-product {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

.nejramy-product-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .nejramy-product-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Gallery */
.nejramy-product-gallery {
    position: sticky;
    top: 1rem;
    height: fit-content;
}

.nejramy-main-image {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--nejramy-radius);
    background: var(--nejramy-bg-light);
}

.nejramy-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nejramy-gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    overflow-x: auto;
}

.nejramy-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: var(--nejramy-radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    opacity: 0.7;
    transition: all 0.2s;
}

.nejramy-thumb:hover,
.nejramy-thumb.active {
    opacity: 1;
    border-color: var(--nejramy-primary);
}

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

/* Product Info */
.nejramy-product-info {
    padding-top: 1rem;
}

.nejramy-product-title {
    font-size: 1.75rem;
    color: var(--nejramy-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.nejramy-product-sku {
    font-size: 0.875rem;
    color: var(--nejramy-text-light);
    margin-bottom: 1rem;
}

.nejramy-product-meta {
    padding: 1rem 0;
    border-top: 1px solid var(--nejramy-border);
    border-bottom: 1px solid var(--nejramy-border);
    margin-bottom: 1rem;
}

.nejramy-product-categories,
.nejramy-product-brands {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.nejramy-product-categories:last-child,
.nejramy-product-brands:last-child {
    margin-bottom: 0;
}

.nejramy-product-categories a,
.nejramy-product-brands a {
    color: var(--nejramy-primary);
    text-decoration: none;
}

.nejramy-product-categories a:hover,
.nejramy-product-brands a:hover {
    text-decoration: underline;
}

.nejramy-product-price {
    margin: 1.5rem 0;
}

.nejramy-product-price .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--nejramy-secondary);
}

.nejramy-product-description {
    color: var(--nejramy-text);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* Attributes Table */
.nejramy-product-attributes {
    margin-bottom: 1.5rem;
}

.nejramy-product-attributes h3 {
    font-size: 1.1rem;
    color: var(--nejramy-primary);
    margin-bottom: 0.75rem;
}

.nejramy-attributes-table {
    width: 100%;
    border-collapse: collapse;
}

.nejramy-attributes-table th,
.nejramy-attributes-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--nejramy-border);
    text-align: left;
}

.nejramy-attributes-table th {
    font-weight: 600;
    color: var(--nejramy-text);
    width: 40%;
}

.nejramy-attributes-table td {
    color: var(--nejramy-text-light);
}

/* ==========================================================================
   Inquiry Form
   ========================================================================== */

.nejramy-inquiry-form {
    background: var(--nejramy-bg-light);
    padding: 1.5rem;
    border-radius: var(--nejramy-radius);
    margin-top: 2rem;
}

.nejramy-inquiry-form h3 {
    font-size: 1.25rem;
    color: var(--nejramy-primary);
    margin-bottom: 0.5rem;
}

.nejramy-inquiry-form > p {
    color: var(--nejramy-text-light);
    margin-bottom: 1.5rem;
}

.nejramy-simple-inquiry-form .form-row {
    margin-bottom: 1rem;
}

.nejramy-simple-inquiry-form label {
    display: block;
    font-weight: 600;
    color: var(--nejramy-text);
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.nejramy-simple-inquiry-form input[type="text"],
.nejramy-simple-inquiry-form input[type="email"],
.nejramy-simple-inquiry-form input[type="tel"],
.nejramy-simple-inquiry-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--nejramy-border);
    border-radius: var(--nejramy-radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.nejramy-simple-inquiry-form input:focus,
.nejramy-simple-inquiry-form textarea:focus {
    outline: none;
    border-color: var(--nejramy-primary);
}

.nejramy-simple-inquiry-form textarea {
    resize: vertical;
    min-height: 100px;
}

.nejramy-submit-btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--nejramy-secondary);
    color: var(--nejramy-white);
    border: none;
    border-radius: var(--nejramy-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.nejramy-submit-btn:hover {
    background: #c53030;
}

/* ==========================================================================
   Related Products
   ========================================================================== */

.nejramy-related-products {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--nejramy-border);
}

.nejramy-related-products h2 {
    font-size: 1.5rem;
    color: var(--nejramy-primary);
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   Brand/Model Filter Buttons
   ========================================================================== */

.nejramy-filters {
    margin-bottom: 1.5rem;
}

.nejramy-brand-filter,
.nejramy-model-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--nejramy-bg-light);
    border-radius: var(--nejramy-radius);
    margin-bottom: 0.75rem;
}

.nejramy-filter-label {
    font-weight: 600;
    color: var(--nejramy-text);
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

.nejramy-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nejramy-filter-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

/* Loading State */
.nejramy-products-grid.loading {
    position: relative;
    min-height: 200px;
    opacity: 0.5;
    pointer-events: none;
}

.nejramy-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--nejramy-white);
    padding: 1rem 2rem;
    border-radius: var(--nejramy-radius);
    box-shadow: var(--nejramy-shadow-lg);
    z-index: 10;
}

.nejramy-loader span {
    color: var(--nejramy-text);
    font-size: 0.875rem;
}

/* Reset Filter Link */
.nejramy-reset-filter {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--nejramy-primary);
    color: var(--nejramy-white);
    text-decoration: none;
    border-radius: var(--nejramy-radius-sm);
    font-size: 0.875rem;
    transition: background 0.2s;
}

.nejramy-reset-filter:hover {
    background: var(--nejramy-primary-hover);
}

/* Filter Error */
.nejramy-filter-error {
    text-align: center;
    padding: 2rem;
    background: #fed7d7;
    border-radius: var(--nejramy-radius);
    color: #c53030;
}

/* ==========================================================================
   Sidebar Title
   ========================================================================== */

.nejramy-sidebar-title {
    font-size: 1rem;
    color: var(--nejramy-primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--nejramy-primary);
}

/* ==========================================================================
   No Products Message
   ========================================================================== */

.nejramy-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: var(--nejramy-bg-light);
    border-radius: var(--nejramy-radius);
    color: var(--nejramy-text-light);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .nejramy-archive-sidebar {
        position: static;
    }

    .nejramy-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .nejramy-product-card-title {
        font-size: 0.8rem;
        padding: 0.75rem;
    }

    .nejramy-product-title {
        font-size: 1.25rem;
    }

    .nejramy-product-gallery {
        position: static;
    }

    .nejramy-model-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }

    .nejramy-model-tabs li a {
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .nejramy-products-grid {
        grid-template-columns: 1fr;
    }

    .nejramy-brand-filter,
    .nejramy-model-filter {
        flex-direction: column;
        align-items: flex-start;
    }

    .nejramy-filter-label {
        margin-bottom: 0.5rem;
    }

    .nejramy-filter-buttons {
        width: 100%;
    }

    .nejramy-filter-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}
