.ccp-widget {
    margin: 24px 0;
    font-family: inherit;
}

.ccp-widget-inner {
    background: #f8f9fb;
    border: 1px solid #e3e6ec;
    border-radius: 14px;
    padding: 24px;
}

.ccp-widget-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: #1f2440;
}

.ccp-widget-subtitle {
    margin: 0 0 18px;
    font-size: 13px;
    color: #5b6270;
    line-height: 1.5;
}

/* ── Upload box ─────────────────────────────────────────────────────────── */
.ccp-upload-area {
    border: 2px dashed #c7cde0;
    border-radius: 12px;
    background: #fff;
    /* NO fixed height — let the content define height */
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    overflow: hidden;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.ccp-upload-area:hover {
    border-color: #2f80ed;
    background: #f5f9ff;
}

/* Image-loaded state */
.ccp-upload-area.has-image {
    border: 2px solid #e3e6ec;
    background: #1a1a1a;
    cursor: default;
    /* Height driven by the image itself via the img tag below */
    min-height: 0;
}

/* ── Upload prompt (shown when no image) ────────────────────────────────── */
.ccp-upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    padding: 32px 24px;
    text-align: center;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* CSS-level guarantee: prompt never visible when image is present */
.ccp-upload-area.has-image .ccp-upload-prompt {
    display: none !important;
}

.ccp-upload-text {
    font-size: 14px;
    font-weight: 600;
    color: #1f2440;
}

.ccp-upload-hint {
    font-size: 12px;
    color: #9aa1ae;
}

/* ── Preview image ──────────────────────────────────────────────────────── */
/*
 * Key change: the image is NO LONGER absolutely positioned.
 * It sits in normal flow so the container grows to fit it naturally.
 * This means portrait images are never cropped — the box simply becomes taller.
 */
.ccp-preview-img {
    display: block;
    width: 100%;           /* fill the full width of the container */
    height: auto;          /* height scales with the real image aspect ratio */
    max-height: 480px;     /* cap very tall images so they don't dominate the page */
    object-fit: contain;   /* never crop — show the whole part */
    object-position: center;
    border-radius: 0;
}

/* ── Loading indicator ──────────────────────────────────────────────────── */
.ccp-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding: 18px 0 0;
    font-size: 13.5px;
    color: #2f80ed;
    font-weight: 600;
}

.ccp-spinner {
    width: 16px;
    height: 16px;
    border: 2.5px solid #d7e6ff;
    border-top-color: #2f80ed;
    border-radius: 50%;
    display: inline-block;
    animation: ccp-spin 0.7s linear infinite;
}

@keyframes ccp-spin {
    to { transform: rotate(360deg); }
}

/* ── Error ──────────────────────────────────────────────────────────────── */
.ccp-error {
    margin-top: 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
}

/* ── Result cards ───────────────────────────────────────────────────────── */
.ccp-result {
    margin-top: 18px;
}

.ccp-result-row {
    display: flex;
    gap: 16px;
}

.ccp-result-block {
    flex: 1;
    background: #fff;
    border: 1px solid #e6eaf2;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
}

.ccp-result-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9aa1ae;
    margin-bottom: 6px;
}

.ccp-result-value {
    font-size: 22px;
    font-weight: 800;
    color: #1f2440;
    line-height: 1.2;
}

.ccp-result-category {
    font-size: 12.5px;
    font-weight: 600;
    color: #2f80ed;
    margin-top: 2px;
}

.ccp-result-price {
    font-size: 26px;
    font-weight: 800;
    color: #1f8a3e;
    line-height: 1.2;
}

.ccp-reupload-btn {
    margin-top: 12px;
    background: none;
    border: none;
    color: #2f80ed;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
}

.ccp-reupload-btn:hover {
    color: #0b122b;
}

.ccp-price-pending {
    font-size: 13px;
    color: #9aa1ae;
    font-weight: 500;
}

@media (max-width: 480px) {
    .ccp-result-row { flex-direction: column; }
    .ccp-preview-img { max-height: 300px; }
}
