/**
 * Űrlapok - Frontend CSS
 */

/* Régi EPO (TM Extra Product Options) elrejtése, ha van új űrlap */
/* Ez biztosítja, hogy ha van új űrlap, akkor a régi EPO ne jelenjen meg */
.uf-wrapper ~ #tm-extra-product-options,
.uf-wrapper ~ .tm-extra-product-options,
body:has(.uf-wrapper) #tm-extra-product-options,
body:has(.uf-wrapper) .tm-extra-product-options,
body:has(.uf-wrapper) [data-epo-id] {
    display: none !important;
}

/* Wrapper - NINCS KERET */
.uf-wrapper {
    border: none !important;
    padding: 10px 5px !important;
    margin: 10px 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Mező */
.uf-field {
    margin-bottom: 6px !important;
}

.uf-field:last-child {
    margin-bottom: 0 !important;
}

/* Feltételes mező - MINDIG LÁTHATÓ */
.uf-conditional {
    display: block;
}

/* Címke */
.uf-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin-bottom: 3px !important;
    text-align: left;
}

.uf-req {
    color: #dc3545;
}

/* Select és Input - EGYFORMA MÉRET */
.uf-select,
.uf-input {
    width: 100% !important;
    padding: 8px 10px !important;
    font-size: 14px !important;
    line-height: 22px !important;
    color: #000 !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-sizing: border-box !important;
    height: 38px !important;
    font-family: inherit !important;
    vertical-align: middle !important;
    margin: 0 !important;
    display: block !important;
}

.uf-select {
    cursor: pointer;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    padding-right: 30px !important;
}

.uf-input {
    /* Ugyanazok a stílusok, mint a select */
}

.uf-input:focus,
.uf-select:focus {
    outline: none;
    box-shadow: 0 0 0 1px #000;
}

.uf-pattern-hint {
    font-size: 11px;
    color: #666;
    margin-top: 3px;
}

/* Képfeltöltés */
.uf-images-field {
    border: 1px dashed #ccc;
    padding: 10px;
    border-radius: 4px;
    background: #fafafa;
}

.uf-images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.uf-images-preview:empty {
    margin-bottom: 0;
}

/* Kép item - FIX NÉGYZET */
.uf-image-item {
    position: relative;
    width: 70px;
    height: 70px;
    flex-shrink: 0;
}

.uf-image-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: block;
}

.uf-image-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    padding: 0;
}

.uf-image-remove:hover {
    background: #c82333;
}

.uf-add-image-btn {
    padding: 8px 16px;
    background: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    border-radius: 0;
}

.uf-add-image-btn:hover {
    background: #333;
}

.uf-add-image-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.uf-images-hint {
    font-size: 11px;
    color: #666;
    margin-top: 8px;
}

.uf-uploading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
    border-radius: 4px;
    font-size: 20px;
}

/* Hiba */
.uf-field.uf-error .uf-select,
.uf-field.uf-error .uf-input {
    border-color: #dc3545;
}

.uf-error-msg {
    color: #dc3545;
    font-size: 12px;
    margin-top: 3px;
}

