﻿/* MadeToMeasureFrames.css */
@import url("style.css");

/* Scope box-sizing to avoid global side-effects */
.m2m-page,
.m2m-page * {
    box-sizing: border-box;
}

.m2m-page {
    padding: 60px 20px 100px;
    font: 16px/1.4 "Titillium Web", Tahoma, Arial, sans-serif;
    width: 100%;
}

.m2m-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 56px;
    align-items: flex-start;
    min-width: 0;
}

.m2m-config {
    flex: 0 0 50%;
    max-width: 520px;
    min-width: 0;
}

.m2m-preview {
    flex: 1 1 45%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding-top: 24px;
}

.m2m-preview-frame {
    width: 440px;
    max-width: 100%;
    height: 480px;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* JS sets exact width/height for correct aspect ratio */
.m2m-preview-box {
    position: relative;
    margin: 0 auto;
    overflow: hidden;
}

.m2m-title-block h1 {
    font-size: 38px;
    font-weight: 700;
    color: #1e306e;
    margin: 0 0 8px;
}

.m2m-trust {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    color: #1e306e;
    font-weight: 600;
    font-size: 15px;
    justify-content: center;
}

    .m2m-trust img {
        height: 20px;
        max-width: 100%;
    }

.m2m-accordion {
    margin-top: 32px;
    border-radius: 6px;
}

.m2m-accordion-item + .m2m-accordion-item {
    margin-top: 8px;
}

.m2m-accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border: 1px solid #d9deee;
    background: #edf0fb;
    cursor: pointer;
    font-size: 16px;
    color: #1e306e;
    min-width: 0;
}

.m2m-acc-number {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex: 0 0 auto;
}

.m2m-acc-label {
    flex: 1;
    min-width: 0;
}

.m2m-acc-caret {
    transition: transform 0.2s ease;
    flex: 0 0 auto;
}

.m2m-accordion-content {
    border: 1px solid #d9deee;
    border-top: none;
    padding: 14px;
    display: none;
    background: #fff;
    font-size: 15px;
}

.m2m-accordion-item.is-open .m2m-accordion-content {
    display: block;
}

.m2m-accordion-item.is-open .m2m-acc-caret {
    transform: rotate(180deg);
}

.m2m-subtitle {
    font-weight: 600;
    color: #1e306e;
    margin: 0 0 10px;
}

.m2m-size-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.m2m-size-input {
    flex: 1;
    min-width: 0;
    padding: 10px;
    border: 1px solid #ccd2ea;
    border-radius: 4px;
    text-align: center;
    font-size: 15px;
}

.m2m-size-multiply {
    font-size: 18px;
    color: #666;
    flex: 0 0 auto;
}

.m2m-units-row {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    font-size: 14px;
    flex-wrap: wrap;
}

.m2m-select {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccd2ea;
}

.m2m-frame-list {
    margin-top: 16px;
    max-height: 260px;
    overflow-y: auto;
    min-width: 0;
    -webkit-overflow-scrolling: touch;
}

.m2m-frame-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid #f1f1f1;
    background: #fff;
    cursor: pointer;
    min-width: 0;
}

    .m2m-frame-item + .m2m-frame-item {
        margin-top: 8px;
    }

    .m2m-frame-item.is-selected {
        outline: 2px solid #3fbfbf;
    }

.m2m-frame-thumb {
    width: 90px;
    flex: 0 0 auto;
    max-width: 100%;
    height: auto;
}

.m2m-frame-info {
    min-width: 0;
}

    .m2m-frame-info h3 {
        font-size: 16px;
        margin: 0 0 4px;
        color: #1e306e;
    }

.m2m-frame-meta {
    font-size: 13px;
}

    .m2m-frame-meta span + span {
        margin-left: 6px;
    }

.m2m-frame-ref {
    font-size: 11px;
    color: #777;
    margin-top: 4px;
}

.mt-small {
    margin-top: 12px;
}

.m2m-radio-group label {
    display: block;
    margin-top: 6px;
}

.m2m-border-colours {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.m2m-border-ui {
    display: none;
    margin-top: 8px;
}

.m2m-border-swatch {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 2px solid transparent;
    background: #000;
    cursor: pointer;
}

    .m2m-border-swatch:nth-child(2) {
        background: #fdfdfb;
    }

    .m2m-border-swatch:nth-child(3) {
        background: #fbeed6;
    }

    .m2m-border-swatch:nth-child(4) {
        background: #d9d8c7;
    }

    .m2m-border-swatch.is-selected {
        border-color: #3fbfbf;
    }

.m2m-radio-list label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    gap: 10px;
    flex-wrap: wrap;
}

