/**
 * Frontend styles for WooCommerce Obyčejné psaní Notice & Shipping Risk Manager
 * Optimized for standard WooCommerce & WoodMart theme grid shipping cards.
 */

/* --- Dashicons Fallback for Guest Users --- */
@font-face {
    font-family: "dashicons";
    src: url("/wp-includes/fonts/dashicons.eot");
    src: url("/wp-includes/fonts/dashicons.eot?#iefix") format("embedded-opentype"),
         url("/wp-includes/fonts/dashicons.woff2") format("woff2"),
         url("/wp-includes/fonts/dashicons.woff") format("woff"),
         url("/wp-includes/fonts/dashicons.ttf") format("truetype"),
         url("/wp-includes/fonts/dashicons.svg#dashicons") format("svg");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.wc-obyc-badge-recommended .dashicons,
.wc-obyc-badge-warning .dashicons,
.wc-obyc-method-warning-note .dashicons,
.obyc-compact-alert .oca-icon .dashicons,
.wc-obyc-risk-icon .dashicons,
.obyc-modal-header .dashicons,
.obyc-btn .dashicons {
    font-family: dashicons, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    display: inline-block;
    line-height: 1;
    font-weight: 400;
    font-style: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.dashicons-yes-alt:before { content: "\f147"; }
.dashicons-yes:before { content: "\f147"; }
.dashicons-warning:before { content: "\f534"; }
.dashicons-info:before { content: "\f348"; }

/* --- 1. Compact Top Alert Banner --- */
.obyc-compact-alert {
    display: flex;
    align-items: center;
    background-color: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
    padding: 14px 20px;
    margin-bottom: 25px;
    border-radius: var(--wd-brd-radius, 8px);
    font-family: var(--wd-text-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.obyc-compact-alert .oca-icon {
    margin-right: 14px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.obyc-compact-alert .oca-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #e11d48;
}

.obyc-compact-alert .oca-content {
    flex-grow: 1;
}

.obyc-compact-alert .oca-content strong {
    color: #881337;
    font-size: 14px;
    font-weight: 700;
}

.obyc-more-link {
    color: #e11d48;
    font-weight: 700;
    text-decoration: underline;
    margin-left: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.obyc-more-link:hover {
    color: #9f1239;
    text-decoration: none;
}

/* --- 2. Interactive Modal Popup (matching custom_popup) --- */
.obyc-modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999999 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.75);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    font-family: var(--wd-text-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

.obyc-modal-overlay.is-open {
    display: flex !important;
    animation: obycFadeIn 0.25s ease-out;
}

@keyframes obycFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.obyc-modal-box {
    background-color: #ffffff;
    padding: 30px;
    border-radius: var(--wd-brd-radius, 12px);
    width: 90%;
    max-width: 520px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    text-align: left;
}

.obyc-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #94a3b8;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    transition: color 0.2s;
}

.obyc-modal-close:hover {
    color: #0f172a;
}

.obyc-modal-header {
    margin-top: 0;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
    display: flex;
    align-items: center;
}

.obyc-modal-body p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 14px;
    color: #334155;
}

.obyc-modal-body p b[style*="color:red"],
.obyc-modal-body p b[style*="color: red"] {
    color: #dc2626 !important;
}

.obyc-modal-actions {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.obyc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.obyc-btn-agree {
    background-color: #16a34a !important;
    color: #ffffff !important;
    flex: 1 1 55%;
}

.obyc-btn-agree:hover {
    background-color: #15803d !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.3);
}

.obyc-btn-cancel {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
    flex: 1 1 35%;
}

.obyc-btn-cancel:hover {
    background-color: #e2e8f0 !important;
    color: #1e293b !important;
}

/* --- 3. Risk Confirmation Checkbox on Checkout --- */
.wc-obyc-risk-box {
    margin: 20px 0;
    padding: 16px;
    background: #fffbeb;
    border: 2px solid #f59e0b;
    border-radius: var(--wd-brd-radius, 8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.wc-obyc-risk-box-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.wc-obyc-risk-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #d97706;
    margin-top: 2px;
}

.wc-obyc-risk-content {
    flex-grow: 1;
}

.wc-obyc-risk-label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px;
    cursor: pointer;
    margin: 0 !important;
}

.wc-obyc-risk-label input[type="checkbox"] {
    margin-top: 3px !important;
    cursor: pointer;
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
}

.wc-obyc-risk-text {
    font-size: 13.5px;
    line-height: 1.5;
    color: #78350f;
}

.wc-obyc-risk-text strong {
    color: #92400e;
    display: block;
    margin-bottom: 4px;
}

.wc-obyc-risk-text .required {
    color: #dc2626;
    font-weight: bold;
    text-decoration: none;
    margin-left: 2px;
}

/* --- 4. Shipping Methods Styling & Blurred UI --- */
.obyc-method-blurred {
    opacity: 0.65;
    background-color: #f8fafc !important;
    transition: opacity 0.2s;
}

.obyc-method-blurred:hover {
    opacity: 0.85;
}

.wc-obyc-badge-recommended-wrap {
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.wc-obyc-badge-recommended {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
}

.wc-obyc-badge-recommended .dashicons {
    font-size: 13px;
    width: 13px;
    height: 13px;
}

.wc-obyc-badge-short {
    display: none;
}

.wc-obyc-method-meta-wrap {
    margin-top: 6px;
    margin-left: 26px;
    font-size: 12px;
}

.wc-obyc-badge-warning {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.wc-obyc-badge-warning .dashicons {
    font-size: 13px;
    width: 13px;
    height: 13px;
}

.wc-obyc-method-warning-note {
    margin-top: 4px;
    color: #64748b;
    font-size: 11.5px;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.wc-obyc-method-warning-note .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #94a3b8;
    margin-top: 1px;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .obyc-modal-box {
        padding: 20px 16px;
    }
    .obyc-modal-actions {
        flex-direction: column;
    }
    .obyc-btn {
        width: 100%;
    }
    .wc-obyc-badge-full {
        display: none;
    }
    .wc-obyc-badge-short {
        display: inline;
    }
}
