.rb-create-ad {
    width: 100%;
    max-width: 900px;
}

.rb-create-ad__header {
    margin-bottom: 40px;
}

.rb-create-ad__section {
    margin-bottom: 24px;
    padding: 32px;
    background: #fff;
    border-radius: 16px;
}

.rb-create-ad__section h2 {
    margin: 0 0 24px;
}

.rb-create-ad__section-description {
    margin: -8px 0 24px;
    color: var(--rb-text-muted, #6b7280);
    font-size: 15px;
    line-height: 1.6;
}

.rb-create-ad__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.rb-create-ad__field:last-child {
    margin-bottom: 0;
}

.rb-create-ad__field > label {
    font-weight: 600;
}

.rb-create-ad input:not([type="radio"]):not([type="checkbox"]),
.rb-create-ad select,
.rb-create-ad textarea {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: 16px;
    line-height: 1.4;
    box-sizing: border-box;
}

.rb-create-ad input:not([type="radio"]):not([type="checkbox"]):focus,
.rb-create-ad select:focus,
.rb-create-ad textarea:focus {
    border-color: var(--rb-primary, #e10600);
    outline: none;
    box-shadow:
        0 0 0 2px rgba(225, 6, 0, .10);
}

.rb-create-ad textarea {
    resize: vertical;
}

.rb-create-ad input[type="radio"],
.rb-create-ad input[type="checkbox"] {
    flex: 0 0 auto;
    width: auto;
    padding: 0;
    accent-color: var(--rb-primary, #e10600);
}

.rb-create-ad__help {
    margin: 2px 0 0;
    color: var(--rb-text-muted, #6b7280);
    font-size: 13px;
    line-height: 1.5;
}

.rb-create-ad__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 14px 24px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.rb-create-ad__options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.rb-create-ad__options label,
.rb-create-ad__checkbox {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.rb-create-ad__options input[type="radio"],
.rb-create-ad__checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}


/* =========================================================
   CONTACTS
   ========================================================= */

.rb-create-ad__contact-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.rb-create-ad__contact-grid .rb-create-ad__field {
    margin-bottom: 0;
}


/* =========================================================
   EXPIRATION MODE
   ========================================================= */

.rb-create-ad__expiration-options {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.rb-create-ad__expiration-option {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    margin: 0;
    padding: 18px;
    cursor: pointer;
    background: var(--rb-background, #f8f9fa);
    border: 1px solid var(--rb-border, #e5e7eb);
    border-radius: 12px;
    transition:
        border-color .18s ease,
        background-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

.rb-create-ad__expiration-option:hover {
    border-color: var(--rb-primary, #e10600);
}

.rb-create-ad__expiration-option:has(input:checked) {
    background: #fff;
    border-color: var(--rb-primary, #e10600);
    box-shadow:
        0 0 0 1px var(--rb-primary, #e10600);
}

.rb-create-ad__expiration-option input[type="radio"] {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    padding: 0;
    cursor: pointer;
}

.rb-create-ad__expiration-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.rb-create-ad__expiration-content strong {
    display: block;
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.rb-create-ad__expiration-content > span {
    display: block;
    margin: 0;
    color: var(--rb-text-muted, #6b7280);
    font-size: 13px;
    line-height: 1.55;
}


/* =========================================================
   EDIT GALLERY
   ========================================================= */

.rb-ad-gallery {
    width: 100%;
}

.rb-ad-gallery__toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.rb-ad-gallery__toolbar > div {
    min-width: 0;
}

.rb-ad-gallery__toolbar strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

.rb-ad-gallery__add {
    flex: 0 0 auto;
    cursor: pointer;
    white-space: nowrap;
}

.rb-ad-gallery__file-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0 !important;
}

.rb-ad-gallery__list {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rb-ad-gallery__item {
    position: relative;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--rb-border, #e5e7eb);
    border-radius: 12px;
    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        opacity .18s ease;
}

.rb-ad-gallery__item:hover {
    border-color: #cbd5e1;
    box-shadow:
        0 6px 18px rgba(0, 0, 0, .06);
}

.rb-ad-gallery__item.is-cover {
    border-color: var(--rb-primary, #e10600);
}

.rb-ad-gallery__item.is-dragging {
    opacity: .45;
}

.rb-ad-gallery__image {
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
}

.rb-ad-gallery__image img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.rb-ad-gallery__cover,
.rb-ad-gallery__new {
    position: absolute;
    top: 10px;
    z-index: 2;
    min-height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    line-height: 26px;
}

.rb-ad-gallery__cover {
    left: 10px;
    color: #fff;
    background: var(--rb-primary, #e10600);
}

.rb-ad-gallery__cover:empty {
    display: none;
}

.rb-ad-gallery__new {
    right: 10px;
    color: #374151;
    background: rgba(255, 255, 255, .92);
}

.rb-ad-gallery__actions {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
}

.rb-ad-gallery__actions .rb-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 12px;
    text-align: center;
}

.rb-ad-gallery__actions .rb-button[hidden] {
    display: none;
}

.rb-ad-gallery__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 150px;
    padding: 28px;
    color: var(--rb-text-muted, #6b7280);
    background: var(--rb-background, #f8f9fa);
    border: 1px dashed var(--rb-border, #d1d5db);
    border-radius: 12px;
    text-align: center;
}

.rb-ad-gallery__empty[hidden] {
    display: none;
}

.rb-ad-gallery__empty strong {
    color: var(--rb-text, #111827);
    font-size: 15px;
}

.rb-ad-gallery__empty span {
    font-size: 13px;
}

.rb-ad-gallery__notice {
    margin-top: 12px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
    .rb-create-ad {
        max-width: none;
    }
}

@media (max-width: 700px) {
    .rb-create-ad__section {
        padding: 24px;
    }

    .rb-create-ad__contact-grid {
        grid-template-columns: 1fr;
    }

    .rb-create-ad__expiration-options {
        grid-template-columns: 1fr;
    }

    .rb-ad-gallery__toolbar {
        flex-direction: column;
    }

    .rb-ad-gallery__add {
        width: 100%;
    }

    .rb-ad-gallery__list {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .rb-create-ad__header {
        margin-bottom: 28px;
    }

    .rb-create-ad__section {
        margin-bottom: 18px;
        padding: 20px;
        border-radius: 12px;
    }

    .rb-create-ad__section h2 {
        margin-bottom: 20px;
    }

    .rb-create-ad__expiration-option {
        padding: 15px;
    }

    .rb-ad-gallery__list {
        grid-template-columns: 1fr;
    }

    .rb-ad-gallery__actions {
        grid-template-columns: 1fr;
    }

    .rb-create-ad__button {
        width: 100%;
    }
}