/* =========================================================
   METAL ROOF COLOUR SELECTOR
   Havelock-style layout
   ========================================================= */

.metal-colour-selector {
    margin-top: 1.5rem;
}

/* Main two-column layout */

.metal-colour-layout {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr);
    gap: 3rem;
    align-items: center;
    max-width: 850px;
    margin: 1.25rem auto 0;
}

/* =========================================================
   PREVIEW IMAGE
   ========================================================= */

.metal-colour-preview {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
    background: #f2f2f2;
    border: 1px solid #d9d9d9;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

.metal-colour-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* =========================================================
   COLOUR INFORMATION / PALETTE
   ========================================================= */

.metal-colour-groups {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metal-colour-groups > h3 {
    margin: 0 0 1.5rem;
    font-size: 1.4rem;
    line-height: 1.2;
    color: #173b42;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.metal-colour-group {
    margin-bottom: 1.5rem;
}

.metal-colour-group h4 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #222;
}

/* =========================================================
   SMALL COLOUR PALETTE
   ========================================================= */

.metal-colour-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.metal-colour-option {
    position: relative;
    width: 34px;
    height: 34px;
    padding: 3px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;

    transition:
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.metal-colour-option:hover {
    transform: scale(1.12);
    border-color: #c9a227;
    z-index: 5;
}

.metal-colour-option:has(input:checked) {
    border-color: #c9a227;
    box-shadow:
        0 0 0 2px rgba(201, 162, 39, 0.25);
}

.metal-colour-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* =========================================================
   COLOUR SWATCH
   ========================================================= */

.metal-colour-swatch {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;

    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.18);

    background-size: cover;
    background-position: center;
}

/* =========================================================
   HOVER NAME
   ========================================================= */

.metal-colour-name {
    position: absolute;

    left: 50%;
    bottom: calc(100% + 9px);

    transform: translateX(-50%) translateY(4px);

    width: max-content;
    max-width: 180px;

    padding: 6px 9px;

    border-radius: 5px;

    background: #222;
    color: #fff;

    font-size: 0.72rem;
    line-height: 1.2;
    font-weight: 500;
    text-align: center;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        visibility 0.15s ease;

    z-index: 20;
}

.metal-colour-option:hover .metal-colour-name {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Tooltip arrow */

.metal-colour-name::after {
    content: "";

    position: absolute;
    left: 50%;
    top: 100%;

    transform: translateX(-50%);

    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #222;
}

/* =========================================================
   DISCLAIMER
   ========================================================= */

.metal-colour-disclaimer {
    margin-top: 0.5rem;

    font-size: 0.75rem;
    line-height: 1.5;

    color: #777;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 800px) {

    .metal-colour-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
        max-width: 600px;
    }

    .metal-colour-preview {
        max-width: 400px;
    }

    .metal-colour-groups {
        width: 100%;
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 500px) {

    .metal-colour-layout {
        gap: 1.5rem;
    }

    .metal-colour-preview {
        max-width: 320px;
    }

    .metal-colour-groups > h3 {
        font-size: 1.2rem;
        margin-bottom: 1.25rem;
    }

    .metal-colour-option {
        width: 32px;
        height: 32px;
    }

    .metal-colour-grid {
        gap: 7px;
    }
}