.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.ymg-gallery {
    margin: 3rem auto;
    padding: 2.5rem;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(15, 0, 38, 0.08);
    border: 1px solid rgba(255, 45, 146, 0.12);
}

.ymg-gallery__filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 1.75rem;
    background: linear-gradient(135deg, rgba(255, 45, 146, 0.08), rgba(255, 111, 188, 0.05));
    border-radius: 16px;
    margin-bottom: 2rem;
}

.ymg-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    font-size: 0.95rem;
    color: #3d3d3d;
}

.ymg-filter-label {
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: #7a3d58;
}

.ymg-filter {
    appearance: none;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(17, 1, 28, 0.12);
    background: #ffffff url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"%3E%3Cpath fill="%235a1857" d="M10.59.59 6 5.17 1.41.59 0 2l6 6 6-6z"/%3E%3C/svg%3E') no-repeat right 1rem center;
    background-size: 12px 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ymg-filter:focus {
    outline: none;
    border-color: rgba(255, 45, 146, 0.5);
    box-shadow: 0 0 0 4px rgba(255, 45, 146, 0.12);
}

.ymg-gallery__header {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.25rem;
}

.ymg-gallery__intro {
    margin: 0;
    color: #6f6378;
    font-size: 0.98rem;
    line-height: 1.6;
    max-width: 56ch;
}

.ymg-selection-bar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    padding: 1.75rem 2rem;
    border-radius: 22px;
    border: 1px solid rgba(60, 16, 83, 0.08);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 240, 248, 0.92));
    overflow: hidden;
}

.ymg-selection-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 109, 189, 0.18), transparent 60%);
    z-index: 0;
}

.ymg-selection-bar > * {
    position: relative;
    z-index: 1;
}

.ymg-selection-bar.has-selection {
    border-color: rgba(255, 45, 146, 0.28);
    box-shadow: 0 22px 55px rgba(255, 45, 146, 0.16);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 223, 244, 0.94));
}

.ymg-selection-bar.has-error {
    border-color: rgba(220, 38, 38, 0.35);
    box-shadow: 0 22px 55px rgba(220, 38, 38, 0.18);
}

.ymg-selection-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 240px;
}

.ymg-selection-kicker {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
    font-weight: 600;
    color: #a05788;
}

.ymg-selection-status {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-weight: 600;
    color: #361336;
}

.ymg-selection-text {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ymg-selection-label {
    font-size: 1.25rem;
    font-weight: 700;
    color: #361336;
}

.ymg-selection-hint {
    margin: 0;
    font-size: 0.9rem;
    color: #6f6378;
    line-height: 1.5;
    transition: color 0.2s ease;
}

.ymg-selection-hint[data-state="ready"] {
    color: #1a6d53;
}

.ymg-selection-hint[data-state="error"] {
    color: #c73a3a;
    font-weight: 600;
}

.ymg-selection-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff, rgba(255, 223, 244, 0.65));
    border: 3px solid rgba(255, 45, 146, 0.35);
    font-size: 1.2rem;
    box-shadow: 0 14px 34px rgba(255, 45, 146, 0.18);
}

.ymg-selection-bar.has-selection .ymg-selection-count {
    border-color: rgba(255, 45, 146, 0.5);
}

.ymg-selection-bar.has-error .ymg-selection-count {
    border-color: rgba(220, 38, 38, 0.5);
    box-shadow: 0 14px 34px rgba(220, 38, 38, 0.16);
}

