/* =========================================================
   Tarrat veneeseen – Frontend CSS v1.0.0
   Responsiivinen, mobile-first.
   Tyyli peilaa Custom Sticker Order -pluginin CSS:ää:
   samat komponenttityylit, samat breakpointit.
   ========================================================= */

/* ══════════════════════════════════════════════════════════
   PERUSASETUKSET
   ══════════════════════════════════════════════════════════ */
.vt-wrap {
    max-width: 1100px;
    margin: 0 auto;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
/* Mobiilissa: lomake ensin, esikatselu alla */
#vt-order-form    { order: 1; }
#vt-preview-panel { order: 2; }

/* ══════════════════════════════════════════════════════════
   TYPOGRAFIA JA KENTÄT – mobile-first
   ══════════════════════════════════════════════════════════ */
#vt-order-form h2 {
    font-size: 17px;
    border-bottom: 2px solid #111;
    padding-bottom: 6px;
    margin: 24px 0 14px;
}
#vt-order-form h2:first-child { margin-top: 0; }

.vt-field {
    margin-bottom: 14px;
}
.vt-field label,
.vt-grid label,
.vt-row label,
.vt-field > label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #333;
}

/* Syötekentät – isot touch-kohteet */
#vt-order-form input[type="text"],
#vt-order-form input[type="email"],
#vt-order-form input[type="tel"],
#vt-order-form input[type="number"],
#vt-order-form select,
#vt-order-form textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;    /* 16px estää iOS:n autozoomauksen */
    line-height: 1.4;
    transition: border-color .15s;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
}
#vt-order-form input:focus,
#vt-order-form select:focus,
#vt-order-form textarea:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(0,0,0,.08);
}
#vt-order-form textarea { resize: vertical; min-height: 80px; }
#vt-order-form small    { display: block; margin-top: 4px; color: #666; font-size: 13px; }

/* Select custom-nuoli */
#vt-order-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ══════════════════════════════════════════════════════════
   GRID/ROW – mobiilissa aina 1 sarake
   ══════════════════════════════════════════════════════════ */
.vt-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.vt-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.vt-grid-3 {
    grid-template-columns: 1fr;
}

/* ══════════════════════════════════════════════════════════
   VÄRIPALLOT
   ══════════════════════════════════════════════════════════ */
.vt-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}
.vt-swatch {
    display: inline-flex;
    cursor: pointer;
    user-select: none;
    padding: 4px;
    margin: -4px;
    border-radius: 50%;
}
.vt-swatch input[type="radio"] {
    position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0;
}
.vt-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2.5px solid #999;
    display: inline-block;
    transition: transform .15s ease, box-shadow .15s ease;
}
.vt-dot:hover { transform: scale(1.1); }
.vt-swatch input:checked + .vt-dot {
    box-shadow: 0 0 0 3px #111;
    transform: scale(1.1);
}

/* ══════════════════════════════════════════════════════════
   VÄRIVAROITUS
   ══════════════════════════════════════════════════════════ */
.vt-warning {
    color: #7a4f00;
    background: #fff8e1;
    border: 1.5px solid #ffc107;
    padding: 12px 14px;
    border-radius: 8px;
    margin: 8px 0 14px;
    font-size: 14px;
}
.vt-warning p { margin: 0 0 10px; }
.vt-warning-accept {
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.vt-warning-accept input {
    width: 20px; height: 20px;
    margin: 0; flex-shrink: 0;
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════════
   PAKETTITARJOUS
   ══════════════════════════════════════════════════════════ */
.vt-package-box {
    background: #f0f7ff;
    border: 1.5px dashed #7ab0d4;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
}
.vt-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 15px;
    flex-wrap: wrap;
}
.vt-checkbox-label input[type="checkbox"] {
    width: 20px; height: 20px;
    margin: 0; flex-shrink: 0;
    accent-color: #0073aa;
}
/* Hintamerkki checkboxin vieressä */
.vt-pkg-price {
    margin-left: auto;
    font-weight: 700;
    color: #1a6b2a;
    white-space: nowrap;
    font-size: 15px;
}
/* Tuoterivien lista */
.vt-pkg-list {
    margin: 0 0 6px 0;
    padding: 0 0 0 18px;
    list-style: disc;
    color: #333;
    font-size: 13px;
    line-height: 1.8;
}
/* Vapaa kuvaus */
.vt-pkg-desc {
    margin: 4px 0 0;
    font-size: 13px;
    color: #555;
    font-style: italic;
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════
   TOIMITUS
   ══════════════════════════════════════════════════════════ */
.vt-delivery {
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.vt-delivery legend {
    font-weight: 700;
    padding: 0 4px;
    font-size: 14px;
}
.vt-delivery-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}
.vt-delivery label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 15px;
    padding: 10px 12px;
    background: #f8f8f8;
    border: 1.5px solid #e0e0e0;
    border-radius: 7px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.vt-delivery label:has(input:checked) {
    background: #f0f7ff;
    border-color: #0073aa;
}
.vt-delivery input[type="radio"] {
    width: 20px; height: 20px;
    margin: 0; flex-shrink: 0;
    accent-color: #0073aa;
}

/* ══════════════════════════════════════════════════════════
   HINTAYHTEENVETO lomakkeessa (ALV-taulukko)
   ══════════════════════════════════════════════════════════ */
#vt-price-summary {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 14px 16px;
    margin: 16px 0 12px;
    font-size: 13px;
    overflow-x: auto;
}
#vt-price-summary table {
    width: 100%;
    border-collapse: collapse;
    min-width: 320px;
}
#vt-price-summary td {
    padding: 5px 8px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}
