/* Modern product attribute selector — Martfury override */

.product-attributes {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 0.5rem 0 1.25rem;
    padding: 1rem 1.1rem 1.15rem;
    background: linear-gradient(180deg, #f7f8fa 0%, #f3f4f6 100%);
    border: 1px solid #e6e8ec;
    border-radius: 12px;
}

.product-attr-modern.product__attribute,
.product-attributes .product__attribute.product-attr-modern {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.product-attr-modern > * {
    flex-basis: auto;
    max-width: none;
}

.product-attr-modern .attribute-name-wrap {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.product-attr-modern .attribute-name {
    display: block;
    margin: 0;
    max-width: none !important;
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.3;
    color: #1a1a1a;
}

.product-attr-modern .attribute-values {
    width: 100%;
}

.product-attr-modern .text-swatch,
.product-attr-modern .color-swatch {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.product-attr-modern .text-swatch > li,
.product-attr-modern .color-swatch > li {
    display: block;
    margin: 0 !important;
    vertical-align: top;
}

.product-attr-modern .text-swatch label,
.product-attr-modern .attribute-swatch-item label {
    display: block;
    margin: 0;
    cursor: pointer;
}

.product-attr-modern .text-swatch input[type="radio"],
.product-attr-modern .text-swatch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

.product-attr-modern .attr-chip,
.product-attr-modern .text-swatch span {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.25rem;
    min-height: 2.5rem;
    padding: 0.45rem 0.85rem;
    margin: 0;
    border: 1.5px solid #cfd3da;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
    color: #222;
    font-size: 0.875rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    letter-spacing: 0;
    overflow: visible;
    cursor: pointer;
    user-select: none;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.product-attr-modern .attr-chip:hover,
.product-attr-modern .text-swatch li:not(.pe-none) label:hover .attr-chip,
.product-attr-modern .text-swatch li:not(.pe-none) label:hover span {
    border-color: #9aa1ad;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.08);
    transform: translateY(-1px);
}

.product-attr-modern .text-swatch input:focus-visible ~ .attr-chip,
.product-attr-modern .text-swatch input:focus-visible ~ span {
    outline: 2px solid var(--color-1st, #fcb800);
    outline-offset: 2px;
}

/* Selected */
.product-attr-modern .text-swatch input:checked ~ .attr-chip,
.product-attr-modern .text-swatch input:checked ~ span {
    border-color: var(--color-1st, #fcb800);
    border-width: 2px;
    background: #fff6d6;
    background: color-mix(in srgb, var(--color-1st, #fcb800) 18%, #fff);
    color: #111;
    font-weight: 700;
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--color-1st, #fcb800) 35%, transparent),
        0 2px 10px rgba(16, 24, 40, 0.08);
    padding-right: 1.65rem;
}

.product-attr-modern .text-swatch input:checked ~ .attr-chip::before,
.product-attr-modern .text-swatch input:checked ~ span::before {
    content: none;
    border: 0;
}

.product-attr-modern .text-swatch input:checked ~ .attr-chip::after,
.product-attr-modern .text-swatch input:checked ~ span::after {
    content: "";
    position: absolute;
    right: 0.55rem;
    top: 50%;
    width: 0.45rem;
    height: 0.75rem;
    margin-top: -0.1rem;
    border: solid #111;
    border-width: 0 2px 2px 0;
    transform: translateY(-50%) rotate(45deg);
    color: inherit;
    font-size: 0;
    font-family: inherit;
    overflow: visible;
    bottom: auto;
}

/* Unavailable */
.product-attr-modern .attribute-swatch-item.pe-none {
    cursor: not-allowed !important;
}

.product-attr-modern .attribute-swatch-item.pe-none > div {
    pointer-events: none !important;
}

.product-attr-modern .text-swatch .attribute-swatch-item.pe-none .attr-chip,
.product-attr-modern .text-swatch .attribute-swatch-item.pe-none span {
    color: #9a9fa8;
    background: #f1f2f4;
    border-style: dashed;
    border-color: #c5cad3;
    opacity: 1;
    box-shadow: none;
    cursor: not-allowed;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    text-decoration-color: #b0b5bd;
}

.product-attr-modern .text-swatch .attribute-swatch-item.pe-none .attr-chip::before,
.product-attr-modern .text-swatch .attribute-swatch-item.pe-none .attr-chip::after,
.product-attr-modern .text-swatch .attribute-swatch-item.pe-none span::before,
.product-attr-modern .text-swatch .attribute-swatch-item.pe-none span::after {
    content: none !important;
    border: 0 !important;
}

@media (max-width: 575px) {
    .product-attributes {
        padding: 0.85rem 0.9rem 1rem;
        border-radius: 10px;
    }

    .product-attr-modern .attr-chip,
    .product-attr-modern .text-swatch span {
        min-height: 2.75rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.9375rem;
    }
}
