/**
 * Custom Field for Checkout - Front Office Styles
 *
 * @author    4WORKS Solutions
 * @copyright 2024 4WORKS Solutions
 * @license   MIT
 */

/* Product Info Box */
.osvedceni-info-box {
    margin: 15px 0;
    padding: 15px;
    margin-top: 1.75rem!important;
    background-color: #3d2e18;
    border: 1px solid #3d2e18;
    border-radius: 4px;
    color:white
}

.osvedceni-info-content {
    display: flex;
    gap: 10px;
}

.osvedceni-info-content i.material-icons {
    font-size: 20px;
}

.osvedceni-info-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

/* Product Label (displayOsvedceniLabel) - inline-flex so the theme can drop it
   next to a price or a title without it claiming a whole row. */
.osvedceni-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: #3d2e18;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.osvedceni-label i.material-icons {
    font-size: 16px;
}

/* Checkout Field */
.checkout-step-1 div#osvedceni-checkout-container {
    display: none;
}

.osvedceni-checkout-field {
    margin: 15px 0;
    padding: 6px;
}

.osvedceni-checkout-heading {
    margin-bottom: 10px;
}

.osvedceni-checkout-title {
    font-weight: 700;
}

.osvedceni-checkout-field .form-group {
    margin-bottom: 0;
}

.osvedceni-checkout-field label {
    display: block;
}

.osvedceni-fields label .required-asterisk {
    color: #dc3545;
    margin-left: 4px;
}

/* Field group shared by checkout and My Account */
.osvedceni-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.osvedceni-col {
    flex: 1 1 160px;
    min-width: 0;
}

.osvedceni-fields .form-group {
    margin-bottom: 12px;
}

/* Themes sometimes force display on form rows, which would defeat the
   hidden attribute the script toggles. */
.osvedceni-fields [hidden] {
    display: none !important;
}

.osvedceni-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: .5rem;
    line-height: 1.5;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
}

.osvedceni-input:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.osvedceni-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
}

/* The theme's Bootstrap custom-control draws the box itself. The only thing
   to undo is `.osvedceni-checkout-field label { display: block; }` above,
   which would otherwise stretch the label away from its indicator. */
.osvedceni-education .custom-control-label {
    display: inline-block;
    font-weight: 400;
    cursor: pointer;
}

/* Only the fields that are actually missing turn red, and only once the
   customer has tried to confirm. The class is applied by osvedceni-format.js. */
.osvedceni-input--error {
    border-color: #dc3545;
}

.osvedceni-input--error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Validation messages */
.osvedceni-messages:empty {
    display: none;
}

.osvedceni-messages {
    margin: 8px 0;
}

.osvedceni-message {
    font-size: 14px;
    line-height: 1.45;
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.osvedceni-message--error {
    color: #721c24;
    background-color: #f8d7da;
}

.osvedceni-message--warning {
    color: #7a5b00;
    background-color: #fff3cd;
}

/* Live preview of the merged value – disabled for now, re-enable together with
   the preview block in views/templates/_partials/osvedceni_fields.tpl. */
/*
.osvedceni-preview {
    margin: 8px 0;
    padding: 8px 10px;
    background-color: #f8f9fa;
    border: 1px dashed #ced4da;
    border-radius: 4px;
}

.osvedceni-preview[hidden] {
    display: none;
}

.osvedceni-preview-label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
}

.osvedceni-preview-value {
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
    white-space: normal;
}
*/

.osvedceni-registry-link {
    margin: 8px 0 0;
    font-size: 13px;
}

/* My Account page */
.osvedceni-intro {
    margin-bottom: 16px;
}

.osvedceni-warning-list {
    margin: 0;
    padding-left: 18px;
}

.osvedceni-form-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.osvedceni-delete {
    color: #dc3545;
}

/* Admin Order Display */
.osvedceni-text-display {
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Responsive */
@media (max-width: 768px) {
    .osvedceni-info-box,
    .osvedceni-checkout-field {
        padding: 12px;
    }

    .osvedceni-info-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .osvedceni-row {
        flex-direction: column;
        gap: 0;
    }
}
