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

/* APF scope: keep box-sizing local to avoid global regressions */
.apf-page,
.apf-page * {
    box-sizing: border-box;
}

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

.apf-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}

.apf-results-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.apf-title {
    margin: 0;
    color: #1e306e;
    font-size: 32px;
    font-weight: 700;
}

.apf-subtitle {
    color: #777;
    font-size: 13px;
    margin-top: 4px;
}

.apf-sort {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

    .apf-sort label {
        font-size: 13px;
        color: #666;
    }

    .apf-sort select {
        padding: 8px 10px;
        min-width: 240px;
        border: 1px solid #d9d9d9;
        border-radius: 4px;
        background: #fff;
    }

.apf-filters h3 {
    margin: 0 0 14px;
    font-size: 18px;
    color: #1e306e;
}

.apf-filter-block {
    border: 1px solid #e8e8e8;
    background: #fff;
    padding: 12px;
    margin-bottom: 14px;
}

.apf-filter-title {
    font-weight: 700;
    margin-bottom: 10px;
    color: #1e306e;
    font-size: 14px;
}

/* Prevent input overlap on narrow sidebars */
.apf-size-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

    .apf-size-row input {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding: 10px;
        border: 1px solid #d9d9d9;
        border-radius: 4px;
        text-align: center;
        font-size: 14px;
    }

.apf-units {
    margin: 10px 0 12px;
    display: flex;
    gap: 14px;
    font-size: 13px;
    color: #333;
}

.apf-update-btn {
    width: 100%;
    padding: 10px;
    border: 1px solid #1e306e;
    background: #fff;
    color: #1e306e;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

    .apf-update-btn:hover {
        background: #f3f5ff;
    }

.apf-help-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    color: #0074c8;
    text-decoration: none;
}

    .apf-help-link:hover {
        text-decoration: underline;
    }

.apf-radio-list {
    display: grid;
    gap: 8px;
    font-size: 13px;
    color: #333;
}

    .apf-radio-list label {
        display: flex;
        align-items: center;
        gap: 10px;
        cursor: pointer;
    }

    .apf-radio-list input {
        transform: translateY(1px);
    }

.apf-select {
    width: 100%;
    margin-top: 10px;
    padding: 9px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
}

.apf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.apf-card {
    border: 1px solid #e8e8e8;
    background: #fff;
}

.apf-preview {
    background: #f0f0f0;
    padding: 10px;
}

/* JS sets explicit width/height so preview math stays stable */
.apf-preview-box {
    width: 100%;
    position: relative;
    background: #fff;
    overflow: hidden;
    margin: 0 auto;
}

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

.apf-preview-mount-outer {
    z-index: 2;
}

.apf-preview-mount-inner {
    z-index: 3;
}

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

    .apf-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);
    }

    /* Glass sheen effect */
    .apf-preview-artwork::before {
        content: "";
        position: absolute;
        inset: -5%;
        pointer-events: none;
        mix-blend-mode: screen;
        opacity: 0;
        transition: opacity .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;
    }

    .apf-preview-artwork::after {
        content: "";
        position: absolute;
        top: -10%;
        right: -5%;
        width: 30%;
        height: 120%;
        pointer-events: none;
        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 .25s ease;
    }

    .apf-preview-artwork.has-glaze::before {
        opacity: .9;
    }

    .apf-preview-artwork.has-glaze::after {
        opacity: .9;
    }

.apf-frame-border {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    --t: var(--frame-thickness, 18px);
    --tex: var(--frame-texture);
}

    /* Inner shadow gives depth; keep unchanged to match original look */
    .apf-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);
    }

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

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

    .apf-frame-edge-left::before,
    .apf-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;
    }

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

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

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

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

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

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

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

    .apf-frame-edge-top::before,
    .apf-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;
    }

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

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

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

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

.apf-card-body {
    padding: 12px;
}

.apf-card-title {
    margin: 2px 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: #222;
}

.apf-card-fit {
    font-size: 13px;
    color: #0074c8;
    margin-bottom: 6px;
}

.apf-card-meta {
    font-size: 12px;
    color: #777;
    margin-bottom: 10px;
}

.apf-price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
}

.apf-price {
    font-size: 20px;
    font-weight: 700;
    color: #222;
}

.apf-stock {
    font-size: 12px;
    color: #0a9a56;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

    .apf-stock i {
        font-size: 12px;
    }

.apf-save-row {
    margin-top: 6px;
    font-size: 12px;
    color: #e11d2e;
}

    .apf-save-row s {
        color: #777;
        margin-left: 6px;
    }

.apf-qty-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    color: #0074c8;
    text-decoration: none;
}

    .apf-qty-link:hover {
        text-decoration: underline;
    }

.apf-actions {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.apf-btn {
    width: 100%;
    border: 0;
    border-radius: 3px;
    padding: 10px 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.apf-btn-basket {
    background: #22a648;
    color: #fff;
}

    .apf-btn-basket:hover {
        filter: brightness(0.96);
    }

.apf-btn-customise {
    background: #0a72e8;
    color: #fff;
}

    .apf-btn-customise:hover {
        filter: brightness(0.96);
    }

.apf-ref {
    margin-top: 10px;
    font-size: 11px;
    color: #999;
    text-align: center;
}

@media (max-width: 992px) {
    .apf-inner {
        grid-template-columns: 1fr;
    }

    .apf-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .apf-grid {
        grid-template-columns: 1fr;
    }

    .apf-title {
        font-size: 26px;
    }

    .apf-sort select {
        min-width: 180px;
    }
}
