/* VLV Cart Personalization Modal */

.vlv-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.vlv-modal-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.vlv-modal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}
.vlv-modal-title {
    font-size: 16px;
    font-weight: 700;
    flex: 1;
    color: #1d2327;
}
.vlv-modal-piece-info {
    font-size: 12px;
    color: #777;
    white-space: nowrap;
}
.vlv-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #aaa;
    padding: 0 4px;
    transition: color 0.15s;
}
.vlv-modal-close:hover { color: #333; }

/* Tabs navigation */
.vlv-modal-tabs {
    display: flex;
    overflow-x: auto;
    border-bottom: 2px solid #e5e5e5;
    flex-shrink: 0;
}
.vlv-modal-tabs:empty { display: none; }
.vlv-modal-tab {
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    color: #666;
    transition: all 0.15s;
}
.vlv-modal-tab.active,
.vlv-modal-tab:hover {
    color: var(--vlv-primary, #0073aa);
    border-bottom-color: var(--vlv-primary, #0073aa);
}

/* Stepper */
.vlv-modal-stepper {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px 0;
    flex-shrink: 0;
}
.vlv-stepper-step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e5e5;
    color: #777;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.vlv-stepper-step.active {
    background: var(--vlv-primary, #0073aa);
    color: #fff;
}
.vlv-stepper-step.done {
    background: #6cb26c;
    color: #fff;
}

/* Body */
.vlv-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Fields */
.vlv-modal-group {
    margin-bottom: 6px;
}
.vlv-modal-group-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-bottom: 10px;
    padding-top: 4px;
    border-top: 1px solid #f0f0f0;
}
.vlv-modal-field {
    margin-bottom: 14px;
}
.vlv-modal-field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #1d2327;
}
.vlv-modal-field label .vlv-required-star {
    color: #d63638;
    margin-left: 2px;
}
.vlv-modal-field input[type="text"],
.vlv-modal-field input[type="number"],
.vlv-modal-field textarea,
.vlv-modal-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.vlv-modal-field input:focus,
.vlv-modal-field textarea:focus,
.vlv-modal-field select:focus {
    border-color: var(--vlv-primary, #0073aa);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
}
.vlv-modal-field textarea { resize: vertical; min-height: 80px; }
.vlv-modal-field.vlv-field-error input,
.vlv-modal-field.vlv-field-error textarea {
    border-color: #d63638;
}
.vlv-field-description {
    font-size: 12px;
    color: #777;
    margin-top: 4px;
}
.vlv-char-counter {
    font-size: 11px;
    color: #aaa;
    text-align: right;
    margin-top: 2px;
}
.vlv-char-counter.vlv-over { color: #d63638; font-weight: 600; }
.vlv-field-error-msg {
    color: #d63638;
    font-size: 12px;
    margin-top: 3px;
    display: none;
}
.vlv-modal-field.vlv-field-error .vlv-field-error-msg { display: block; }

/* Radio / Checkbox group */
.vlv-radio-group, .vlv-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.vlv-radio-group label, .vlv-checkbox-group label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Footer */
.vlv-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid #e5e5e5;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: nowrap; /* vše v jedné řadě — kompaktní tlačítka níže */
}
.vlv-modal-footer-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}
/* Kompaktní tlačítka patičky — přebíjí robustní button styly šablon webu
   (obří padding/font), kvůli kterým se patička lámala do více řad */
.vlv-modal-footer button.button,
.vlv-modal-footer button {
    padding: 9px 14px !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    min-height: 0 !important;
    height: auto !important;
    white-space: nowrap;
    border-radius: 4px;
}
@media (max-width: 560px) {
    .vlv-modal-footer,
    .vlv-modal-footer-right { flex-wrap: wrap; }
    .vlv-modal-footer button.button,
    .vlv-modal-footer button { padding: 8px 10px !important; font-size: 12px !important; }
}
.vlv-btn-prev { color: #555; }
.vlv-btn-prev:empty { display: none; }
.vlv-btn-skip { color: #999; font-size: 13px; }
.vlv-btn-copy { font-size: 12px; }
.vlv-btn-save {
    background: var(--vlv-primary, #0073aa) !important;
    border-color: var(--vlv-primary, #0073aa) !important;
    color: #fff !important;
}
.vlv-btn-save:hover {
    background: var(--vlv-primary-hover, #005a87) !important;
}

/* Cart page indicators */
.vlv-status-complete { color: #46b450; margin-left: 4px; }
.vlv-status-partial  { color: #f56e28; margin-left: 4px; }
.vlv-edit-personalization {
    margin-left: 8px !important;
    font-size: 12px !important;
    padding: 2px 8px !important;
}
.vlv-qty-notice {
    display: inline-block;
    background: #fff8e5;
    border: 1px solid #ffb900;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    margin-left: 8px;
    cursor: pointer;
}
.vlv-qty-notice:hover { background: #fff3cc; }

/* Accessibility */
.vlv-modal-overlay:focus-within .vlv-modal-box { outline: none; }

/* Animations */
@keyframes vlvModalIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.vlv-modal-box { animation: vlvModalIn 0.2s ease; }

/* Cart edit link button */
.vlv-cart-edit-btn {
    display: inline-block;
    font-size: 12px;
    color: inherit;
    opacity: 0.6;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    margin-top: 2px;
    line-height: 1.4;
}
.vlv-cart-edit-btn:hover {
    opacity: 1;
    text-decoration: underline;
    color: inherit;
}

/* Modal footer — stabilní layout, tlačítka se neposouvají */
.vlv-modal-footer {
    justify-content: space-between;
    min-height: 48px;
}
.vlv-btn-prev {
    visibility: hidden; /* JS nastavuje visible/hidden, ne display */
    min-width: 0;
}
.vlv-modal-footer-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── Template picker (výběr vizuálu) ─────────────────────────────────── */
.vlv-template-picker .vlv-tpl-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 6px;
}
.vlv-tpl-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s;
}
.vlv-tpl-option.active { border-color: var(--vlv-primary, #0073aa); box-shadow: 0 0 0 1px var(--vlv-primary, #0073aa); }
.vlv-tpl-option input.vlv-tpl-radio { position: absolute; opacity: 0; pointer-events: none; }
.vlv-tpl-thumb { width: 100%; height: auto; max-height: 110px; object-fit: contain; border-radius: 3px; }
.vlv-tpl-noimg { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 60px; background: #f2f2f2; border-radius: 3px; font-size: 12px; color: #555; padding: 4px; }
.vlv-tpl-title { font-size: 11px; line-height: 1.2; color: #333; }
@media (max-width: 520px) {
    .vlv-template-picker .vlv-tpl-grid { grid-template-columns: repeat(2, 1fr); }
}