.m2m-price-note {
    margin-left: 12px;
    font-size: 13px;
    color: #777;
}

.m2m-accessory {
    margin-top: 8px;
}

    .m2m-accessory label {
        display: flex;
        align-items: center;
        gap: 8px;
        justify-content: space-between;
        flex-wrap: wrap;
    }

.m2m-acc-name {
    flex: 1;
    margin-left: 6px;
    min-width: 0;
}

.m2m-acc-price {
    font-size: 13px;
    color: #777;
    margin-left: 8px;
}

.m2m-acc-tag {
    font-size: 12px;
    color: #0085b8;
    white-space: normal;
}

.m2m-preview-mount {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 0;
    pointer-events: none;
    transition: width 0.2s, height 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.m2m-preview-mount-outer {
    z-index: 1;
}

.m2m-preview-mount-inner {
    z-index: 2;
}

.m2m-preview-artwork {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #e9c9b8;
    border-radius: 0;
    pointer-events: none;
    transition: width 0.2s, height 0.2s;
    z-index: 3;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

    .m2m-preview-artwork.no-border {
        box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.22), 0 10px 18px rgba(0, 0, 0, 0.22);
    }

    .m2m-preview-artwork::before {
        content: "";
        position: absolute;
        inset: -5%;
        border-radius: inherit;
        pointer-events: none;
        mix-blend-mode: screen;
        opacity: 0;
        transition: opacity 0.25s ease;
        background: linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 35%, rgba(255,255,255,0.55) 48%, rgba(255,255,255,0.15) 58%, rgba(255,255,255,0) 70%, rgba(255,255,255,0) 100%) 0 0/140% 140% no-repeat, linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 25%, rgba(255,255,255,0.45) 37%, rgba(255,255,255,0.1) 47%, rgba(255,255,255,0) 60%, rgba(255,255,255,0) 100%) -15% 0/140% 140% no-repeat, linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 45%, rgba(255,255,255,0.4) 57%, rgba(255,255,255,0.12) 66%, rgba(255,255,255,0) 78%, rgba(255,255,255,0) 100%) 15% 0/140% 140% no-repeat;
    }

    .m2m-preview-artwork::after {
        content: "";
        position: absolute;
        top: -10%;
        right: -5%;
        width: 30%;
        height: 120%;
        pointer-events: none;
        border-radius: inherit;
        background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.18) 40%, rgba(255,255,255,0) 90%);
        opacity: 0;
        transform: rotate(2deg);
        mix-blend-mode: screen;
        transition: opacity 0.25s;
    }

    .m2m-preview-artwork.has-glaze::before {
        opacity: 0.9;
    }

.m2m-preview-summary {
    margin-top: 12px;
    text-align: center;
}

.m2m-price {
    font-size: 34px;
    font-weight: 700;
    color: #1e306e;
    margin-bottom: 10px;
}

.m2m-add-button {
    display: inline-block;
    margin: 0 auto;
    padding: 12px 40px;
    border-radius: 4px;
    border: none;
    background: #1e306e;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

    .m2m-add-button:hover {
        background: #142253;
    }

.m2m-vat-note {
    margin-top: 8px;
    font-size: 13px;
    color: #00a57a;
}

.m2m-config-summary {
    margin-top: 12px;
    font-size: 13px;
    color: #555;
}

.m2m-enlarge-link {
    margin-top: 10px;
    margin-bottom: 4px;
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #0074c8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.m2m-size-warning {
    padding: 20px;
    text-align: center;
}

.m2m-frame-border {
    position: absolute;
    inset: 0;
    pointer-events: none;
    --t: var(--frame-thickness, 40px);
    --tex: var(--frame-texture);
}

    .m2m-frame-border::after {
        content: "";
        position: absolute;
        inset: calc(var(--t) - 1px);
        pointer-events: none;
        z-index: 9;
        box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18), inset 0 12px 20px rgba(0, 0, 0, 0.38), inset 10px 0 18px rgba(0, 0, 0, 0.30), inset -10px 0 18px rgba(0, 0, 0, 0.30), inset 0 -8px 14px rgba(0, 0, 0, 0.22);
    }

