.mg-design-gallery {
    margin: 2rem 0;
}

.mg-design-gallery__header {
    margin-bottom: 1rem;
}

.mg-design-gallery__title {
    font-size: 1.3rem;
    margin: 0;
}

.mg-design-gallery__items {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.25rem 0.5rem 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.mg-design-gallery__viewport {
    position: relative;
}


.mg-design-gallery .mg-design-gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: linear-gradient(145deg, #ffffff, #f6f7fb);
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.14), 0 4px 12px rgba(17, 24, 39, 0.08);
    border-radius: 999px;
    width: 48px;
    height: 48px;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1f2937;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, background 0.18s ease, color 0.18s ease;
    z-index: 2;
    backdrop-filter: saturate(1.1) blur(4px);
    font: inherit;
    line-height: 1;
    isolation: isolate;
}

.mg-design-gallery .mg-design-gallery__nav::before,
.mg-design-gallery .mg-design-gallery__nav::after {
    content: '';
}

.mg-design-gallery .mg-design-gallery__nav span {
    font-size: 1.1rem;
    line-height: 1;
    font-weight: 700;
    pointer-events: none;
}

.mg-design-gallery__nav:disabled {
    opacity: 0.45;
    cursor: default;
}

.mg-design-gallery__nav:hover:not(:disabled) {
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 14px 32px rgba(17, 24, 39, 0.16), 0 6px 16px rgba(17, 24, 39, 0.1);
    color: #0f172a;
    background: linear-gradient(145deg, #ffffff, #eef1f8);
}

.mg-design-gallery__nav--prev { left: 0.25rem; }
.mg-design-gallery__nav--next { right: 0.25rem; }

@media (max-width: 768px) {
    .mg-design-gallery .mg-design-gallery__nav {
        display: none !important;
    }
}

.mg-design-gallery__item {
    min-width: 240px;
    scroll-snap-align: start;
}

.mg-design-gallery__item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mg-design-gallery__item:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 3px;
}

.mg-design-gallery__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.mg-design-gallery--list .mg-design-gallery__item {
    flex-direction: row;
    align-items: center;
    min-width: 320px;
}

.mg-design-gallery__thumb {
    position: relative;
    padding-top: 75%;
    background: #f8fafc;
    flex: 1 1 auto;
    overflow: hidden;
}

.mg-design-gallery--list .mg-design-gallery__thumb {
    max-width: 200px;
    padding-top: 0;
    aspect-ratio: 4 / 3;
}

.mg-design-gallery__thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mg-design-gallery--list .mg-design-gallery__thumb img {
    position: relative;
}

.mg-design-gallery__meta {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: #111827;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    flex: 0 0 auto;
}

.mg-design-gallery--list .mg-design-gallery__meta {
    min-width: 180px;
}

.mg-design-gallery__type {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

@media (max-width: 600px) {
    .mg-design-gallery__item {
        min-width: 70%;
    }

    .mg-design-gallery--list .mg-design-gallery__item {
        min-width: 85%;
        flex-direction: column;
    }

    .mg-design-gallery--list .mg-design-gallery__thumb {
        max-width: none;
        aspect-ratio: auto;
        padding-top: 75%;
    }

    .mg-design-gallery--list .mg-design-gallery__thumb img {
        position: absolute;
    }

    .mg-design-gallery--list .mg-design-gallery__meta {
        min-width: 0;
    }
}