.ymg-selection-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.ymg-selection-view,
.ymg-selection-cart {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 999px;
    padding: 0.75rem 1.6rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.ymg-selection-view {
    border: 1px solid rgba(129, 42, 99, 0.3);
    background: rgba(255, 255, 255, 0.9);
    color: #7c2d64;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(129, 42, 99, 0.12);
}

.ymg-selection-view:hover,
.ymg-selection-view:focus {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(129, 42, 99, 0.18);
}

.ymg-selection-cart {
    border: none;
    background: linear-gradient(135deg, #ff2d92, #ff7fbc);
    color: #ffffff;
    box-shadow: 0 16px 40px rgba(255, 45, 146, 0.25);
}

.ymg-selection-cart:hover,
.ymg-selection-cart:focus {
    transform: translateY(-1px);
    box-shadow: 0 20px 45px rgba(255, 45, 146, 0.32);
    color: #ffffff;
}

.ymg-selection-cart.is-disabled {
    background: rgba(111, 99, 120, 0.18);
    color: #6f6378;
    box-shadow: none;
    cursor: not-allowed;
    pointer-events: auto;
}

.ymg-selection-cart.is-loading {
    opacity: 0.65;
    pointer-events: none;
}

.ymg-selection-cart.is-disabled .ymg-selection-action-icon,
.ymg-selection-cart.is-loading .ymg-selection-action-icon {
    background: rgba(255, 255, 255, 0.3);
}

.ymg-selection-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    font-size: 1rem;
}

.ymg-selection-tray[hidden] {
    display: none !important;
}

.ymg-selection-tray {
    border: 1px solid rgba(17, 1, 28, 0.08);
    border-radius: 18px;
    background: #fff9fd;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 22px 60px rgba(17, 1, 28, 0.08);
}

.ymg-selection-tray__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.ymg-selection-tray__header h3 {
    margin: 0;
    font-size: 1.35rem;
    color: #43123a;
}

.ymg-selection-close {
    background: transparent;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: #7a3d58;
}

.ymg-selection-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.ymg-selection-item {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(17, 1, 28, 0.06);
    box-shadow: 0 15px 35px rgba(17, 1, 28, 0.08);
}

.ymg-selection-thumb {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.ymg-selection-meta {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ymg-selection-name {
    margin: 0;
    font-size: 1rem;
    color: #35132f;
}

.ymg-selection-item .ymg-selection-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ymg-selection-preview {
    font-size: 0.85rem;
    text-decoration: none;
    color: #812a63;
    font-weight: 600;
}

.ymg-selection-preview:hover,
.ymg-selection-preview:focus {
    text-decoration: underline;
}

.ymg-selection-remove {
    background: none;
    border: none;
    color: #b83261;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.ymg-selection-remove:hover,
.ymg-selection-remove:focus {
    text-decoration: underline;
}

.ymg-selection-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #7a6477;
    margin: 0;
}

.ymg-selection-tray__actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

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

.ymg-gallery__grid.is-loading::after {
    content: 'Loading…';
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #7a6477;
    font-weight: 500;
}

.ymg-gallery__item {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(17, 1, 28, 0.12);
    border: 1px solid rgba(17, 1, 28, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ymg-gallery__item:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 60px rgba(17, 1, 28, 0.18);
}

.ymg-gallery__link,
.ymg-gallery__link img {
    display: block;
    width: 100%;
    height: 100%;
}

.ymg-gallery__link img {
    object-fit: cover;
    min-height: 240px;
}

.ymg-gallery__select {
    position: absolute;
    inset: auto 1rem 1rem 1rem;
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1.5rem;
    background: rgba(17, 1, 28, 0.8);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.ymg-gallery__select:hover,
.ymg-gallery__select:focus {
    transform: translateY(-2px);
    background: rgba(17, 1, 28, 0.95);
}

.ymg-gallery__select.is-selected {
    background: linear-gradient(135deg, #ff2d92, #ff6fbc);
    box-shadow: 0 15px 40px rgba(255, 45, 146, 0.4);
}

.ymg-gallery__empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #7a6477;
    font-size: 1rem;
}

.ymg-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.ymg-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    background: rgba(255, 45, 146, 0.08);
    padding: 0.5rem;
    border-radius: 999px;
}

.ymg-tab {
    padding: 0.6rem 1.35rem;
    border-radius: 999px;
    text-decoration: none;
    color: #5d2a4c;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.ymg-tab.is-active {
    background: linear-gradient(135deg, #ff2d92, #ff6fbc);
    color: #ffffff;
}

.ymg-tab:not(.is-active):hover {
    background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
    .ymg-gallery {
        padding: 1.75rem;
    }

    .ymg-selection-bar .ymg-selection-actions {
        width: 100%;
        justify-content: stretch;
    }

    .ymg-selection-bar .ymg-selection-actions > * {
        flex: 1 1 48%;
        justify-content: center;
        text-align: center;
    }

    .ymg-selection-items {
        grid-template-columns: 1fr;
    }

    .ymg-gallery__grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .ymg-gallery__link img {
        min-height: 200px;
    }
}
