/* =============================================================
   Annonsplatsen v3 – Frontend CSS
   Hög specificity mot Breakdance: html body .ap-* selectors
   ============================================================= */

/* =================================================
   Bas
   ================================================= */

html body .ap-hint {
    font-size: 12px;
    color: #888;
    margin: 3px 0 0;
    display: block;
}

html body .ap-hint-label {
    font-size: 12px;
    color: #bbb !important;
    font-weight: 400 !important;
    margin-left: 5px;
    font-style: italic;
}

html body .ap-hint-warning { color: #c0392b !important; font-size: 13px !important; }

html body .ap-empty {
    color: #666;
    font-size: 14px;
    padding: 20px;
    border: 1px dashed #eee;
    border-radius: 8px;
}

html body .ap-divider {
    border: none;
    border-top: 1px dashed #ddd;
    margin: 36px 0;
}

/* =================================================
   Formulär – Hög specificity
   ================================================= */

html body .ap-form-wrap { max-width: 780px; }
html body .ap-field { margin-bottom: 20px; }

html body .ap-field label,
html body .ap-form-wrap label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #000;
}

html body .ap-form-wrap input[type="text"],
html body .ap-form-wrap input[type="email"],
html body .ap-form-wrap input[type="url"],
html body .ap-form-wrap input[type="tel"],
html body .ap-form-wrap input[type="number"],
html body .ap-form-wrap input[type="password"],
html body .ap-form-wrap select,
html body .ap-settings-wrap input[type="text"],
html body .ap-settings-wrap input[type="email"],
html body .ap-settings-wrap input[type="password"],
html body .ap-settings-wrap select {
    width: 100% !important;
    height: 44px !important;
    line-height: 44px !important;
    box-sizing: border-box !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    background: #fff !important;
    padding: 0 15px !important;
    font-size: 14px !important;
    color: #000 !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    margin: 0 !important;
}

html body .ap-form-wrap textarea,
html body .ap-settings-wrap textarea {
    width: 100% !important;
    min-height: 140px !important;
    box-sizing: border-box !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    padding: 10px 15px !important;
    font-size: 14px !important;
    color: #000 !important;
    line-height: 1.6 !important;
    resize: vertical !important;
    outline: none !important;
    box-shadow: none !important;
    background: #fff !important;
    margin: 0 !important;
}

html body .ap-form-wrap input:focus,
html body .ap-form-wrap select:focus,
html body .ap-form-wrap textarea:focus,
html body .ap-settings-wrap input:focus,
html body .ap-settings-wrap select:focus {
    border-color: #555 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Grid layouts */
html body .ap-row-2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
}

html body .ap-row-3 {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 16px !important;
}

@media (max-width: 600px) {
    html body .ap-row-2,
    html body .ap-row-3 { grid-template-columns: 1fr !important; }
}

/* =================================================
   Knappar
   ================================================= */

