/* =========================================================
   HORIZON BEE AFRICA — DASHBOARD: ADVERTS
   Uses the dashboard styles in products.css; this file only
   adds what the Adverts page needs.
   ========================================================= */

.spot-help {
    margin: 0 0 16px;

    color: var(--text-soft);

    font-size: 13.5px;
}


/* ---------------------------------------------------------
   LIST
   --------------------------------------------------------- */

.spot-admin-list {
    display: grid;
    gap: 10px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.spot-row {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;

    padding: 12px;

    background: var(--white);
    border: 1px solid var(--line);
}

.spot-thumb {
    display: block;

    width: 220px;
    height: 44px;

    overflow: hidden;

    background: var(--brown-dark);
}

.spot-thumb img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.spot-thumb-text {
    display: flex;
    align-items: center;

    padding: 0 12px;

    overflow: hidden;

    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.spot-thumb-dark { background: var(--brown); color: #ffffff; }
.spot-thumb-gold { background: #fdf3d8; color: var(--brown-dark); }
.spot-thumb-light { background: #fafafa; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

.spot-info {
    display: grid;
    gap: 2px;

    min-width: 0;
}

.spot-info strong {
    overflow: hidden;

    font-size: 14.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.spot-info span {
    color: var(--muted);

    font-size: 12.5px;
}

.spot-actions {
    display: flex;
    gap: 6px;
}

.pill-ad-running { background: var(--green-soft); color: var(--green); }
.pill-ad-scheduled { background: var(--gold-soft); color: #8a6200; }
.pill-ad-ended,
.pill-ad-off { background: #eeeeee; color: #6e6e6e; }


/* ---------------------------------------------------------
   DIALOG
   --------------------------------------------------------- */

.spot-dialog {
    width: min(1000px, calc(100% - 24px));
    max-height: calc(100vh - 32px);
    padding: 0;

    background: var(--white);
    border: 0;
    border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);

    color: var(--text);
}

.spot-dialog::backdrop {
    background: rgba(28, 20, 4, 0.55);
}

.spot-form {
    display: flex;
    flex-direction: column;

    max-height: calc(100vh - 32px);
}

.spot-dialog-head,
.spot-dialog-foot {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 14px 20px;
}

.spot-dialog-head {
    justify-content: space-between;

    border-bottom: 1px solid var(--line);
}

.spot-dialog-head h2 {
    margin: 0;

    font-size: 18px;
}

.spot-dialog-close {
    width: 36px;
    height: 36px;

    background: transparent;
    border: 0;
    border-radius: 50%;

    color: var(--text-soft);

    font-size: 24px;
    line-height: 1;

    cursor: pointer;
}

.spot-dialog-close:hover {
    background: var(--gold-soft);
    color: var(--brown);
}

.spot-dialog-body {
    flex: 1;

    padding: 18px 20px;

    overflow-y: auto;
}

.spot-dialog-foot {
    border-top: 1px solid var(--line);
}

.spot-dialog-foot .spacer {
    flex: 1;
}

.spot-dialog fieldset {
    margin: 0 0 16px;
    padding: 0;

    border: 0;
}

.spot-dialog legend {
    margin-bottom: 6px;
    padding: 0;

    font-size: 13px;
    font-weight: 600;
}

.spot-dialog .checkbox {
    margin-bottom: 12px;

    font-weight: 500;
}

.spot-where {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
}

.spot-where legend {
    width: 100%;
}

.spot-where .checkbox {
    margin: 0;
}


/* Type choice */
.spot-kind {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.spot-kind legend {
    grid-column: 1 / -1;
}

.choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    padding: 12px;

    border: 1px solid var(--line);
    border-radius: 8px;

    cursor: pointer;
}

.choice:has(input:checked) {
    border-color: var(--brown);
    background: #fdfaf2;
}

.choice input {
    margin-top: 3px;

    accent-color: var(--brown);
}

.choice span {
    display: grid;
    gap: 2px;

    color: var(--text-soft);

    font-size: 12.5px;
}

.choice strong {
    color: var(--text);

    font-size: 14px;
}


/* Image choosers */
.image-pick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.image-pick img {
    width: 100%;
    max-height: 90px;

    object-fit: contain;

    background: var(--bg);
    border: 1px solid var(--line);
}


/* Live preview */
.spot-preview {
    margin-bottom: 20px;
    padding: 12px;

    background: var(--bg);
    border: 1px solid var(--line);
}

.spot-preview-label {
    display: block;

    margin-bottom: 8px;

    color: var(--muted);

    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.spot-preview .hint {
    margin: 8px 0 0;

    color: var(--muted);

    font-size: 12px;
}

.spot-preview .spot-strip {
    height: 92px;
}

.preview-empty {
    justify-content: center;

    color: rgba(255, 255, 255, 0.7);

    font-size: 13px;
}

.form-message {
    margin: 8px 0 0;
    padding: 10px 12px;

    background: var(--red-soft);
    border-radius: 8px;

    color: var(--red);

    font-size: 13.5px;
}


/* ---------------------------------------------------------
   PHONES
   --------------------------------------------------------- */

@media (max-width: 760px) {

    .spot-row {
        grid-template-columns: 1fr auto;
        gap: 10px;
    }

    .spot-thumb {
        grid-column: 1 / -1;

        width: 100%;
        height: 52px;
    }

    .spot-actions {
        grid-column: 1 / -1;
    }

    .spot-actions .btn {
        flex: 1;
    }

    .spot-kind {
        grid-template-columns: 1fr;
    }

    .spot-dialog .field-row {
        grid-template-columns: 1fr;
    }

    .spot-preview .spot-strip {
        height: 118px;
    }
}


/* ---------------------------------------------------------
   FORM FIXES (keep radio buttons and ticks their normal size
   inside .field groups; even spacing between rows)
   --------------------------------------------------------- */

.spot-dialog .choice input,
.spot-dialog .checkbox input {
    flex: 0 0 auto;

    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 2px 0 0;
    padding: 0;
}

.spot-dialog .field-row {
    margin-bottom: 16px;
}

.spot-dialog .field-row .field {
    margin-bottom: 0;
}

.spot-dialog .field select {
    min-height: 44px;
    height: 44px;
}

/* Image designs preview at the shop strip's real shape */
.spot-preview .spot-strip.is-image {
    height: auto;
    aspect-ratio: 1028 / 92;
}

#image-fields > .field:last-child,
#text-fields > .field:last-child {
    margin-bottom: 16px;
}

@media (max-width: 760px) {

    .spot-preview .spot-strip.is-image {
        aspect-ratio: 362 / 118;
    }
}


/* ---------------------------------------------------------
   PREVIEW: sticky at the top while you design, with a
   desktop / phone switch
   --------------------------------------------------------- */

.spot-dialog-body > .spot-preview {
    position: sticky;
    top: -18px;
    z-index: 5;

    margin: -18px -20px 20px;
    padding: 12px 20px;

    border-width: 0 0 1px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.04);
}

.spot-preview-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 8px;
}

.spot-preview-top .spot-preview-label {
    margin: 0;
}

.preview-size {
    display: inline-flex;

    border: 1px solid var(--line);
}

.preview-size button {
    padding: 5px 12px;

    background: var(--white);
    border: 0;

    color: var(--text-soft);

    font: inherit;
    font-size: 12.5px;

    cursor: pointer;
}

.preview-size button + button {
    border-left: 1px solid var(--line);
}

.preview-size button.is-active {
    background: var(--brown);
    color: #ffffff;
}

.spot-preview .spot-strip.is-phone {
    max-width: 390px;
    margin: 0 auto;
}

.spot-preview .spot-strip.is-image.is-phone {
    height: auto;
    aspect-ratio: 1080 / 354;
}


/* ---------------------------------------------------------
   DESIGNER
   --------------------------------------------------------- */

.design-panel {
    margin: 4px 0 18px;

    border: 1px solid var(--line);
}

.d-heading {
    margin: 0;
    padding: 12px 14px;

    background: #fdfaf2;
    border-bottom: 1px solid var(--line);

    color: var(--brown);

    font-size: 14px;
    letter-spacing: 0.04em;
}

.d-section {
    border-bottom: 1px solid var(--line);
}

.d-section:last-child {
    border-bottom: 0;
}

.d-section > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 11px 14px;

    font-size: 13.5px;
    font-weight: 600;

    list-style: none;
    cursor: pointer;
}

.d-section > summary::-webkit-details-marker {
    display: none;
}

.d-section > summary::after {
    content: "";

    width: 8px;
    height: 8px;

    border-right: 2px solid var(--text-soft);
    border-bottom: 2px solid var(--text-soft);

    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.d-section[open] > summary::after {
    transform: rotate(-135deg);
}

.d-section > summary:hover {
    background: #fafafa;
}

.d-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px 18px;

    padding: 4px 14px 16px;
}

.d-grid > [data-when] {
    display: contents;
}

.d-grid > [data-when][hidden] {
    display: none;
}

.d-control {
    display: grid;
    align-content: start;
    gap: 6px;

    min-width: 0;
}

.d-label {
    display: flex;
    justify-content: space-between;
    gap: 8px;

    color: var(--text-soft);

    font-size: 12.5px;
    font-weight: 600;
}

.d-label output {
    color: var(--text);

    font-weight: 700;
}

.d-label .hint {
    font-weight: 400;
}

.d-control select {
    width: 100%;
    height: 38px;
    padding: 0 10px;

    background: var(--white);
    border: 1px solid var(--line);

    color: var(--text);

    font: inherit;
    font-size: 13.5px;
}

.d-control input[type="range"] {
    width: 100%;

    accent-color: var(--brown);
}

.d-colour-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.d-colour-row input[type="color"] {
    flex: 0 0 auto;

    width: 40px;
    height: 32px;
    padding: 2px;

    background: var(--white);
    border: 1px solid var(--line);

    cursor: pointer;
}

.swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.swatch {
    width: 20px;
    height: 20px;
    padding: 0;

    border: 1px solid rgba(0, 0, 0, 0.18);

    cursor: pointer;
}

.swatch.is-chosen {
    outline: 2px solid var(--brown);
    outline-offset: 2px;
}

.d-check {
    display: flex;
    align-items: center;
    gap: 8px;

    align-self: end;

    min-height: 38px;

    font-size: 13.5px;
}

.d-check input {
    width: 18px;
    height: 18px;
    margin: 0;

    accent-color: var(--brown);
}

/* Layout choices, drawn as tiny adverts */
.d-layouts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;

    padding: 4px 14px 16px;
}

.d-layout {
    display: grid;
    justify-items: center;
    gap: 6px;

    padding: 10px;

    border: 1px solid var(--line);

    color: var(--text-soft);

    font-size: 12.5px;
    text-align: center;

    cursor: pointer;
}

.d-layout input {
    position: absolute;

    opacity: 0;
    pointer-events: none;
}

.d-layout:has(input:checked) {
    border-color: var(--brown);
    background: #fdfaf2;

    color: var(--text);
}

.d-layout:has(input:focus-visible) {
    outline: 2px solid var(--brown);
    outline-offset: 2px;
}

.d-layout-pic {
    display: flex;
    align-items: center;
    gap: 5px;

    width: 100%;
    max-width: 150px;
    height: 34px;
    padding: 0 8px;

    background: var(--brown);
}

.d-layout-pic i,
.d-layout-pic b,
.d-layout-pic em {
    display: block;

    height: 6px;
}

.d-layout-pic i  { width: 18px; background: #d89b00; }
.d-layout-pic b  { flex: 1; height: 8px; background: #ffffff; }
.d-layout-pic em { width: 22px; background: #d89b00; opacity: 0.7; }

.d-layout-stack {
    display: grid;
    grid-template-columns: 1fr 22px;
    grid-template-rows: 6px 8px;
    align-content: center;
    gap: 3px 5px;
}

.d-layout-stack i  { grid-column: 1; grid-row: 1; }
.d-layout-stack b  { grid-column: 1; grid-row: 2; }
.d-layout-stack em { grid-column: 2; grid-row: 1 / 3; align-self: center; }

.d-layout-center {
    justify-content: center;
}

.d-layout-center b {
    flex: 0 0 50px;
}

.d-picture {
    grid-column: 1 / -1;
}

.d-picture .image-pick img {
    width: auto;
    max-width: 160px;
    max-height: 60px;
}

@media (max-width: 760px) {

    .d-layouts {
        grid-template-columns: 1fr;
    }

    .spot-dialog-body > .spot-preview {
        top: -18px;
    }
}

.spot-preview .hint.is-warning {
    color: #a33a1c;

    font-weight: 600;
}

.spot-preview .spot-strip.is-phone:not(.is-image) {
    height: 118px;
}
