@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Roboto:wght@400&display=swap');

/* ============================================================
   Art View Popup — Figma design adapted for real viewports
   Popup renders as a centered modal, NOT full-screen.
   ============================================================ */

/* ---------- Overlay (backdrop) ---------- */

#overlay {
    position: fixed;
    display: none;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    overflow: hidden;
    align-items: center;
    justify-content: center;
}

/* ---------- Popup Shell (the modal box) ---------- */

.form-popup {
    display: none;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000000;
    padding: 0;
    position: relative;
    border-radius: 6px;
    width: 95vw;
    max-width: 1400px;
    height: 90vh;
    flex-direction: column;
    overflow: hidden;
}

/* ---------- Header ---------- */

.avp-header {
    flex-shrink: 0;
    position: relative;
    text-align: center;
    padding: 20px 48px 12px;
}

.avp-header__title {
    font-family: 'Inter', sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.56px;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.avp-header__close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: #f4f4f7;
    border: 1px solid #2c2c2c;
    width: 36px;
    height: 36px;
    cursor: pointer;
    padding: 0;
    border-radius: 8px;
    transition: background-color .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avp-header__close:hover {
    background: #e0e0e3;
}

.avp-header__close svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ---------- Step Content Wrapper ---------- */

.avp-body {
    flex: 1 1 auto;
    overflow-y: auto;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 0 40px 20px;
    color: #fff;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.avp-body::-webkit-scrollbar {
    display: none;
}

.avp-step {
    display: none;
}

.avp-step.avp-step--active {
    display: block;
}

/* ---------- Step Headings ---------- */

.avp-step__heading {
    font-family: 'Roboto', sans-serif;
    font-size: 36px;
    font-weight: 400;
    color: #fff;
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: -0.25px;
    line-height: 1.2;
}

.avp-step__subtext {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 20px;
    line-height: 1.4;
}

/* ---------- Upload Zone ---------- */

.avp-upload-zone {
    border: 1px dashed #d92222;
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    margin-bottom: 12px;
    position: relative;
    background: transparent;
    transition: border-color .25s;
}

.avp-upload-zone:hover {
    border-color: #ff3333;
}

.avp-upload-zone img {
    max-width: 100%;
    max-height: calc(90vh - 380px);
    object-fit: contain;
    margin-bottom: 12px;
}

.avp-upload-zone__hidden-input {
    display: none !important;
}

/* ---------- Buttons ---------- */

.avp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    padding: 0 16px;
    transition: background .2s, color .2s, border-color .2s;
    border-radius: 8px;
    line-height: 1;
    height: 36px;
    min-width: 160px;
    box-sizing: border-box;
}

.avp-btn--white {
    background: #f4f4f7;
    color: #2c2c2c;
    border: 1px solid #2c2c2c;
}

.avp-btn--white:hover {
    background: #e0e0e3;
}

.avp-btn--outline {
    background: #f4f4f7;
    color: #2c2c2c;
    border: 1px solid #2c2c2c;
}

.avp-btn--outline:hover {
    background: #e0e0e3;
}

.avp-btn--red {
    background: #d92222;
    color: #ffffff;
    border: 1px solid #d92222;
}

.avp-btn--red:hover {
    background: #c01e1e;
    border-color: #c01e1e;
}

.avp-btn--dark {
    background: transparent;
    color: #fff;
    border: 1px solid #666;
    min-width: auto;
}

.avp-btn--dark:hover {
    border-color: #fff;
}

.avp-btn--block {
    display: flex;
    width: 200px;
    margin: 0 auto;
}

/* ---------- Upload helper text ---------- */

.avp-upload-helper {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-top: 12px;
}

/* ---------- Step 2 – Dimension Form ---------- */

.avp-step2-layout {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    margin-top: 8px;
}

.avp-step2-form {
    --avp-label-col: 55px;
    --avp-row-gap: 10px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.avp-dim-row {
    display: flex;
    align-items: center;
    gap: var(--avp-row-gap);
    margin-bottom: 12px;
}

.avp-dim-row__label {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #fff;
    min-width: var(--avp-label-col);
    text-align: right;
}

.avp-dim-row__input,
.avp-dim-row__select {
    height: 36px;
    background: #222;
    border: 1px solid #555;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    padding: 0 10px;
    border-radius: 8px;
    -webkit-appearance: none;
    appearance: none;
}

.avp-dim-row__input {
    width: 80px;
    text-align: center;
}

.avp-dim-row__select {
    width: 75px;
    text-align: center;
    background-image: url(/wp-content/themes/kubio-child/assets/carrot.svg);
    background-repeat: no-repeat;
    background-position: calc(100% - 8px) center;
    padding-right: 24px;
}

#secondStepBt {
    align-self: stretch;
    min-width: 0;
    margin-left: calc(var(--avp-label-col) + var(--avp-row-gap));
}

.avp-dim-row__input::placeholder {
    color: rgba(255,255,255,.5);
}

