/* ============================================
   EC Product — BMW Design System
   Pantone 2915U (#5BA4D1) accent
   ============================================ */

:root {
    --ec-accent: #5BA4D1;
    --ec-accent-dark: #3D7FB5;
    --ec-black: #262626;
    --ec-gray: #757575;
    --ec-silver: #BBBBBB;
    --ec-light: #F5F5F5;
    --ec-white: #FFFFFF;
}

/* ========== Product List ========== */
.ec-products-wrap {
    display: flex;
    gap: 32px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px;
    font-family: 'DM Sans', system-ui, sans-serif;
}

.ec-products-sidebar {
    width: 240px;
    flex-shrink: 0;
}

.ec-cat-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ec-black);
    letter-spacing: 0.05em;
    margin: 0 0 12px;
}

.ec-cat-list, .ec-cat-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ec-cat-list li a {
    display: block;
    padding: 6px 0;
    color: var(--ec-gray);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.15s;
}

.ec-cat-list li a:hover,
.ec-cat-list li.active > a {
    color: var(--ec-black);
    font-weight: 700;
}

.ec-cat-list ul { padding-left: 16px; }

.ec-search-form {
    margin-top: 20px;
    display: flex;
    gap: 8px;
}

.ec-search-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--ec-silver);
    font-size: 14px;
    font-family: inherit;
}

.ec-search-form button {
    padding: 8px 16px;
    background: var(--ec-black);
    color: var(--ec-white);
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

/* Grid */
.ec-products-grid {
    flex: 1;
    display: grid;
    gap: 24px;
}

.ec-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ec-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ec-cols-4 { grid-template-columns: repeat(4, 1fr); }

.ec-product-card {
    background: var(--ec-white);
    overflow: hidden;
}

.ec-card-image img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}

.ec-no-image {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--ec-light);
}

.ec-card-body {
    padding: 16px 0 0;
}

.ec-card-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
}

.ec-card-title a {
    color: var(--ec-black);
    text-decoration: none;
}

.ec-card-model {
    font-size: 13px;
    color: var(--ec-gray);
}

.ec-card-excerpt {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--ec-gray);
    line-height: 1.5;
}

/* Pagination */
.ec-pagination {
    margin-top: 40px;
    text-align: center;
    width: 100%;
}

.ec-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 2px;
    color: var(--ec-black);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.ec-pagination .page-numbers.current {
    background: var(--ec-black);
    color: var(--ec-white);
}

.ec-no-products {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--ec-gray);
    padding: 60px;
}

/* ========== Product Detail ========== */
.ec-product-detail {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px;
    font-family: 'DM Sans', system-ui, sans-serif;
    color: var(--ec-black);
}

.ec-breadcrumb {
    font-size: 13px;
    color: var(--ec-gray);
    margin-bottom: 24px;
}

.ec-breadcrumb a {
    color: var(--ec-gray);
    text-decoration: none;
}

.ec-breadcrumb a:hover { color: var(--ec-black); }

/* Top: Gallery + Info */
.ec-detail-top {
    display: flex;
    gap: 48px;
    margin-bottom: 48px;
}

.ec-detail-gallery {
    flex: 0 0 50%;
    max-width: 50%;
}

.ec-gallery-main img,
.ec-detail-main-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.ec-gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.ec-gallery-thumb {
    width: 64px;
    height: 64px;
    cursor: pointer;
    opacity: 0.5;
    border: 2px solid transparent;
    transition: all 0.15s;
}

.ec-gallery-thumb.active,
.ec-gallery-thumb:hover {
    opacity: 1;
    border-color: var(--ec-black);
}

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

.ec-detail-info {
    flex: 1;
}

.ec-detail-title {
    font-size: 32px;
    font-weight: 300;
    line-height: 1.15;
    margin: 0 0 24px;
    color: var(--ec-black);
}

/* Specs Table */
.ec-specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.ec-specs-table th,
.ec-specs-table td {
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--ec-light);
}

.ec-specs-table th {
    text-align: left;
    font-weight: 400;
    color: var(--ec-gray);
    width: 120px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Inquire CTA */
.ec-inquiry-cta {
    display: inline-block;
    padding: 14px 40px;
    background: var(--ec-accent);
    color: var(--ec-white);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.15s;
}

.ec-inquiry-cta:hover {
    background: var(--ec-accent-dark);
    color: var(--ec-white);
}

.ec-datasheet-link {
    display: inline-block;
    margin-left: 16px;
    padding: 14px 24px;
    border: 1px solid var(--ec-black);
    color: var(--ec-black);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Sections */
.ec-detail-section {
    margin-bottom: 48px;
}

.ec-detail-section h2 {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--ec-black);
}

.ec-detail-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ec-gray);
}

/* Tech Table */
.ec-tech-table {
    width: 100%;
    border-collapse: collapse;
}

.ec-tech-table th {
    text-align: left;
    width: 200px;
    padding: 12px 0;
    font-size: 13px;
    font-weight: 400;
    color: var(--ec-gray);
    border-bottom: 1px solid var(--ec-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ec-tech-table td {
    padding: 12px 0;
    font-size: 14px;
    font-weight: 700;
    border-bottom: 1px solid var(--ec-light);
}

/* Related */
.ec-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.ec-related-card {
    text-align: center;
}

.ec-related-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.ec-related-card h4 {
    margin: 8px 0 4px;
    font-size: 14px;
    font-weight: 700;
}

.ec-related-card a {
    color: var(--ec-black);
    text-decoration: none;
}

.ec-related-model {
    font-size: 12px;
    color: var(--ec-gray);
}

/* ========== Admin Fields ========== */
.ec-field-row {
    margin-bottom: 16px;
}

.ec-field-row label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.ec-gallery-item {
    display: inline-block;
    position: relative;
    margin: 4px;
}

.ec-gallery-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.ec-gallery-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #b82105;
    color: white;
    width: 18px;
    height: 18px;
    text-align: center;
    line-height: 16px;
    cursor: pointer;
    font-size: 12px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .ec-products-wrap { flex-direction: column; }
    .ec-products-sidebar { width: 100%; }
    .ec-cols-3, .ec-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .ec-detail-top { flex-direction: column; gap: 24px; }
    .ec-detail-gallery { flex: none; max-width: 100%; }
    .ec-related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .ec-cols-2, .ec-cols-3, .ec-cols-4 { grid-template-columns: 1fr; }
    .ec-related-grid { grid-template-columns: 1fr; }
}