html body .ap-submit,
html body input.ap-submit {
    background: #000 !important;
    color: #fff !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    height: 44px !important;
    padding: 0 40px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    line-height: 1 !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

html body .ap-submit:hover,
html body input.ap-submit:hover { background: #222 !important; }

/* ── Knapp-loading: spinner + animerade punkter ── */
html body .ap-btn-loading {
    pointer-events: none !important;
    opacity: 0.9 !important;
    gap: 0 !important;
}
html body .ap-btn-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ap-spin 0.65s linear infinite;
    flex-shrink: 0;
    margin-right: 8px;
}
html body .ap-btn-label {
    display: inline-block;
}
html body .ap-btn-dots {
    display: inline-flex;
    align-items: flex-end;
    height: 1em;
    margin-left: 1px;
}
html body .ap-btn-dots span {
    opacity: 0;
    animation: ap-dot-fade 1.2s ease-in-out infinite;
    font-size: inherit;
    line-height: 1;
}
html body .ap-btn-dots span:nth-child(1) { animation-delay: 0s; }
html body .ap-btn-dots span:nth-child(2) { animation-delay: 0.2s; }
html body .ap-btn-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ap-dot-fade {
    0%, 80%, 100% { opacity: 0; }
    40%            { opacity: 1; }
}

html body .ap-submit-danger,
html body input.ap-submit-danger {
    background: #c0392b !important;
    border-color: #c0392b !important;
}
html body .ap-submit-danger:hover,
html body input.ap-submit-danger:hover { background: #a93226 !important; }

html body .ap-btn-back {
    background: none !important;
    border: 1px solid #ccc !important;
    color: #555 !important;
    height: 44px !important;
    padding: 0 24px !important;
    font-size: 13px !important;
    cursor: pointer !important;
    border-radius: 0 !important;
    transition: border-color 0.15s !important;
    display: inline-flex !important;
    align-items: center !important;
}
html body .ap-btn-back:hover { border-color: #000 !important; color: #000 !important; }

html body .ap-btn { text-decoration: none; cursor: pointer; background: none; border: none; padding: 0; font-size: 13px; font-weight: 600; }
html body .ap-btn-blue  { color: #007bff; }
html body .ap-btn-red   { color: #d93025; }
html body .ap-btn-green { color: #28a745; }

/* =================================================
   Progressbar
   ================================================= */

html body .ap-progress { margin-bottom: 32px; }

html body .ap-progress-label {
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
    font-weight: 500;
    display: block;
}

html body .ap-progress-bar {
    height: 4px;
    background: #e8e8e8;
    border-radius: 2px;
    overflow: hidden;
}

html body .ap-progress-fill {
    height: 100%;
    background: #000;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* =================================================
   Bilduppladdning – Kvadratiska rutor utan glapp
   ================================================= */

html body .ap-image-upload-area {
    border: 1px solid #ddd;
    padding: 16px;
    background: #fafafa;
    transition: background 0.15s, border-color 0.15s;
}

html body .ap-image-upload-area.ap-dragover {
    background: #f0f0f0;
    border-color: #000;
    border-style: dashed;
}

html body .ap-image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

html body .ap-image-item {
    position: relative;
    /* Behåller 1:1 ratio med padding-top trick */
    width: 100%;
    padding-top: 100%;
    cursor: grab;
    border: 1px solid #ddd;
    overflow: hidden;
}

html body .ap-image-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

/* Upload spinner position for new layout */
html body .ap-image-item .ap-upload-spinner {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

html body .ap-image-item.ap-dragging { opacity: 0.4; }
html body .ap-image-item.ap-drag-over { outline: 2px solid #000; }
html body .ap-image-item.ap-uploading { opacity: 0.6; }

html body .ap-image-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.65);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 2;
    transition: background 0.15s;
}
html body .ap-image-remove:hover { background: #c0392b; }

html body .ap-upload-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
html body .ap-upload-spinner::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255,255,255,0.8);
    border-top-color: transparent;
    border-radius: 50%;
    animation: ap-spin 0.7s linear infinite;
}

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

html body .ap-image-add {
    width: 100%;
    padding-top: 100%;
    position: relative;
    border: 1px dashed #bbb;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
}

html body .ap-image-add .ap-add-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
html body .ap-image-add:hover { border-color: #000; background: #f5f5f5; }

html body .ap-add-icon { font-size: 28px; color: #bbb; line-height: 1; }

/* =================================================
   Boost-kort (Steg 2)
   ================================================= */

html body .ap-boost-section { max-width: 640px; }

html body .ap-boost-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 500px) {
    html body .ap-boost-cards { grid-template-columns: 1fr; }
}

html body .ap-boost-card { cursor: pointer; display: block; }
html body .ap-boost-card input { display: none; }

html body .ap-boost-card-inner {
    border: 1px solid #ddd;
    padding: 20px;
    transition: border-color 0.15s, background 0.15s;
    background: #fff;
}

html body .ap-boost-card:hover .ap-boost-card-inner { border-color: #000; }
html body .ap-boost-selected .ap-boost-card-inner { border-color: #000 !important; background: #f9f9f9 !important; }

html body .ap-boost-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    background: #000;
    color: #fff;
    display: inline-block;
    padding: 3px 10px;
    margin-bottom: 12px;
}

html body .ap-boost-desc { font-size: 13px; color: #555; line-height: 1.5; margin-bottom: 16px; }
html body .ap-boost-price { font-size: 20px; font-weight: 700; color: #000; }

/* Prissummering */
html body .ap-summary-box {
    background: #f9f9f9;
    border: 1px solid #eee;
    padding: 20px;
    margin-bottom: 4px;
}

html body .ap-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 6px 0;
    color: #333;
}

html body .ap-summary-total {
    font-size: 18px !important;
    font-weight: 700 !important;
    border-top: 2px solid #000 !important;
    margin-top: 8px !important;
    padding-top: 14px !important;
    color: #000 !important;
}

/* =================================================
   Bekräftelsebox
   ================================================= */

html body .ap-confirm-box {
    padding: 24px;
    border: 1px solid #eee;
    border-radius: 8px;
    max-width: 500px;
}

/* =================================================
   Profilavatar
   ================================================= */

html body .ap-avatar-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

/* Klickbar cirkel */
html body .ap-avatar-circle {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
}

html body #ap-avatar-preview {
    width: 90px !important;
    height: 90px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    border: 2px solid #e0e0e0 !important;
    display: block !important;
    transition: filter 0.2s !important;
}

html body .ap-avatar-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
html body .ap-avatar-overlay span {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}
html body .ap-avatar-circle:hover .ap-avatar-overlay { opacity: 1; }
html body .ap-avatar-circle:hover #ap-avatar-preview { filter: brightness(0.75); }

/* × knapp bredvid cirkeln */
html body .ap-avatar-remove {
    display: inline-block !important;
    background: none !important;
    border: none !important;
    color: #c0392b !important;
    font-size: 22px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 4px 8px !important;
    opacity: 0.7 !important;
    transition: opacity 0.15s !important;
}
html body .ap-avatar-remove:hover { opacity: 1 !important; }

/* =================================================
   Checkbox (radera konto)
   ================================================= */

html body .ap-checkbox-label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    cursor: pointer !important;
    font-weight: 400 !important;
    font-size: 14px !important;
    color: #333 !important;
}

html body .ap-checkbox-label input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    margin-top: 2px !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    accent-color: #000 !important;
    appearance: auto !important;
    -webkit-appearance: auto !important;
    border: 1px solid #000 !important;
}

html body .ap-checkbox-label span { line-height: 1.5; }

/* =================================================
   Inställningar
   ================================================= */

html body .ap-settings-wrap .ap-settings-section { margin-bottom: 8px; }
html body .ap-settings-wrap .ap-settings-section h2 { font-size: 20px; margin: 0 0 12px; }

/* =================================================
   Mina Annonser
   ================================================= */

html body .ap-ad-list { display: flex; flex-direction: column; gap: 10px; }

html body .ap-ad-row {
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    transition: box-shadow .15s;
}
html body .ap-ad-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

html body .ap-ad-thumb {
    width: 70px;
    height: 56px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 6px;
}
html body .ap-ad-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}
html body .ap-ad-thumb-empty {
    width: 70px;
    height: 56px;
    background: #f3f4f6;
    border-radius: 6px;
}

html body .ap-ad-info { flex-grow: 1; min-width: 0; }
html body .ap-ad-info h4 { margin: 0; font-size: 14px; font-weight: 500; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html body .ap-ad-expiry { font-size: 11px; color: #9ca3af; margin-top: 2px; font-weight: 500; }
html body .ap-expired   { color: #d93025 !important; font-weight: 700 !important; }

html body .ap-ad-actions {
    display: flex;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    align-items: center;
    flex-shrink: 0;
}

/* =================================================
   Mina Köp
   ================================================= */

html body .ap-receipts { background: #fff; border-radius: 10px; border: 1px solid #eee; overflow: hidden; }

html body .ap-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}
html body .ap-table thead { background: #fcfcfc; border-bottom: 2px solid #f0f0f0; }
html body .ap-table th,
html body .ap-table td { padding: 14px 16px; }
html body .ap-table tbody tr { border-bottom: 1px solid #f9f9f9; }
html body .ap-table a { color: #007bff; text-decoration: none; }

/* =================================================
   Formulärmeddelanden
   ================================================= */

html body .ap-form-message {
    padding: 12px 16px;
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.5;
}
html body .ap-form-message.success { background: #e6f4ea; color: #137333; border: 1px solid #a8d5b5; }
html body .ap-form-message.error   { background: #fce8e6; color: #c5221f; border: 1px solid #f5c2be; }

/* =================================================
   FaceWP fSelect
   ================================================= */

.facetwp-type-fselect .fs-wrap, .fs-wrap { width: 100% !important; display: block !important; position: relative !important; }
.fs-label-wrap { width: 100% !important; height: 44px !important; border: 1px solid #000 !important; border-radius: 0 !important; padding: 0 15px !important; display: flex !important; align-items: center !important; background: #fff !important; box-sizing: border-box !important; }
.fs-search { padding: 10px 15px !important; border-bottom: 1px solid #eee !important; box-sizing: border-box !important; }
.fs-search input { width: 100% !important; height: 38px !important; padding: 0 12px !important; border: 1px solid #ddd !important; border-radius: 0 !important; background: #fafafa !important; font-size: 14px !important; outline: none !important; box-sizing: border-box !important; }
.fs-dropdown { width: 100% !important; border: 1px solid #000 !important; border-top: none !important; margin-top: -1px !important; box-shadow: 0 6px 15px rgba(0,0,0,0.1) !important; background: #fff !important; box-sizing: border-box !important; z-index: 1000 !important; }
.fs-arrow { width: 20px !important; height: 100% !important; position: absolute !important; right: 10px !important; top: 0 !important; display: flex !important; align-items: center !important; justify-content: center !important; transition: transform 0.2s ease !important; background: transparent !important; border: none !important; }
.fs-arrow:after { content: '' !important; width: 7px !important; height: 7px !important; border-right: 1.5px solid #000 !important; border-bottom: 1.5px solid #000 !important; transform: rotate(45deg) !important; display: block !important; margin-top: -4px !important; }
.fs-open .fs-arrow { transform: rotate(-180deg) !important; }
.fs-option { padding: 10px 15px !important; display: flex; align-items: center !important; box-sizing: border-box !important; }
.fs-option.fs-hide { display: none !important; }
.fs-option.selected { background-color: #f2f2f2 !important; color: #000 !important; }
.fs-option .fs-checkbox { width: 18px !important; height: 18px !important; border: 1px solid #000 !important; border-radius: 0 !important; margin-right: 12px !important; background: #fff !important; position: relative !important; flex-shrink: 0 !important; }
.fs-option.selected .fs-checkbox { background: #000 !important; border-color: #000 !important; }
.fs-option.selected .fs-checkbox:after { content: '' !important; position: absolute !important; top: 50% !important; left: 50% !important; width: 4px !important; height: 8px !important; border: solid #fff !important; border-width: 0 2px 2px 0 !important; transform: translate(-50%, -60%) rotate(45deg) !important; }
.fs-option.d1 { padding-left: 35px !important; }
.fs-option.d2 { padding-left: 55px !important; }
.fs-options { max-height: 300px !important; overflow-y: auto !important; }
.facetwp-facet { margin-bottom: 15px !important; }
.fs-option .fs-checkbox i { display: none !important; }

.facetwp-pager { display: flex !important; gap: 8px !important; margin-top: 15px !important; }
.facetwp-page { display: flex !important; align-items: center !important; justify-content: center !important; min-width: 40px !important; height: 40px !important; padding: 0 10px !important; border: 1px solid #000 !important; background: #fff !important; color: #000 !important; text-decoration: none !important; font-size: 14px !important; font-weight: 500 !important; transition: all 0.2s ease !important; cursor: pointer !important; }
.facetwp-page.active { background: #000 !important; color: #fff !important; border-color: #000 !important; cursor: default !important; }
.facetwp-page:hover:not(.active) { background: #f2f2f2 !important; }
.facetwp-page.next, .facetwp-page.prev { text-transform: uppercase !important; letter-spacing: 1px !important; font-size: 12px !important; padding: 0 15px !important; }

@media (max-width: 768px) { .facetwp-pager { justify-content: center !important; width: 100% !important; } }

.facetwp-type-search, .facetwp-facet-search, .facetwp-input-wrap { width: 100% !important; display: block !important; position: relative !important; }
.facetwp-type-search input.facetwp-search { width: 100% !important; height: 44px !important; border: 1px solid #000 !important; border-radius: 0 !important; padding: 0 45px 0 15px !important; background: #fff !important; font-size: 14px !important; color: #000 !important; box-sizing: border-box !important; outline: none !important; }
.facetwp-facet-search .facetwp-input-wrap i.facetwp-icon { display: none !important; }
.facetwp-facet-search .facetwp-input-wrap::before { content: '' !important; position: absolute !important; right: 17px !important; top: 15px !important; width: 10px !important; height: 10px !important; border: 1.5px solid #000 !important; border-radius: 50% !important; box-sizing: border-box !important; z-index: 2 !important; pointer-events: none !important; }
.facetwp-facet-search .facetwp-input-wrap::after { content: '' !important; position: absolute !important; right: 15px !important; top: 24px !important; width: 5px !important; height: 1.5px !important; background: #000 !important; transform: rotate(45deg) !important; z-index: 2 !important; pointer-events: none !important; }
.facetwp-type-reset { margin-bottom: 5px !important; }
.home .facetwp-facet-kategori .fs-option.d1, .home .facetwp-facet-kategori .fs-option.d2 { display: none !important; }
.bde-loop-item { gap: 10px; }
.text, .text p { margin-top: 5px !important; margin-bottom: 5px !important; }
.annons-titel, .annons-text { display: -webkit-box !important; -webkit-box-orient: vertical !important; overflow: hidden !important; text-overflow: ellipsis !important; word-break: break-all !important; width: 100% !important; }
.annons-titel { -webkit-line-clamp: 1 !important; }
.annons-text  { -webkit-line-clamp: 2 !important; }

/* =================================================
   ap-multistep inherits ap-form-wrap field styling
   (Skapa annons / Publicera igen)
   ================================================= */

html body .ap-multistep input[type="text"],
html body .ap-multistep input[type="email"],
html body .ap-multistep input[type="url"],
html body .ap-multistep input[type="tel"],
html body .ap-multistep input[type="number"],
html body .ap-multistep input[type="password"],
html body .ap-multistep select {
    width: 100% !important;
    height: 44px !important;
    line-height: 44px !important;
    box-sizing: border-box !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    background: #fff !important;
    padding: 0 15px !important;
    font-size: 14px !important;
    color: #000 !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    margin: 0 !important;
}

html body .ap-multistep textarea {
    width: 100% !important;
    min-height: 140px !important;
    box-sizing: border-box !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    padding: 10px 15px !important;
    font-size: 14px !important;
    color: #000 !important;
    line-height: 1.6 !important;
    resize: vertical !important;
    outline: none !important;
    box-shadow: none !important;
    background: #fff !important;
    margin: 0 !important;
}

html body .ap-multistep input:focus,
html body .ap-multistep select:focus,
html body .ap-multistep textarea:focus {
    border-color: #555 !important;
    outline: none !important;
    box-shadow: none !important;
}

html body .ap-multistep .ap-field label {
    display: block !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    margin-bottom: 6px !important;
    color: #000 !important;
}

/* =================================================
   Annonslivscykel – statusindikatorer v5
   ================================================= */

html body .ap-expiring {
    color: #e67e22 !important;
    font-weight: 700 !important;
}

html body .ap-hint-muted {
    color: #aaa;
    font-size: 11px;
}

/* Förlängnings-info-box */
html body .ap-forlang-info {
    background: #f9f9f9;
    border: 1px solid #eee;
    padding: 16px 20px;
    margin-bottom: 28px;
    font-size: 14px;
}

/* =================================================
   v6: Mobil – perfekt symmetri på ap-row-2 och ap-row-3
   ================================================= */

@media (max-width: 600px) {
    /* Samma margin-bottom i mobilen oavsett om fälten låg 1 eller 2 per rad */
    html body .ap-row-2,
    html body .ap-row-3 {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    html body .ap-row-2 .ap-field,
    html body .ap-row-3 .ap-field {
        margin-bottom: 20px !important;
    }
}

/* =================================================
   v6: Bildgrid – begränsa bredd till 3 kolumner
   så höger kant matchar vänster kant
   ================================================= */

html body .ap-image-grid {
    /* 4 bilder per rad: items fyller ut med flex-grow */
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
}

/* =================================================
   v6: Success-sida med confetti
   ================================================= */

html body .ap-success-wrap {
    text-align: center;
    padding: 48px 32px;
    max-width: 520px;
    margin: 0 auto;
}

html body .ap-success-icon {
    width: 64px;
    height: 64px;
    background: #000;
    color: #fff;
    font-size: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-weight: 700;
}

html body .ap-success-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #000;
}

html body .ap-success-sub {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 8px;
}

html body .ap-success-boost {
    font-size: 13px;
    color: #888;
    margin: 0 0 28px;
}

html body .ap-success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 28px;
}

html body .ap-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 28px;
    border: 1px solid #000;
    color: #000;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.15s, color 0.15s;
}

html body .ap-btn-outline:hover {
    background: #000;
    color: #fff;
}

/* =================================================
   v7: Bildgrid – mobil 2 per rad
   ================================================= */

@media (max-width: 600px) {
    html body .ap-image-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* =================================================
   v7: Annons-lista – AKTIV, klickbar, visningar
   ================================================= */

html body .ap-ad-title-link {
    color: inherit !important;
    text-decoration: none !important;
}
html body .ap-ad-title-link:hover {
    text-decoration: underline !important;
}

html body .ap-ad-thumb a {
    display: block;
    width: 100%;
    height: 100%;
}

html body .ap-ad-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    flex-wrap: wrap;
}

html body .ap-ad-status {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

html body .ap-status-publish  { color: #27ae60; }
html body .ap-status-private  { color: #d93025; }
html body .ap-status-pending  { color: #e67e22; }

html body .ap-ad-views {
    font-size: 12px;
    color: #aaa;
    font-weight: 400;
}
html body .ap-ad-views::before {
    content: '·';
    margin-right: 6px;
    color: #ddd;
}
html body .ap-ad-svar-row {
    font-size: 11px;
    color: #374151;
    font-weight: 500;
    margin-top: 2px;
}

/* =================================================
   v10: Pris-fält – inga pilar, "kr" direkt efter input
   ================================================= */

/* Dölj native spinner helt */
html body .ap-form-wrap input[type="number"]::-webkit-inner-spin-button,
html body .ap-form-wrap input[type="number"]::-webkit-outer-spin-button,
html body .ap-multistep input[type="number"]::-webkit-inner-spin-button,
html body .ap-multistep input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    appearance: none !important;
    margin: 0 !important;
}
html body .ap-form-wrap input[type="number"],
html body .ap-multistep input[type="number"] {
    -moz-appearance: textfield !important;
}

/* Wrapper för pris + kr */
html body .ap-price-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #000;
    background: #fff;
}

/* Input inuti wrappern – inga egna borders */
html body .ap-price-wrap input[type="number"] {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    flex: 1 !important;
    padding-right: 8px !important;
    min-width: 0;
}

html body .ap-price-wrap input[type="number"]:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* "kr" etikett direkt efter input, inuti wrappern */
html body .ap-price-suffix {
    padding: 0 14px 0 4px;
    font-size: 14px;
    color: #888;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Fokus-border på wrappern istället för input */
html body .ap-price-wrap:focus-within {
    border-color: #555;
}

/* =================================================
   v9: Offert – grå ut prisfältet
   ================================================= */

html body .ap-price-wrap.ap-offert-disabled input,
html body .ap-price-wrap.ap-offert-disabled .ap-price-suffix,
html body .ap-price-wrap.ap-offert-disabled .ap-price-arrows {
    opacity: 0.35 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

html body .ap-price-wrap.ap-offert-disabled input {
    background: #f5f5f5 !important;
    color: #aaa !important;
}

html body .ap-price-wrap.ap-offert-disabled .ap-price-suffix {
    opacity: 0.35;
}

/* =================================================
   v11: Pointer Events drag – touch + desktop
   ================================================= */

/* touch-action:none på ITEM-nivå förhindrar att browser
   interceptar touch-scroll innan vår pointerdown triggar */
html body .ap-image-item {
    touch-action: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    cursor: grab;
}

html body .ap-image-item:active {
    cursor: grabbing;
}

/* Platshållare under drag */
html body .ap-image-item.ap-drag-placeholder {
    border: 2px dashed #ccc !important;
    background: #f0f0f0 !important;
    opacity: 0.6 !important;
}

/* Grid: ingen touch-action här – tillåter scroll utanför items */
html body .ap-image-grid {
    -webkit-user-select: none;
    user-select: none;
}

/* =================================================
   v10: Kvittohistorik – typetiketter
   ================================================= */

html body .ap-receipt-type {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =================================================
   v12: Svart knapp (redigera/ta bort)
   ================================================= */

html body .ap-btn-dark {
    color: #000 !important;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
}
html body .ap-btn-dark:hover {
    color: #333 !important;
    text-decoration: underline;
}

/* =================================================
   v12: Kvittotabell – horisontell scroll på mobil
   ================================================= */

html body .ap-receipts-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

html body .ap-receipts {
    min-width: 600px; /* Förhindrar bryt av kolumner */
}

/* =================================================
   v12: Load More-knapp
   ================================================= */

html body .ap-load-more-wrap {
    text-align: center;
    padding: 24px 0 8px;
}

html body .ap-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 32px;
    border: 1px solid #000;
    color: #000;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.15s, color 0.15s;
}
html body .ap-load-more:hover {
    background: #000;
    color: #fff;
}

/* =================================================
   v12: Drag CSS – rensa Pointer Events rester
   ================================================= */

html body .ap-image-item {
    touch-action: auto !important; /* Tillåt normal scroll på mobil */
    cursor: grab;
}
html body .ap-image-item:active { cursor: grabbing; }
html body .ap-image-item.ap-drag-placeholder,
html body .ap-image-item.ap-dragging { opacity: 0.5; }
html body .ap-image-item.ap-drag-over { outline: 2px solid #000; }

/* =================================================
   v17: Pagination (Föregående / Nästa)
   ================================================= */

html body .ap-pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    padding: 24px 0 8px;
}

html body .ap-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 28px;
    border: 1px solid #000;
    color: #000;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.15s, color 0.15s;
}

html body .ap-page-btn:hover {
    background: #000;
    color: #fff;
}

/* =================================================
   v17: Avatar – knappar under bilden
   ================================================= */

/* =================================================
   v18: Tom annons-lista CTA
   ================================================= */
html body .ap-empty-cta {
    color: #000;
    font-weight: 600;
    text-decoration: underline;
}
html body .ap-empty-cta:hover { color: #444; }

/* end avatar */