.frame-edge {
    position: absolute;
    z-index: 10;
    pointer-events: none;
    filter: brightness(0.97);
}

.frame-edge-left,
.frame-edge-right {
    top: -1px;
    bottom: -1px;
    width: var(--t);
    overflow: hidden;
}

    .frame-edge-left::before,
    .frame-edge-right::before {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: var(--t);
        height: 2000px;
        background-image: var(--tex);
        background-repeat: repeat-y;
        background-size: 100% auto;
        transform-origin: center;
    }

    .frame-edge-left::before {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    .frame-edge-right::before {
        transform: translate(-50%, -50%) rotate(180deg);
    }

.frame-edge-left {
    left: 0;
    clip-path: polygon(0 0, 100% var(--t), 100% calc(100% - var(--t)), 0 100%);
}

.frame-edge-right {
    right: 0;
    clip-path: polygon(0 var(--t), 100% 0, 100% 100%, 0 calc(100% - var(--t)));
}

.frame-edge-top,
.frame-edge-bottom {
    left: -1px;
    right: -1px;
    height: var(--t);
    overflow: hidden;
}

.frame-edge-top {
    top: 0;
}

.frame-edge-bottom {
    bottom: 0;
}

    .frame-edge-top::before,
    .frame-edge-bottom::before {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: var(--t);
        height: 2000px;
        background-image: var(--tex);
        background-repeat: repeat-y;
        background-size: 100% auto;
        transform-origin: center;
    }

.frame-edge-top::before {
    transform: translate(-50%, -50%) rotate(270deg) scaleX(-1);
}

.frame-edge-bottom::before {
    transform: translate(-50%, -50%) rotate(90deg) scaleX(-1);
}

.frame-edge-top {
    clip-path: polygon(0 0, 100% 0, calc(100% - var(--t)) 100%, var(--t) 100%);
}

.frame-edge-bottom {
    clip-path: polygon(var(--t) 0, calc(100% - var(--t)) 0, 100% 100%, 0 100%);
}

.m2m-advanced-toggle {
    margin-top: 10px;
    background: none;
    border: none;
    color: #0074c8;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
}

.m2m-advanced-border {
    margin-top: 10px;
    border: 1px solid #d9deee;
    border-radius: 6px;
    padding: 10px;
    background: #fff;
}

.m2m-adv-row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    min-width: 0;
}

    .m2m-adv-row label {
        flex: 1;
        font-size: 13px;
        color: #1e306e;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

.m2m-adv-input {
    width: 90px;
    padding: 6px;
    border: 1px solid #ccd2ea;
    border-radius: 4px;
    text-align: center;
}

@media (max-width: 1024px) {
    .m2m-page {
        padding: 40px 20px 80px;
        overflow-x: hidden;
    }

    .m2m-inner {
        max-width: none;
        flex-direction: column;
        gap: 24px;
    }

    .m2m-config {
        width: 100%;
        max-width: 720px;
        margin-left: auto;
        margin-right: auto;
    }

    .m2m-title-block {
        max-width: 720px;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    .m2m-preview {
        width: 100%;
        align-items: center;
    }
}

@media (max-width: 767px) {
    .m2m-page {
        padding: 28px 14px 70px;
    }

    .m2m-inner {
        max-width: 100%;
        gap: 20px;
    }

    .m2m-preview-frame {
        width: 100%;
        max-width: 440px;
        margin-left: auto;
        margin-right: auto;
    }

    .m2m-size-row {
        flex-wrap: wrap;
        gap: 10px;
    }

    .m2m-size-input {
        min-width: 120px;
        flex: 1 1 140px;
    }

    .m2m-frame-list {
        max-height: 320px;
    }

    .m2m-frame-item {
        gap: 10px;
        padding: 10px;
    }

    .m2m-frame-thumb {
        width: 74px;
    }

    .m2m-add-button {
        width: 100%;
        max-width: 420px;
    }

    .m2m-price {
        font-size: 30px;
    }

    .m2m-adv-row {
        flex-direction: column;
        gap: 8px;
    }

    .m2m-adv-input {
        width: 110px;
    }

    .m2m-acc-tag {
        white-space: normal;
    }
}

@media (max-width: 360px) {
    .m2m-page {
        padding: 22px 12px 60px;
    }

    .m2m-title-block h1 {
        font-size: 30px;
    }

    .m2m-accordion-header {
        padding: 12px 14px;
    }
}
