/* === PALETTE SECTION === */
.section-palette {
    margin: 0 auto;
    padding: 3rem 0;
    /* max-width: 1280px; */
}

/* --- Brands grid --- */
.section-palette .brands-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* --- Brand block --- */
.section-palette .dekors-block {
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 1.5rem 1.5rem 2rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
    min-width: 0; /* prevent grid blowout from scrollable content */
    overflow: hidden;
}

.section-palette .dekors-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.section-palette .dekors-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-palette .dekors-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-palette .dekors-count {
    font-size: 0.75rem;
    /* background: #eff6ff;
    color: #2563eb; */
    background: #f5f5f5;
    color: #6a707c;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
}

.section-palette .dekors-link {
    font-size: 0.875rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
}
.section-palette .dekors-link:hover {
    color: #1d4ed8;
}

/* --- Slider --- */
.section-palette .slider-wrapper {
    position: relative;
    margin: 0 -0.5rem;
}

.section-palette .color-track {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.section-palette .color-track::-webkit-scrollbar {
    display: none;
}

/* Navigation arrows */
.section-palette .slider-nav {
    position: absolute;
    top: 40px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    opacity: 0;
}
.section-palette .slider-wrapper:hover .slider-nav {
    opacity: 1;
}
.section-palette .slider-nav:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
}
.section-palette .slider-nav.prev { left: -10px; }
.section-palette .slider-nav.next { right: -10px; }

/* --- Color card --- */
.section-palette .color-card {
    flex: 0 0 85px;
    scroll-snap-align: start;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s;
    text-decoration: none;
    color: inherit;
}
.section-palette .color-card:hover {
    transform: translateY(-3px);
}

.section-palette .color-swatch {
    width: 85px;
    height: 85px;
    border-radius: 1rem;
    object-fit: cover;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
    background-color: #f1f5f9;
    transition: box-shadow 0.2s;
    display: block;
}
.section-palette .color-card:hover .color-swatch {
    box-shadow: 0 4px 10px rgba(0,0,0,0.1), inset 0 0 0 1px rgba(0,0,0,0.05);
}

.section-palette .color-name {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #334155;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

/* --- "View all" footer --- */
.section-palette .palette-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}
.section-palette .btn-view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #fff;
    padding: 0.75rem 2rem;
    border-radius: 0.75rem;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}
.section-palette .btn-view-all:hover {
    background: #1d4ed8;
}

/* --- Modal (lightbox) --- */
.lb-color-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15,23,42,0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.lb-color-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.lb-color-modal__content {
    background: #fff;
    padding: 1.5rem;
    border-radius: 1.5rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s;
}
.lb-color-modal.active .lb-color-modal__content {
    transform: translateY(0);
}

.lb-color-modal__img {
    width: 100%;
    height: auto;
    border-radius: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    aspect-ratio: 1/1;
    object-fit: cover;
}

.lb-color-modal__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.25rem;
}

.lb-color-modal__brand {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 1.25rem;
}

.lb-color-modal__close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: #f1f5f9;
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: #64748b;
    font-size: 1rem;
    line-height: 1;
}
.lb-color-modal__close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.lb-color-modal__btn {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    padding: 0.75rem 2rem;
    border-radius: 0.75rem;
    text-decoration: none;
    font-weight: 600;
    width: 100%;
    box-sizing: border-box;
    transition: background 0.2s;
    text-align: center;
}
.lb-color-modal__btn:hover {
    background: #1d4ed8;
}

/* --- Mobile Toggle --- */
.brands-grid-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.5rem;
    margin-top: 1rem;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    transition: color 0.2s;
}
.brands-grid-toggle:hover {
    color: #0f172a;
}
.brands-grid-toggle svg {
    width: 22px;
    height: 22px;
    transition: transform 0.3s;
}
.brands-grid-toggle.is-open svg {
    transform: rotate(180deg);
}

/* --- Responsive --- */
@media (max-width: 960px) {
    .section-palette .brands-grid {
        grid-template-columns: 1fr;
    }
    .section-palette .brands-grid.is-collapsed .dekors-block:nth-child(n+4) {
        display: none;
    }
    .brands-grid-toggle {
        display: flex;
    }
}
@media (max-width: 768px) {
    .section-palette .slider-nav { display: none !important; }
    .section-palette .slider-wrapper { margin: 0; }
    .section-palette .dekors-block { padding: 1rem; border-radius: 1rem; }
}
