/* ════════════════════════════════════════
   AMZ Image Puller — Editor styles
════════════════════════════════════════ */

.aip-block-editor .aip-editor-ui {
    border: 1px dashed #c3c4c7;
    border-radius: 6px;
    padding: 16px;
    background: #fafafa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Header row */
.aip-block-editor .aip-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.aip-block-editor .aip-editor-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
}

.aip-block-editor .aip-editor-asin-badge {
    font-size: 11px;
    background: #e8f4fd;
    color: #0073aa;
    padding: 2px 8px;
    border-radius: 10px;
    font-family: monospace;
}

/* Input row */
.aip-block-editor .aip-input-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 12px;
}

.aip-block-editor .aip-input-row .components-base-control {
    flex: 1;
    margin-bottom: 0 !important;
}

.aip-block-editor .aip-input-row .components-text-control__input {
    font-family: monospace;
    letter-spacing: 0.04em;
}

.aip-block-editor .aip-fetch-btn {
    height: 36px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Notice */
.aip-block-editor .aip-notice {
    margin: 0 0 12px;
}

.aip-block-editor .aip-notice .components-notice__content {
    font-size: 13px;
}

/* Placeholder */
.aip-block-editor .aip-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: #bbb;
    gap: 10px;
    text-align: center;
}

.aip-block-editor .aip-placeholder p {
    margin: 0;
    font-size: 13px;
    color: #999;
}

/* Preview wrapper */
.aip-block-editor .aip-preview {
    margin-top: 4px;
}

/* Prevent accidental link navigation in editor */
.aip-block-editor .aip-preview a {
    pointer-events: none;
    cursor: default;
}

/* ════════════════════════════════════════
   Shared — editor preview + frontend
════════════════════════════════════════ */

.aip-preview,
.aip-amazon-product {
    margin: 1.25em 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    line-height: 1;
}

.aip-align-left   { align-items: flex-start; }
.aip-align-center { align-items: center;     }
.aip-align-right  { align-items: flex-end;   }

/* Image */
.aip-image-link {
    display: inline-block;
}

.aip-image-link:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
    border-radius: 4px;
}

.aip-product-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    transition: opacity 0.15s ease;
}

.aip-image-link:hover .aip-product-image {
    opacity: 0.9;
}

/* Title */
.aip-product-title {
    margin: 0;
    font-size: 0.85em;
    line-height: 1.4;
    color: #555;
}

/* Button */
.aip-amazon-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ff9900;
    color: #111 !important;
    font-weight: 700;
    font-size: 0.82em;
    padding: 8px 20px;
    border-radius: 24px;
    text-decoration: none !important;
    transition: background 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.aip-amazon-btn::after {
    content: '→';
    font-weight: 400;
    opacity: 0.7;
}

.aip-amazon-btn:hover {
    background: #e88900;
    color: #111 !important;
    transform: translateY( -1px );
}

.aip-amazon-btn:active {
    transform: translateY( 0 );
}

.aip-amazon-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ════════════════════════════════════════
   Responsive
════════════════════════════════════════ */

@media ( max-width: 480px ) {
    .aip-amazon-product {
        align-items: flex-start !important;
    }
    .aip-image-link {
        max-width: 100% !important;
    }
}