/* Kosár képek - NÉGYZET */
.uf-cart-images {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.uf-cart-images img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.uf-field-desc {
    font-size: 13px;
    line-height: 1.45;
    color: #444;
    margin: 0 0 8px;
}

.uf-textarea {
    height: auto !important;
    min-height: 88px;
    line-height: 1.4 !important;
    resize: vertical;
}

.uf-char-count {
    font-size: 12px;
    color: #666;
    text-align: right;
    margin-top: 4px;
}

.uf-number-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.uf-number-wrap .uf-number-input {
    flex: 1;
}

.uf-number-unit {
    font-weight: 600;
    white-space: nowrap;
}

.uf-number-price-hint {
    font-size: 13px;
    color: #333;
    margin-top: 6px;
}

form.cart:has(.uf-wrapper) #tm-extra-product-options,
form.cart:has(.uf-wrapper) .tm-extra-product-options,
form.cart:has(.uf-wrapper) .tc-extra-product-options {
    display: none !important;
}

.uf-file-field {
    border: 1px dashed #ccc;
    padding: 10px;
    background: #fafafa;
}

.uf-add-file-btn {
    padding: 8px 16px;
    background: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.uf-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.uf-file-name {
    word-break: break-all;
}

.uf-file-remove {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: #dc3545;
    color: #fff;
    cursor: pointer;
    line-height: 20px;
    padding: 0;
}

@media (max-width: 768px) {
    .uf-wrapper {
        padding: 10px 5px !important;
    }
    
    .uf-select,
    .uf-input {
        font-size: 16px;
        padding: 10px;
        height: 44px;
        line-height: 24px; /* Ugyanaz mindkettőnél */
    }
    
    .uf-image-item {
        width: 60px;
        height: 60px;
    }
}


.uf-emblem-rows {
    margin-top: 2px;
}
/* Intro + ártábla: alapból rejtve, csak emblémázás űrlapon (data-emblem) */
.uf-emblem-intro,
.uf-emblem-checkout {
    display: none;
}
.uf-wrapper[data-emblem="1"] .uf-emblem-intro,
.uf-wrapper[data-emblem="1"] .uf-emblem-checkout {
    display: block;
}
.uf-wrapper[data-emblem="1"] .uf-emblem-timeline[hidden] {
    display: none !important;
}
.uf-emblem-intro {
    margin: 0 0 12px;
    padding: 10px 12px;
    background: #fff8e8;
    border: 1px solid #e0c48a;
    border-radius: 10px;
}
.uf-emblem-intro-lead {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.45;
    white-space: normal;
}
.uf-emblem-intro-lead a {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}
.uf-emblem-intro-lead a:hover {
    text-decoration: underline;
}
.uf-emblem-intro-note {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: #5a5a5a;
}
.uf-emblem-min-note {
    margin: 8px 0 0;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    color: #7a4a00;
    background: #fff3cd;
    border: 1px solid #e0c48a;
    border-radius: 8px;
}
.uf-emblem-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}
.uf-emblem-swatch-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 40px;
    width: 40px;
    margin: 0 !important;
    padding: 0;
}
.uf-emblem-swatch-col > span:first-child {
    display: block;
    font-size: 12px;
    line-height: 1.2;
    min-height: 1.2em;
    color: transparent;
    user-select: none;
}
.uf-emblem-swatch {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    background: #f3f3f3;
    border: 1px solid #666;
    box-sizing: border-box;
}
.uf-emblem-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.uf-emblem-swatch.is-empty img {
    display: none;
}
.uf-emblem-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 0;
    min-width: 0;
    margin: 0 !important;
    padding: 0;
}
.uf-emblem-col > span {
    display: block;
    font-size: 12px;
    color: #333;
    line-height: 1.2;
    min-height: 1.2em;
}
.uf-emblem-col-qty {
    flex: 0 0 72px;
    width: 72px;
}
.uf-wrapper[data-no-sizes="1"] .uf-emblem-col-size {
    display: none;
}
.uf-emblem-row .uf-select {
    height: 40px !important;
    margin: 0 !important;
    padding: 6px 26px 6px 8px !important;
    font-size: 14px !important;
    line-height: 24px !important;
    border: 1px solid #333 !important;
    width: 100%;
    box-sizing: border-box;
}
.uf-emblem-remove-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 40px;
    width: 40px;
    margin: 0 !important;
    padding: 0;
    align-self: stretch;
}
.uf-emblem-remove-col > span:first-child {
    display: block;
    font-size: 12px;
    line-height: 1.2;
    min-height: 1.2em;
    color: transparent;
    user-select: none;
}
.uf-emblem-remove-col:has(.uf-emblem-remove[hidden]) {
    display: none;
}
.uf-emblem-remove {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 1px solid #333 !important;
    background: #fff !important;
    border-radius: 6px;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    cursor: pointer;
    font-size: 22px !important;
    line-height: 1 !important;
    flex: 0 0 40px;
    color: #111 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
}
.uf-emblem-remove:hover {
    background: #f3f3f3;
}
.uf-emblem-remove[hidden] {
    display: none !important;
}
.uf-emblem-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 8px;
    padding: 8px 12px;
    border: 1px dashed #888;
    background: #fafafa;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.uf-emblem-add:hover {
    border-color: #333;
    background: #f3f3f3;
}
.uf-emblem-checkout {
    margin: 14px 0 10px;
    padding: 16px;
    background: linear-gradient(180deg, #fbfbfb 0%, #f3f4f6 100%);
    border: 1px solid #cfcfcf;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}
.uf-emblem-checkout-top {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
    align-items: stretch;
    justify-content: space-between;
}
.uf-emblem-tier-wrap {
    flex: 1 1 220px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}
.uf-emblem-checkout-price {
    font-size: 13px;
    color: #444;
    text-align: right;
    margin-left: auto;
    min-width: 170px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #d4d4d4;
    border-radius: 12px;
    box-sizing: border-box;
}
.uf-emblem-total-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #666;
}
.uf-emblem-total-label em {
    font-style: normal;
    color: #1b5e20;
    font-weight: 800;
}
.uf-emblem-checkout-price strong {
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: #111;
    line-height: 1.2;
    margin: 2px 0 4px;
}
.uf-emblem-unit-hint {
    display: block;
    color: #555;
    font-size: 13px;
    font-weight: 500;
}
.uf-emblem-inc {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.35;
    color: #2e7d32;
    font-weight: 600;
}
.uf-emblem-tier-table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex: none;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    margin: 0;
    background: #fff;
    border: 1px solid #d4d4d4;
    border-radius: 12px;
    overflow: hidden;
    table-layout: fixed;
    box-sizing: border-box;
}
.uf-emblem-tier-table th,
.uf-emblem-tier-table td,
.uf-emblem-tier-table th:first-child,
.uf-emblem-tier-table td:first-child,
.uf-emblem-tier-table th:last-child,
.uf-emblem-tier-table td:last-child {
    text-align: left;
    padding: 10px 16px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    border-bottom: 1px solid #ececec;
    word-break: break-word;
    box-sizing: border-box;
}
.uf-emblem-tier-table th:last-child,
.uf-emblem-tier-table td:last-child {
    text-align: right;
}
.uf-emblem-tier-table tr:last-child td {
    border-bottom: none;
}
.uf-emblem-tier-table th {
    color: #666;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #f7f7f7;
}
.uf-emblem-tier-table tr.is-active td {
    background: #e8f5e9;
    font-weight: 700;
    color: #1b5e20;
}
.uf-emblem-tier-table tr.is-active td:first-child {
    box-shadow: inset 3px 0 0 #2e7d32;
}
.uf-emblem-timeline {
    margin-top: 14px;
    padding: 14px 12px 10px;
    background: #fff;
    border: 1px solid #d4d4d4;
    border-radius: 12px;
}
.uf-emblem-tl-track {
    position: relative;
    height: 10px;
    background: #ececec;
    border-radius: 99px;
    margin: 8px 12px 42px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
}
.uf-emblem-tl-fill {
    height: 100%;
    background: linear-gradient(90deg, #66bb6a, #2e7d32);
    border-radius: 99px;
    width: 0;
    transition: width .25s ease;
}
.uf-emblem-tl-marks {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}
.uf-emblem-tl-mark {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    background: #fff;
    border: 2px solid #8a8a8a;
    border-radius: 50%;
    transform: translateY(-50%);
    box-sizing: border-box;
    box-shadow: 0 0 0 3px #fff;
}
.uf-emblem-tl-mark.is-reached {
    border-color: #2e7d32;
    background: #2e7d32;
}
.uf-emblem-tl-mark > span {
    position: absolute;
    left: 50%;
    top: 18px;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 11px;
    line-height: 1.25;
    color: #444;
    text-align: center;
    font-weight: 600;
}
.uf-emblem-tl-msg {
    margin: 0;
    font-size: 13px;
    color: #222;
    text-align: center;
    font-weight: 600;
}
.uf-emblem-timeline > .uf-emblem-inc {
    text-align: center;
    margin-top: 4px;
}
@media (max-width: 768px) {
    .uf-emblem-row .uf-select {
        height: 44px !important;
        font-size: 16px !important;
        line-height: 24px !important;
    }
    .uf-emblem-swatch-col {
        flex: 0 0 44px;
        width: 44px;
    }
    .uf-emblem-swatch,
    .uf-emblem-remove {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        max-width: 44px !important;
        max-height: 44px !important;
        flex-basis: 44px;
    }
    .uf-emblem-remove-col {
        flex: 0 0 44px;
        width: 44px;
    }
}
@media (max-width: 600px) {
    .uf-emblem-row {
        flex-wrap: nowrap;
        gap: 6px;
    }
    .uf-emblem-col-qty {
        flex: 0 0 62px;
        width: 62px;
    }
    .uf-emblem-col span,
    .uf-emblem-swatch-col > span:first-child {
        font-size: 11px;
    }
    .uf-emblem-checkout {
        padding: 12px;
    }
    .uf-emblem-checkout-price {
        text-align: left;
        margin-left: 0;
        width: 100%;
        min-width: 0;
    }
    .uf-emblem-tier-wrap,
    .uf-emblem-tier-table {
        width: 100%;
        min-width: 0;
    }
    .uf-emblem-tier-table th,
    .uf-emblem-tier-table td,
    .uf-emblem-tier-table th:first-child,
    .uf-emblem-tier-table td:first-child {
        padding: 10px 14px !important;
        padding-left: 14px !important;
        padding-right: 14px !important;
        font-size: 13px;
    }
    .uf-emblem-tl-mark > span {
        font-size: 10px;
    }
    .uf-emblem-tl-mark:not(.is-label) > span {
        display: none;
    }
    .uf-emblem-intro-lead {
        font-size: 12px;
    }
}
