.cpv-legend-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Mobile carousel indicators */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ccc;
    transition: background-color 0.2s;
    cursor: pointer;
}

.carousel-dot.active {
    background-color: #007bff;
}

/* Hide indicators on tablet and up */
@media (min-width: 768px) {
    .carousel-indicators {
        display: none;
    }
}

/* MOBILE FIRST: CPV Legend mobile carousel */
.cpv-list {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 0 1rem;
    margin: 0 -1rem 1rem -1rem;
    scroll-padding: 1rem;
}

/* Hide scrollbar but keep functionality */
.cpv-list::-webkit-scrollbar {
    display: none;
}

.cpv-list {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* MOBILE: Carousel items */
.cpv-item {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 280px;
    max-width: 320px;
    flex-shrink: 0;
    scroll-snap-align: start;
}

/* TABLET AND UP: Grid layout (no carousel) */
@media (min-width: 768px) {
    .cpv-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        overflow-x: visible;
        scroll-snap-type: none;
        padding: 0;
        margin: 0 0 1rem 0;
    }

    .cpv-item {
        min-width: auto;
        max-width: none;
        width: 100%;
        flex-shrink: 1;
        scroll-snap-align: none;
    }
}

/* DESKTOP: 3 columns */
@media (min-width: 1024px) {
    .cpv-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* LARGE DESKTOP: 5 columns */
@media (min-width: 1200px) {
    .cpv-list {
        display: flex;
        gap: 1.5rem;
        justify-content: space-between;
    }

    .cpv-item {
        flex: 1;
        min-width: 0;
        max-width: 220px;
    }
}

.cpv-code-row {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 0.5em;
}

.cpv-code {
    cursor: pointer;
    color: #007bff;
    text-decoration: underline;
}

.cpv-icon {
    font-size: 1em;
    color: #007bff;
}

.cpv-code {
    font-weight: bold;
}

/* MOBILE FIRST: Readable CPV text */
.cpv-body {
    margin-bottom: 0.5em;
    color: #333;
    font-size: 0.9rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
}

/* TABLET AND UP: Single line with ellipsis */
@media (min-width: 768px) {
    .cpv-body {
        font-size: 1rem;
        line-height: 1.5;
        white-space: nowrap;
        text-overflow: ellipsis;
        display: block;
        -webkit-line-clamp: none;
        line-clamp: none;
        -webkit-box-orient: initial;
    }
}

.cpv-divider {
    border-bottom: 1px solid #ddd;
    margin: 0.5em 0;
}

/* MOBILE FIRST: Touch-friendly CPV subscribe button */
.cpv-subscribe-btn {
    margin-top: auto;
    background: #d57d25;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 44px;
    font-size: 0.9rem;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

/* TABLET AND UP: Standard button size */
@media (min-width: 768px) {
    .cpv-subscribe-btn {
        padding: 0.5em 1em;
        min-height: auto;
        font-size: 1rem;
    }
}

.cpv-subscribe-btn:hover {
    background: #ad661f;
}

.legend-text {
    margin-top: 1rem;
    font-size: 1rem;
    color: #555;
    margin: 15px auto;
}

.subscribe-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* MOBILE FIRST: Dialog responsive design */
.dialog-content {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    width: 90vw;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem;
}

/* TABLET AND UP: Larger dialog */
@media (min-width: 768px) {
    .dialog-content {
        padding: 2rem;
        width: auto;
        min-width: 400px;
        margin: 0;
    }
}

.toggle-group label {
    margin-right: 1rem;
}

.whatsapp-info {
    font-size: 0.9rem;
    color: #007bff;
}

.cpv-checkmark {
    color: #25d366;
    font-size: 1.2em;
    margin-left: auto;
    margin-right: 0.2em;
}