#vt-price-summary td:not(:first-child) {
    text-align: right;
    white-space: nowrap;
}
.vt-total-row td {
    font-weight: 700;
    border-top: 2px solid #ccc !important;
    border-bottom: none;
    padding-top: 8px !important;
}

/* ══════════════════════════════════════════════════════════
   VIRHEILMOITUKSET
   ══════════════════════════════════════════════════════════ */
.vt-error       { color: #b00020; font-size: 13px; margin-top: 4px; }
.vt-error-box {
    color: #b00020;
    background: #fdecea;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    margin-top: 10px;
}
.vt-req { color: #c00; }

/* ══════════════════════════════════════════════════════════
   LÄHETYSPAINIKE
   ══════════════════════════════════════════════════════════ */
.vt-submit {
    display: block;
    width: 100%;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 16px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
    margin-top: 10px;
    min-height: 54px;
}
.vt-submit:hover:not(:disabled) { background: #333; }
.vt-submit:disabled              { opacity: .6; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════
   ONNISTUMISVIESTI
   ══════════════════════════════════════════════════════════ */
.vt-success-msg {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 10px;
    padding: 24px;
    color: #1b5e20;
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════
   ESIKATSELU
   ══════════════════════════════════════════════════════════ */
#vt-preview-panel {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
}
#vt-preview-container {
    padding: 16px;
    border-bottom: 1px solid #eee;
}
#vt-preview-container h3 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: #333;
}
#vt-preview-canvas {
    background: repeating-conic-gradient(#ebebeb 0% 25%, #f8f8f8 0% 50%)
                0 0 / 12px 12px;
    border-radius: 6px;
    padding: 12px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    outline: 1px solid #e0e0e0;
}

#vt-reg-preview-box,
#vt-name-preview-box {
    width: 100%;
    text-align: center;
    padding: 6px 10px;
    border-radius: 4px;
    min-height: 1.6em;
    transition: color .2s, font-family .2s;
    word-break: break-all;
}

.vt-preview-notice {
    font-size: 11px;
    color: #999;
    margin: 8px 0 0;
    line-height: 1.4;
}

#vt-price-panel {
    padding: 14px 16px;
}
#vt-summary-detail { font-size: 13px; line-height: 1.7; }
#vt-summary-detail table  { width: 100%; border-collapse: collapse; }
#vt-summary-detail td     { padding: 3px 0; }
#vt-summary-detail td:last-child {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════
   HR
   ══════════════════════════════════════════════════════════ */
#vt-order-form hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 22px 0;
}

/* ══════════════════════════════════════════════════════════
   HONEYPOT
   ══════════════════════════════════════════════════════════ */
.vt-hp-wrap {
    position: absolute; left: -9999px;
    width: 1px; height: 1px;
    overflow: hidden; opacity: 0;
}

/* ══════════════════════════════════════════════════════════
   TABLET (≥ 600px)
   ══════════════════════════════════════════════════════════ */
@media (min-width: 600px) {
    .vt-row              { grid-template-columns: repeat(2, 1fr); }
    .vt-grid             { grid-template-columns: repeat(2, 1fr); }
    .vt-grid-3           { grid-template-columns: 2fr 1fr 1fr; }
    .vt-delivery-options { flex-direction: row; gap: 12px; }
    .vt-delivery label   { flex: 1; }
    .vt-dot              { width: 32px; height: 32px; }
}

/* ══════════════════════════════════════════════════════════
   DESKTOP (≥ 820px) – sivupalkkilayout
   ══════════════════════════════════════════════════════════ */
@media (min-width: 820px) {
    .vt-wrap {
        display: grid;
        grid-template-columns: 1fr 280px;
        grid-template-areas: "form preview";
        gap: 28px;
        align-items: start;
        flex-direction: unset;
    }
    #vt-order-form    { order: unset; grid-area: form; }
    #vt-preview-panel {
        order: unset;
        grid-area: preview;
        position: sticky;
        top: 20px;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,.07);
    }

    #vt-preview-canvas {
        min-height: 140px;
    }

    /* Desktop: pienemmät padding-arvot kenttiin */
    #vt-order-form input[type="text"],
    #vt-order-form input[type="email"],
    #vt-order-form input[type="tel"],
    #vt-order-form input[type="number"],
    #vt-order-form select,
    #vt-order-form textarea {
        padding: 9px 11px;
        font-size: 14px;
    }
    .vt-submit         { padding: 14px; font-size: 15px; min-height: unset; }
    .vt-dot            { width: 30px; height: 30px; }
    .vt-row            { grid-template-columns: repeat(3, 1fr); }
}

/* ══════════════════════════════════════════════════════════
   LEVEÄ DESKTOP (≥ 1024px)
   ══════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
    .vt-wrap { grid-template-columns: 1fr 300px; }
}
