/* ==========================================================================
   MD Hi-Res Download — Frontend Styles
   ========================================================================== */

/* ---- Overlay ---- */
.mdhr-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.mdhr-overlay.mdhr-visible {
    opacity: 1;
}

/* ---- Modal ---- */
.mdhr-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.25s ease;
}
.mdhr-overlay.mdhr-visible .mdhr-modal {
    transform: translateY(0);
}

/* ---- Close button ---- */
.mdhr-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    z-index: 2;
}
.mdhr-close:hover {
    color: #000;
}

/* ---- Modal body: two columns ---- */
.mdhr-modal-body {
    display: flex;
    position: relative;
}

/* Left: image — absolute so right content dictates height */
.mdhr-modal-image {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: #e8e8e8;
    border-radius: 12px 0 0 12px;
    overflow: hidden;
}
.mdhr-modal-image img {
    display: block;
    height: 100%;
    width: auto;
    object-fit: contain;
}

/* Right: content — this column dictates the modal height */
.mdhr-modal-content {
    flex: 1;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ---- Title ---- */
.mdhr-title {
    font-size: 22px;
    font-weight: 800;
    color: #3355ff;
    margin: 0 0 12px;
    letter-spacing: 0.5px;
}

/* ---- Status message ---- */
.mdhr-status {
    font-size: 14px;
    color: #444;
    margin: 0 0 16px;
    min-height: 20px;
}
.mdhr-status.mdhr-error {
    color: #d32f2f;
}
.mdhr-status.mdhr-success {
    color: #2e7d32;
}

/* ---- License input ---- */
.mdhr-input-wrap {
    width: 100%;
    margin-bottom: 12px;
}
.mdhr-input-wrap input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-family: monospace;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    letter-spacing: 1px;
}
.mdhr-input-wrap input:focus {
    border-color: #3355ff;
}
.mdhr-input-wrap input.mdhr-input-error {
    border-color: #d32f2f;
}
.mdhr-input-wrap input.mdhr-input-valid {
    border-color: #2e7d32;
}

/* ---- Credits info ---- */
.mdhr-credits-info {
    font-size: 13px;
    color: #333;
    margin: 0 0 16px;
}
.mdhr-credits-info a {
    color: #3355ff;
    text-decoration: underline;
}

/* ---- Buttons ---- */
.mdhr-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    width: 100%;
}
.mdhr-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    border: 2px solid #222;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mdhr-btn-cancel {
    background: #fff;
    color: #222;
}
.mdhr-btn-cancel:hover {
    background: #f5f5f5;
}
.mdhr-btn-download {
    background: #3355ff;
    color: #fff;
    border-color: #3355ff;
}
.mdhr-btn-download:hover:not(:disabled) {
    background: #2244dd;
    border-color: #2244dd;
}
.mdhr-btn-download:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---- Loading state ---- */
.mdhr-btn-download.mdhr-loading {
    position: relative;
    color: transparent;
}
.mdhr-btn-download.mdhr-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mdhr-spin 0.6s linear infinite;
}
@keyframes mdhr-spin {
    to { transform: rotate(360deg); }
}

/* ---- Buy section ---- */
.mdhr-buy-section {
    border-top: 1px solid #eee;
    padding-top: 20px;
    width: 100%;
}
.mdhr-buy-title {
    font-weight: 700;
    font-size: 15px;
    color: #333;
    margin: 0 0 12px;
}
.mdhr-buy-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 16px;
}
.mdhr-buy-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: #222;
    font-size: 13px;
    transition: border-color 0.15s, background 0.15s;
    min-width: 100px;
}
.mdhr-buy-btn:hover {
    border-color: #3355ff;
    background: #f8f9ff;
    color: #222;
    text-decoration: none;
}
.mdhr-buy-btn-label {
    font-size: 12px;
    color: #666;
}
.mdhr-buy-btn-name {
    font-weight: 700;
    font-size: 14px;
}
.mdhr-buy-btn-price {
    font-size: 13px;
    color: #666;
}

/* ---- Helper text ---- */
.mdhr-helper {
    font-size: 12px;
    color: #888;
    line-height: 1.5;
    margin: 0;
}

/* ---- Trigger button (on single mockup page) ---- */
.mdhr-trigger-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 32px;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mdhr-trigger-btn span {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.7;
    margin-top: 2px;
}
.mdhr-trigger-btn:hover {
    background: #333;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .mdhr-modal-image {
        position: relative !important;
        width: 100% !important;
        height: 180px;
        border-radius: 12px 12px 0 0;
    }
    .mdhr-modal-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center top;
    }
    .mdhr-modal-content {
        margin-left: 0 !important;
        padding: 24px 20px;
    }
    .mdhr-buy-buttons {
        flex-direction: column;
        align-items: stretch;
    }
}