.avp-step2-preview {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avp-step2-preview img {
    max-width: 100%;
    max-height: calc(90vh - 320px);
    object-fit: contain;
}

/* ---------- Step 3 – Loader ---------- */

.avp-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 40px 0;
    flex: 1;
}

.avp-loader__spinner {
    width: 120px;
    height: 120px;
    object-fit: contain;
    animation: avpSpin 2.5s linear infinite;
}

@keyframes avpSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ---------- Step 4 – Framed Art Result ---------- */

.avp-framed-result {
    text-align: center;
}

.avp-framed-result__image {
    max-width: 100%;
    max-height: calc(90vh - 340px);
    object-fit: contain;
    margin: 0 auto 12px;
    display: block;
}

.avp-frame-caption {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    margin: 0;
    line-height: 1.4;
}

.avp-frame-sku {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin: 2px 0 14px;
}

.avp-action-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap;
    margin-top: 6px;
}

.avp-action-row .avp-btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: 0 !important;
}

#generatePDF {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 1 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    height: 36px !important;
    line-height: 1 !important;
    background: #d92222 !important;
    background-color: #d92222 !important;
    color: #ffffff !important;
    border: 1px solid #d92222 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    padding: 0 16px !important;
    border-radius: 8px !important;
    margin-top: 0 !important;
    text-transform: uppercase !important;
}

/* ---------- Step 5 – Upload Wall ---------- */

.avp-wall-example {
    max-width: 280px;
    max-height: calc(90vh - 380px);
    margin: 0 auto 16px;
    display: block;
    border-radius: 2px;
    object-fit: contain;
}

/* ---------- Step 6 – Measurement ---------- */

.avp-measurement-area {
    text-align: center;
    margin-bottom: 12px;
}

.avp-measurement-area__instruction {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 12px;
    line-height: 1.3;
}

.avp-measure-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.avp-measure-controls__label {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #fff;
}

.avp-measure-controls__input {
    height: 36px;
    width: 90px;
    background: #222;
    border: 1px solid #555;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    padding: 0 10px;
    text-align: center;
    border-radius: 8px;
}

.avp-canvas-wrap {
    text-align: center;
    margin: 0 auto;
}

.avp-canvas-wrap canvas {
    max-width: 100%;
    max-height: calc(90vh - 340px);
    height: auto !important;
    display: block;
    margin: 0 auto;
}

/* ---------- Step 7 – Done ---------- */

.avp-done-canvas {
    text-align: center;
    margin-bottom: 8px;
}

.avp-done-canvas canvas {
    max-width: 100%;
    max-height: calc(90vh - 340px);
    height: auto !important;
    display: block;
    margin: 0 auto;
}

/* ---------- Bottom Bar ---------- */

.avp-bottom-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 40px;
    background: rgba(0, 0, 0, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    border-radius: 0 0 6px 6px;
}

.avp-bottom-bar--hidden {
    display: none !important;
}

.avp-bottom-bar__back {
    position: absolute;
    left: 40px;
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 0;
    line-height: 1.2;
}

.avp-bottom-bar__back:hover {
    text-decoration: underline;
}

.avp-bottom-bar__back--hidden {
    display: none;
}

/* ---------- Utility classes used in old markup ---------- */

.text-white {
    color: #fff !important;
}

.margin-auto {
    margin: auto !important;
}

.step-heading1 {
    color: #fff !important;
    padding-bottom: 0 !important;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
}

input#insertArtImage_artFile {
    display: none !important;
}

img#imageArtWorkWithFrame {
    max-width: 100%;
    max-height: calc(90vh - 340px);
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Remove button styling */
button#removeArtworkImg,
button#removeArtViewWallImg {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    font-size: 13px;
    cursor: pointer;
    margin-top: 4px;
    padding: 4px 8px;
    min-width: auto;
}

button#removeArtworkImg:hover,
button#removeArtViewWallImg:hover {
    color: #fff;
}

button#removeArtViewWallImg:before,
#modalPopu button#removeArtworkImg:before {
    content: '';
    background: url(/wp-content/themes/kubio-child/assets/close-btn.svg);
    width: 10px;
    height: 10px;
    background-size: contain;
    position: relative;
    display: inline-block;
    background-repeat: no-repeat;
    background-position: center;
    right: 4px;
}

.carousel-indicators {
    display: none !important;
}

.carousel-item {
    display: none;
}

.carousel-item.avp-step--active {
    display: block;
}

/* ---------- Error Modal ---------- */

.heading-icon {
    padding: 15px;
}

/* ---------- Custom select ---------- */

