/* --- Common Wrapper --- */
.aab-block-wrapper {
    margin: 20px 0;
    font-family: inherit;
    max-width: 100%;
}

/* --- BUTTON STYLES (Global) --- */
/* Removed 'a' prefix to ensure it works on any tag if needed, added specific properties */
.aab-btn {
    display: inline-block !important;
    text-decoration: none !important; /* No Underline */
    border-bottom: none !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 12px 25px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease-in-out !important;
    color: #fff !important; /* Ensure text is white */
    white-space: nowrap !important; /* FIX: Prevents text from breaking into 2 lines */
    width: auto !important;
    min-width: 180px; /* Minimum width for consistency */
}

.aab-btn:hover {
    opacity: 0.9 !important;
    transform: translateY(-2px);
    text-decoration: none !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3) !important;
}

/* --- Layout: Single Product --- */
.aab-single-container {
    text-align: center;
    margin-bottom: 25px;
    padding: 10px;
    /* FIX: Removed Border and Shadow as per request */
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.aab-single-img img {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    margin-bottom: 20px;
    border-radius: 4px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    box-shadow: none !important;
}

.aab-single-btn {
    text-align: center;
    margin-top: 15px;
}

/* --- Layout: List View --- */
.aab-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    gap: 20px;
}

.aab-list-img {
    flex: 0 0 100px; /* Fixed width for image column */
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.aab-list-img img {
    width: 100%;
    height: auto;
    max-height: 100px;
    object-fit: contain;
}

.aab-list-content {
    flex: 1; /* Takes remaining space */
    padding: 0 10px;
    min-width: 0; /* Prevents flex overflow */
}

/* Title Styling */
.aab-product-title {
    font-size: 20px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    color: #111;
}
.aab-product-title a {
    text-decoration: none !important;
    color: inherit !important;
    border: none !important;
    box-shadow: none !important;
}
.aab-product-title a:hover {
    color: #0073aa !important;
    text-decoration: underline !important;
}

.aab-list-action {
    flex: 0 0 auto; /* Let it grow if needed */
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* --- Editor Specific Fixes --- */
.aab-editor-preview {
    margin: 20px 0;
    border: 1px dashed #ccc;
    padding: 20px;
    background: #fff; /* White background for better preview */
    position: relative;
}

/* Search UI */
.aab-search-container { padding: 15px; }
.aab-loading { display: flex; align-items: center; justify-content: center; padding: 15px; color: #0073aa; font-weight: bold; }
.aab-results-list { margin-top: 15px; max-height: 300px; overflow-y: auto; border: 1px solid #ddd; background: #fff; }
.aab-result-row { display: flex; align-items: center; padding: 10px; border-bottom: 1px solid #eee; gap: 10px; cursor: pointer; }
.aab-result-row:hover { background: #f0f7ff; }
.aab-result-row img { width: 50px; height: 50px; object-fit: contain; }
.aab-action-bar { margin-top: 15px; padding-top: 10px; border-top: 1px solid #eee; text-align: right; }

/* Mobile Responsive */
@media (max-width: 600px) {
    .aab-list-item {
        flex-direction: column;
        text-align: center;
    }
    .aab-list-action {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    .aab-list-content {
        margin: 15px 0;
    }
}

/* --- Lazy Load Placeholder --- */
.aab-async-wrapper {
    margin: 20px 0;
}
.aab-loading-box {
    border: 2px dashed #e5e7eb;
    background: #f9fafb;
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    color: #6b7280;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}
.aab-spinner {
    border: 3px solid #e5e7eb;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}