.custom-select {
    width: 75px;
    height: 36px;
    border: 1px solid #555;
    background-color: #222;
    color: white;
    font-size: 14px;
    border-radius: 8px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url(/wp-content/themes/kubio-child/assets/carrot.svg);
    background-repeat: no-repeat;
    background-position: calc(100% - 8px) center;
    padding: 0 24px 0 10px;
    text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .form-popup {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        max-width: none;
    }

    .avp-header {
        padding: 16px 16px 10px;
    }

    .avp-header__title {
        font-size: 20px;
    }

    .avp-header__close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
    }

    .avp-step__heading {
        font-size: 26px;
    }

    .avp-step__subtext {
        font-size: 15px;
        margin-bottom: 14px;
    }

    .avp-body {
        padding: 0 16px 16px;
    }

    .avp-step2-layout {
        flex-direction: column;
        gap: 20px;
    }

    .avp-step2-form {
        --avp-label-col: 50px;
        --avp-row-gap: 8px;
        width: 100%;
        max-width: 360px;
    }

    .avp-step2-preview {
        width: 100%;
    }

    .avp-step2-preview img {
        max-height: 180px;
    }

    .avp-action-row {
        flex-direction: column;
        gap: 8px;
    }

    .avp-action-row .avp-btn {
        width: 100%;
        max-width: 260px;
    }

    .avp-upload-zone {
        min-height: 200px;
        padding: 20px 16px;
    }

    .avp-upload-zone img {
        max-height: calc(100vh - 340px);
    }

    .avp-framed-result__image,
    img#imageArtWorkWithFrame {
        max-height: calc(100vh - 320px);
    }

    .avp-canvas-wrap canvas,
    .avp-done-canvas canvas {
        max-height: calc(100vh - 320px);
    }

    .avp-measure-controls {
        flex-direction: column;
        gap: 8px;
    }

    .avp-bottom-bar {
        padding: 10px 16px;
        border-radius: 0;
    }

    .avp-bottom-bar__back {
        left: 16px;
        font-size: 15px;
    }

    .avp-btn {
        min-width: 140px;
        font-size: 13px;
    }

    .avp-btn--block {
        width: 180px;
    }
}

@media (min-width: 769px) {
    .avp-canvas-wrap canvas,
    .avp-done-canvas canvas {
        max-width: 90%;
    }
}

/* ---------- Shared hidden download dropdown (preserved for JS) ---------- */

.drp1 {
    width: 100%;
    height: 50px;
    padding: 10px;
    margin: 15px 0;
    border: 1px solid #555;
    background: #222;
    color: #fff;
    font-size: 15px;
    border-radius: 0;
}

div#shareSocial h3,
div#shareSocialMedia h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    color: #fff;
}

p.frame-caption {
    font-size: 15px;
    line-height: 1.4;
    text-align: center;
    color: rgba(255,255,255,.85);
    margin: 0;
}

.frame-sku {
    text-align: center;
    font-size: 14px;
    font-weight: 400;
    color: rgba(255,255,255,.6);
}

p.text-mute {
    opacity: .6;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-style: italic;
}

/* ---------- Quote Form Panel (left of framed art) ---------- */

.avp-quote-overlay {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 320px;
    background: rgba(255, 255, 255, 0.97);
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px 28px;
    border-radius: 6px 0 0 6px;
    color: #2c2c2c;
    box-sizing: border-box;
}

.avp-quote-overlay h4 {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #2c2c2c;
    line-height: 1.3;
}

.avp-quote-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 4px;
}

.avp-quote-close:hover {
    color: #000;
}

.avp-quote-overlay input[type="text"],
.avp-quote-overlay input[type="email"],
.avp-quote-overlay textarea {
    width: 100%;
    background: #fff;
    border: 1px solid #bbb;
    padding: 9px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    border-radius: 4px;
    margin-bottom: 6px;
    color: #2c2c2c;
    box-sizing: border-box;
}

.avp-quote-overlay textarea {
    height: 100px;
    resize: vertical;
}

.avp-quote-overlay input::placeholder,
.avp-quote-overlay textarea::placeholder {
    color: #999;
}

.avp-quote-overlay .avp-btn--get-quote {
    display: block;
    width: 100%;
    background: #d92222;
    color: #fff;
    border: 1px solid #d92222;
    border-radius: 8px;
    padding: 10px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 8px;
    text-align: center;
}

.avp-quote-overlay .avp-btn--get-quote:hover {
    background: #c01e1e;
    border-color: #c01e1e;
}

/* ---------- Thank You Panel (same position as quote form) ---------- */

.avp-thankyou-overlay {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 320px;
    background: rgba(255, 255, 255, 0.97);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 30px 28px;
    border-radius: 6px 0 0 6px;
    color: #2c2c2c;
    box-sizing: border-box;
}

.avp-thankyou-overlay h3 {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 20px;
    line-height: 1.3;
    color: #2c2c2c;
}

.avp-thankyou-overlay .avp-btn {
    margin: 0;
}

/* ---------- Bottom bar RQ button hidden state ---------- */

.avp-bottom-bar__rq--hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .avp-quote-overlay,
    .avp-thankyou-overlay {
        width: 100%;
        border-radius: 0;
        padding: 24px 20px;
    }
}

/* ---------- Step 2 form: small phones ---------- */

@media (max-width: 480px) {
    .avp-step2-form {
        --avp-label-col: 45px;
        --avp-row-gap: 6px;
        max-width: 100%;
    }

    .avp-dim-row__label {
        font-size: 14px;
    }

    .avp-dim-row__input {
        width: 70px;
    }

    .avp-dim-row__select {
        width: 68px;
    }
}
