/*
 * Shared styles for the customer and store-settings pages
 * (users, subscribers, reviews, homepage, carousels, policies, terms, about us, admin settings,
 * dashboard, orders, user orders and the product detail page).
 */
:root {
    --ad-primary: #1F3BB3;
    --ad-primary-soft: #eef1fc;
    --ad-text: #1f2430;
    --ad-muted: #6b7280;
    --ad-border: #e6e8ef;
    --ad-surface: #ffffff;
    --ad-surface-soft: #f7f8fb;
    --ad-danger: #c0271b;
    --ad-danger-soft: #fdeeed;
    --ad-success: #067647;
    --ad-success-soft: #e8f8ef;
    --ad-star: #f5a623;
    --ad-radius: 12px;
}

/* Softer loading overlay */
#overlay {
    background-color: rgba(244, 245, 247, .65) !important;
    backdrop-filter: blur(2px);
}

#loader {
    background-color: transparent !important;
}

#loader img {
    width: 96px;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, .16);
}

@media (max-width: 767.98px) {
    .content-wrapper {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* ---------- Page header ---------- */
.ad-eyebrow {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ad-primary);
    margin-bottom: 4px;
}

.ad-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.ad-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ad-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ad-header p {
    margin: 4px 0 0;
    color: var(--ad-muted);
    font-size: .875rem;
    max-width: 680px;
}

.ad-pill {
    font-size: .75rem;
    font-weight: 600;
    color: var(--ad-primary);
    background: var(--ad-primary-soft);
    border-radius: 999px;
    padding: 3px 10px;
}

.ad-pill:empty {
    display: none;
}

/* ---------- Settings tabs ---------- */
.ad-tabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    margin-bottom: 20px;
    background: var(--ad-surface);
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    overflow-x: auto;
    scrollbar-width: none;
}

.ad-tabs::-webkit-scrollbar {
    display: none;
}

.ad-tabs.is-scrollable {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
}

.ad-tabs.is-scrollable.at-end {
    -webkit-mask-image: none;
    mask-image: none;
}

.ad-tab {
    flex: 1 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 9px;
    color: #4f5669;
    font-size: .8125rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
}

.ad-tab i {
    font-size: 1.05rem;
}

.ad-tab:hover {
    background: var(--ad-surface-soft);
    color: var(--ad-primary);
}

.ad-tab.is-active {
    background: var(--ad-primary);
    color: #fff;
}

/* ---------- Cards & layout ---------- */
.ad-card {
    background: var(--ad-surface);
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    min-width: 0;
    margin-bottom: 20px;
}

.ad-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--ad-border);
}

.ad-card-head h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ad-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ad-card-head h3 i {
    color: var(--ad-primary);
    font-size: 1.15rem;
}

.ad-card-head p {
    font-size: .8125rem;
    color: var(--ad-muted);
    margin: 2px 0 0;
}

.ad-card-body {
    padding: 18px;
}

.ad-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--ad-border);
    background: var(--ad-surface-soft);
    border-radius: 0 0 var(--ad-radius) var(--ad-radius);
}

.ad-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}

@media (min-width: 1400px) {
    .ad-split {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    }

    .ad-split > .ad-card {
        margin-bottom: 0;
    }
}

/* ---------- Toolbar & search ---------- */
.ad-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ad-border);
}

.ad-search {
    position: relative;
    flex: 1 1 260px;
}

.ad-search .mdi-magnify {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ad-muted);
    font-size: 1.15rem;
    pointer-events: none;
}

.ad-search input {
    height: 42px;
    padding: 0 12px 0 38px;
    border: 1px solid var(--ad-border);
    border-radius: 10px;
    font-size: .875rem;
    width: 100%;
    background: var(--ad-surface-soft);
    color: var(--ad-text);
}

.ad-search input:focus {
    outline: none;
    background: var(--ad-surface);
    border-color: var(--ad-primary);
    box-shadow: 0 0 0 3px rgba(31, 59, 179, .12);
}

/* ---------- Forms ---------- */
.ad-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 576px) {
    .ad-grid.cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ad-grid .span-all {
        grid-column: 1 / -1;
    }
}

@media (min-width: 768px) {
    .ad-grid.cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .ad-grid.cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.ad-field label {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--ad-text);
    margin-bottom: 6px;
}

.ad-field label span {
    font-weight: 500;
    color: var(--ad-muted);
}

.ad-field .form-control,
.ad-field .input-group-text {
    height: 44px;
    font-size: .9375rem;
    border-color: var(--ad-border);
}

.ad-field .form-control {
    border-radius: 10px;
}

.ad-field textarea.form-control {
    height: auto;
    min-height: 110px;
    resize: vertical;
    line-height: 1.5;
}

.ad-field .form-control[readonly] {
    background: var(--ad-surface-soft);
    color: var(--ad-muted);
}

.ad-field .input-group .form-control {
    border-radius: 0 10px 10px 0;
}

.ad-field .input-group .form-control:first-child {
    border-radius: 10px 0 0 10px;
}

.ad-field .input-group-text {
    background: var(--ad-surface-soft);
    color: var(--ad-muted);
    font-weight: 700;
    min-width: 44px;
    justify-content: center;
}

.ad-field .input-group-text:first-child {
    border-radius: 10px 0 0 10px;
}

.ad-field .input-group-text:last-child {
    border-radius: 0 10px 10px 0;
}

.ad-field .form-control:focus {
    border-color: var(--ad-primary);
    box-shadow: 0 0 0 3px rgba(31, 59, 179, .12);
}

.ad-hint {
    margin-top: 6px;
    font-size: .75rem;
    color: var(--ad-muted);
}

.ad-btn {
    height: 44px;
    padding: 0 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: .875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

@media (max-width: 575.98px) {
    .ad-card-foot .ad-btn,
    .ad-card-foot input.ad-btn {
        width: 100%;
    }
}

/* Rich text editor (CKEditor) */
.ad-field .ck-editor__editable {
    min-height: 260px;
    max-height: 60vh;
    border-radius: 0 0 10px 10px !important;
}

.ad-field .ck.ck-toolbar {
    border-radius: 10px 10px 0 0 !important;
    background: var(--ad-surface-soft);
}

.ad-rich {
    font-size: .875rem;
    line-height: 1.6;
    color: var(--ad-text);
    word-break: break-word;
}

.ad-rich h1,
.ad-rich h2,
.ad-rich h3,
.ad-rich h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 1em 0 .4em;
}

.ad-rich img {
    max-width: 100%;
    height: auto;
}

.ad-rich:empty::before {
    content: "Nothing published yet.";
    color: var(--ad-muted);
}

/* ---------- Tables → cards on phones ---------- */
.ad-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
}

.ad-table thead th {
    background: var(--ad-surface-soft);
    color: var(--ad-muted);
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 10px 16px;
    border-bottom: 1px solid var(--ad-border);
    white-space: nowrap;
}

.ad-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ad-border);
    vertical-align: middle;
    font-size: .875rem;
    color: var(--ad-text);
}

.ad-table tbody tr:last-child td {
    border-bottom: 0;
}

.ad-table tbody tr:hover td {
    background: #fafbfd;
}

.ad-table th.ad-actions-col,
.ad-table td.ad-actions {
    text-align: right;
}

.ad-table .ad-idx {
    width: 56px;
    color: var(--ad-muted);
    font-variant-numeric: tabular-nums;
}

.ad-person {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ad-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .875rem;
    color: var(--ad-primary);
    background: var(--ad-primary-soft);
    text-transform: uppercase;
}

.ad-person-name {
    font-weight: 600;
    line-height: 1.3;
    word-break: break-word;
}

.ad-person-sub {
    font-size: .8125rem;
    color: var(--ad-muted);
    word-break: break-all;
}

.ad-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    color: #5b6272;
    background: #eef0f4;
}

.ad-badge.is-success {
    color: var(--ad-success);
    background: var(--ad-success-soft);
}

.ad-badge.is-primary {
    color: var(--ad-primary);
    background: var(--ad-primary-soft);
}

.ad-act {
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--ad-border);
    background: var(--ad-surface);
    color: var(--ad-text);
    font-size: .75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    text-decoration: none;
    transition: border-color .12s ease, color .12s ease, background-color .12s ease;
}

.ad-act i {
    font-size: 1rem;
}

.ad-act:hover {
    border-color: var(--ad-primary);
    color: var(--ad-primary);
}

.ad-act.is-primary {
    background: var(--ad-primary-soft);
    border-color: transparent;
    color: var(--ad-primary);
}

.ad-act.is-primary:hover {
    border-color: var(--ad-primary);
}

/* Delete buttons keep .btn-danger as their script hook; neutralise the template's button colours. */
.ad-act.is-danger,
.ad-act.is-danger.btn-danger {
    background: var(--ad-surface);
    border-color: var(--ad-border);
    color: var(--ad-text);
}

.ad-act.is-danger:hover {
    border-color: var(--ad-danger);
    color: var(--ad-danger);
    background: var(--ad-danger-soft);
}

.ad-actions-wrap {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

@media (max-width: 767.98px) {
    .ad-table,
    .ad-table tbody {
        display: block;
    }

    .ad-table thead {
        display: none;
    }

    .ad-table tbody {
        padding: 10px;
        display: grid;
        gap: 10px;
    }

    .ad-table tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        border: 1px solid var(--ad-border);
        border-radius: var(--ad-radius);
        overflow: hidden;
    }

    .ad-table tbody tr:hover td {
        background: transparent;
    }

    .ad-table td {
        border: 0;
        padding: 8px 14px;
    }

    .ad-table td.ad-idx {
        display: none;
    }

    .ad-table td.ad-main {
        grid-column: 1 / -1;
        padding-top: 14px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--ad-border);
    }

    .ad-table td[data-label] {
        display: flex;
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
        min-width: 0;
        word-break: break-word;
    }

    .ad-table td[data-label]::before {
        content: attr(data-label);
        font-size: .6875rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--ad-muted);
    }

    .ad-table td.ad-actions {
        grid-column: 1 / -1;
        border-top: 1px solid var(--ad-border);
        padding: 10px 14px;
    }

    .ad-actions-wrap {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        width: 100%;
    }

    .ad-actions-wrap .ad-act {
        height: 38px;
    }

    .ad-table tr.ad-empty-row {
        display: block;
        border: 0;
    }
}

/* Loading skeleton & states */
.ad-skel {
    display: block;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #eef0f4 25%, #f6f7f9 50%, #eef0f4 75%);
    background-size: 200% 100%;
    animation: ad-shimmer 1.2s infinite linear;
}

@keyframes ad-shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

.ad-state {
    text-align: center;
    padding: 48px 16px !important;
    color: var(--ad-muted);
    font-size: .875rem;
}

.ad-state i {
    font-size: 2.25rem;
    color: #c3c8d4;
    display: block;
    margin-bottom: 6px;
}

.ad-state strong {
    display: block;
    color: var(--ad-text);
    font-size: .9375rem;
    margin-bottom: 2px;
}

.ad-when-empty {
    display: none;
}

.ad-list:has(tbody:empty) .ad-when-empty,
.ad-list:has(.ad-gallery:empty) .ad-when-empty,
.ad-list:has(.ad-reviews:empty) .ad-when-empty {
    display: block;
}

.ad-list:has(tbody:empty) .ad-table {
    display: none;
}

/* ---------- Pagination ---------- */
.ad-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 14px 16px;
    border-top: 1px solid var(--ad-border);
    list-style: none;
}

.ad-pagination:empty {
    display: none;
}

.ad-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--ad-border);
    background: var(--ad-surface);
    color: var(--ad-text);
    font-size: .8125rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.ad-page-btn:hover:not(:disabled):not(.active) {
    border-color: var(--ad-primary);
    color: var(--ad-primary);
}

.ad-page-btn.active {
    background: var(--ad-primary);
    border-color: var(--ad-primary);
    color: #fff;
}

.ad-page-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.ad-page-gap {
    min-width: 20px;
    text-align: center;
    color: var(--ad-muted);
}

.ad-page-meta {
    width: 100%;
    text-align: center;
    font-size: .8125rem;
    color: var(--ad-muted);
    margin-bottom: 2px;
}

/* ---------- Reviews ---------- */
.ad-reviews {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
}

@media (min-width: 1200px) {
    .ad-reviews {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ad-review {
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.ad-review-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.ad-stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    white-space: nowrap;
}

.ad-stars .mdi {
    font-size: 16px;
    color: #d5d9e2;
}

.ad-stars .mdi.is-on {
    color: var(--ad-star);
}

.ad-stars b {
    margin-left: 6px;
    font-size: .8125rem;
    color: var(--ad-text);
}

.ad-review-text {
    font-size: .9rem;
    line-height: 1.55;
    color: var(--ad-text);
    margin: 0;
    word-break: break-word;
}

.ad-review-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ad-review-photos a {
    display: block;
    width: 84px;
    height: 84px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--ad-border);
}

.ad-review-photos img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-review-foot {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--ad-border);
}

.ad-product-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    text-decoration: none;
    color: var(--ad-text);
    font-size: .8125rem;
    font-weight: 600;
}

.ad-product-chip img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--ad-border);
    flex-shrink: 0;
}

.ad-product-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ad-product-chip:hover {
    color: var(--ad-primary);
}

.ad-review-date {
    font-size: .75rem;
    color: var(--ad-muted);
}

/* ---------- Image upload tiles (homepage) ---------- */
.ad-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

@media (min-width: 992px) {
    .ad-tiles {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

.ad-tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.ad-tile-label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--ad-text);
}

.ad-tile-media {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--ad-radius);
    border: 1.5px dashed #c9cedb;
    background: var(--ad-surface-soft);
    overflow: hidden;
    transition: border-color .15s ease;
}

.ad-tile-media:hover {
    border-color: var(--ad-primary);
}

.ad-tile-media img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    max-width: none !important;
    height: 100%;
    margin: 0 !important;
    object-fit: cover;
}

.ad-tile-media input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.ad-tile-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px;
    text-align: center;
    color: var(--ad-muted);
    font-size: .75rem;
}

.ad-tile-empty i {
    font-size: 1.6rem;
    color: var(--ad-primary);
}

.ad-tile-change {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 1;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(31, 36, 48, .78);
    color: #fff;
    font-size: .6875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}

/* Hide the placeholder when an image is showing, and the "Change" badge when it isn't */
.ad-tile-media:has(img:not([style*="none"])[src]) .ad-tile-empty,
.ad-tile-media:has(img[style*="none"]) .ad-tile-change,
.ad-tile-media:has(img:not([src])) .ad-tile-change {
    display: none;
}

.ad-tile-media:has(img[style*="none"]) .ad-tile-empty,
.ad-tile-media:has(img:not([src])) .ad-tile-empty {
    display: flex;
}

/* ---------- Carousel gallery ---------- */
.ad-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    padding: 16px;
}

.ad-slide {
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    overflow: hidden;
    background: var(--ad-surface);
    display: flex;
    flex-direction: column;
}

.ad-slide-media {
    aspect-ratio: 16 / 9;
    background: var(--ad-surface-soft);
}

.ad-slide-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ad-slide-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    font-size: .8125rem;
    color: var(--ad-muted);
}

/* Upload drop zone (carousels) */
.ad-drop {
    position: relative;
    border: 1.5px dashed #c9cedb;
    border-radius: var(--ad-radius);
    background: var(--ad-surface-soft);
    transition: border-color .15s ease, background-color .15s ease;
}

.ad-drop:hover,
.ad-drop.is-drag {
    border-color: var(--ad-primary);
    background: var(--ad-primary-soft);
}

.ad-drop input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.ad-drop-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 28px 16px;
    color: var(--ad-muted);
    font-size: .8125rem;
}

.ad-drop-empty i {
    font-size: 1.9rem;
    color: var(--ad-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.ad-drop-empty strong {
    color: var(--ad-text);
    font-size: .875rem;
}

.ad-drop-preview {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.ad-drop.has-file {
    border-style: solid;
    background: var(--ad-surface);
}

.ad-drop.has-file .ad-drop-empty {
    display: none;
}

.ad-drop.has-file .ad-drop-preview {
    display: flex;
}

.ad-drop-preview img {
    width: 96px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--ad-border);
}

.ad-drop-name {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--ad-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ad-drop-size {
    font-size: .75rem;
    color: var(--ad-muted);
}

/* ---------- Policies list ---------- */
.ad-policy {
    border-bottom: 1px solid var(--ad-border);
}

.ad-policy:last-child {
    border-bottom: 0;
}

.ad-policy summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
}

.ad-policy summary::-webkit-details-marker {
    display: none;
}

.ad-policy summary:hover {
    background: #fafbfd;
}

.ad-policy-title {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: var(--ad-text);
    font-size: .9rem;
}

.ad-policy-chevron {
    color: var(--ad-muted);
    font-size: 1.25rem;
    transition: transform .2s ease;
}

.ad-policy[open] .ad-policy-chevron {
    transform: rotate(180deg);
}

.ad-policy-body {
    padding: 0 18px 16px;
    max-height: 360px;
    overflow: auto;
}

.ad-editing-banner {
    display: none;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff4e0;
    color: #9a4a05;
    font-size: .8125rem;
    font-weight: 600;
}

.is-editing .ad-editing-banner {
    display: flex;
}

/* ---------- Sticky save bar (long settings forms) ---------- */
.ad-savebar {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px 12px 18px;
    background: #1f2430;
    color: #d8dbe4;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(16, 24, 40, .22);
    font-size: .8125rem;
}

.ad-savebar .btn {
    background: #fff !important;
    color: #1f2430 !important;
    border: 0;
}

@media (max-width: 575.98px) {
    .ad-savebar span {
        display: none;
    }

    .ad-savebar .btn {
        width: 100%;
    }
}

/* =====================================================================
 * Dashboard, orders and product detail
 * (index.php, orders.php, user_orders.php, show_product.php)
 * ===================================================================== */
:root {
    --ad-warning: #9a4a05;
    --ad-warning-soft: #fff4e0;
}

.ad-badge.is-warning {
    color: var(--ad-warning);
    background: var(--ad-warning-soft);
}

.ad-badge.is-danger {
    color: var(--ad-danger);
    background: var(--ad-danger-soft);
}

.ad-badge i {
    font-size: .9rem;
    line-height: 1;
}

/* The theme paints selects a pale grey and swaps the border for an outline. */
.ad-select {
    height: 42px;
    width: 100%;
    padding: 0 36px 0 12px;
    border: 1px solid var(--ad-border);
    border-radius: 10px;
    outline: 0;
    background: var(--ad-surface) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat right 12px center / 12px;
    color: var(--ad-text);
    font-size: .875rem;
    font-weight: 600;
    -webkit-appearance: none;
    appearance: none;
}

.ad-select:focus {
    border-color: var(--ad-primary);
    box-shadow: 0 0 0 3px rgba(31, 59, 179, .12);
}

.ad-select:disabled {
    opacity: .6;
    cursor: progress;
}

.ad-btn.is-ghost {
    background: var(--ad-surface);
    border: 1px solid var(--ad-border);
    color: var(--ad-text);
}

.ad-btn.is-ghost:hover {
    border-color: var(--ad-primary);
    color: var(--ad-primary);
}

.ad-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--ad-primary);
    text-decoration: none;
}

.ad-link:hover {
    text-decoration: underline;
}

.ad-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--ad-muted);
    text-decoration: none;
    margin-bottom: 8px;
}

.ad-back:hover {
    color: var(--ad-primary);
}

.ad-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 575.98px) {
    .ad-header-actions {
        width: 100%;
    }

    .ad-header-actions > * {
        flex: 1 1 0;
    }
}

/* Status filter row: .ad-tabs made of buttons */
button.ad-tab {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.ad-tab .ad-tab-count {
    font-size: .6875rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--ad-surface-soft);
    color: var(--ad-muted);
}

.ad-tab.is-active .ad-tab-count {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}

/* ---------- Dashboard: stat tiles ---------- */
.ad-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.ad-kpis > .ad-kpi:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .ad-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ad-kpis > .ad-kpi:last-child:nth-child(odd) {
        grid-column: auto;
    }
}

@media (min-width: 1200px) {
    .ad-kpis {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.ad-kpi {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 16px;
    background: var(--ad-surface);
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    color: var(--ad-text);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ad-kpi:hover {
    color: var(--ad-text);
    border-color: #c7cde0;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .06);
}

.ad-kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ad-kpi-label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--ad-muted);
}

.ad-kpi-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ad-primary-soft);
    color: var(--ad-primary);
    font-size: 1.1rem;
}

.ad-kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    min-height: 1.925rem;
}

.ad-kpi-value .ad-skel {
    width: 60%;
    height: 26px;
}

.ad-kpi-sub {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: .75rem;
    color: var(--ad-muted);
}

.ad-kpi-sub .mdi-arrow-right {
    color: var(--ad-primary);
    font-size: 1rem;
    transition: transform .15s ease;
}

.ad-kpi:hover .mdi-arrow-right {
    transform: translateX(2px);
}

@media (max-width: 575.98px) {
    .ad-kpi {
        padding: 14px;
        gap: 10px;
    }

    .ad-kpi-value {
        font-size: 1.5rem;
    }
}

/* ---------- Dashboard: layout & period filter ---------- */
.ad-dash {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 20px;
}

.ad-dash > .ad-card {
    margin-bottom: 0;
}

@media (min-width: 1200px) {
    .ad-dash {
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    }
}

.ad-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 4px 0 12px;
}

.ad-section-head h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--ad-text);
}

.ad-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    max-width: 100%;
}

.ad-chips::-webkit-scrollbar {
    display: none;
}

.ad-chip {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--ad-border);
    background: var(--ad-surface);
    color: #4f5669;
    font-size: .8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.ad-chip:hover {
    border-color: var(--ad-primary);
    color: var(--ad-primary);
}

.ad-chip.is-active {
    background: var(--ad-primary);
    border-color: var(--ad-primary);
    color: #fff;
}

@media (max-width: 575.98px) {
    .ad-section-head .ad-chips {
        width: 100%;
    }
}

.ad-range {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
    padding: 14px;
    margin-bottom: 12px;
    background: var(--ad-surface);
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
}

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

.ad-range .ad-field label {
    margin-bottom: 4px;
}

.ad-range .ad-btn {
    grid-column: 1 / -1;
}

.ad-range-error {
    grid-column: 1 / -1;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--ad-danger);
}

.ad-range-error:empty {
    display: none;
}

@media (min-width: 576px) {
    .ad-range {
        grid-template-columns: minmax(0, 200px) minmax(0, 200px) auto;
        justify-content: start;
    }

    .ad-range .ad-btn {
        grid-column: auto;
    }
}

/* Revenue hero */
.ad-hero {
    font-size: clamp(2.5rem, 4vw + 1rem, 3.25rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.02em;
    color: var(--ad-text);
    word-break: break-word;
}

.ad-hero .ad-skel {
    width: 180px;
    max-width: 70%;
    height: 44px;
    border-radius: 10px;
}

.ad-hero-sub {
    margin-top: 8px;
    font-size: .8125rem;
    color: var(--ad-muted);
}

.ad-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin-top: 20px;
    background: var(--ad-border);
    border: 1px solid var(--ad-border);
    border-radius: 10px;
    overflow: hidden;
}

.ad-fact {
    background: var(--ad-surface-soft);
    padding: 12px 14px;
    min-width: 0;
}

.ad-fact span {
    display: block;
    font-size: .75rem;
    color: var(--ad-muted);
    margin-bottom: 2px;
}

.ad-fact strong {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ad-text);
}

/* Orders-by-status bar list: one hue, the value always printed beside it */
.ad-bars {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ad-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 12px;
}

.ad-bar > .ad-badge {
    justify-self: start;
}

.ad-bar-value {
    font-size: .9375rem;
    font-weight: 700;
    color: var(--ad-text);
    font-variant-numeric: tabular-nums;
}

.ad-bar-value small {
    font-size: .75rem;
    font-weight: 600;
    color: var(--ad-muted);
    margin-left: 4px;
}

.ad-bar-track {
    grid-column: 1 / -1;
    height: 8px;
    border-radius: 4px;
    background: var(--ad-primary-soft);
    overflow: hidden;
}

.ad-bar-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 4px;
    background: var(--ad-primary);
    transition: width .45s ease;
}

/* Recent orders feed */
.ad-feed {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ad-feed li + li {
    border-top: 1px solid var(--ad-border);
}

.ad-feed-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: var(--ad-text);
    text-decoration: none;
}

a.ad-feed-row:hover {
    background: #fafbfd;
    color: var(--ad-text);
}

.ad-feed-main {
    min-width: 0;
}

.ad-feed-title {
    font-weight: 600;
    font-size: .875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ad-feed-sub {
    font-size: .75rem;
    color: var(--ad-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ad-feed-end {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.ad-feed-amount {
    font-weight: 700;
    font-size: .875rem;
}

@media (max-width: 575.98px) {
    .ad-feed-row {
        padding: 12px 14px;
        gap: 10px;
    }

    .ad-feed-sub {
        white-space: normal;
    }

    .ad-feed-row .ad-avatar {
        width: 34px;
        height: 34px;
        font-size: .75rem;
    }
}

/* Quick actions */
.ad-quick {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 16px;
}

.ad-quick a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--ad-border);
    border-radius: 10px;
    color: var(--ad-text);
    font-size: .8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease;
}

.ad-quick a:hover {
    border-color: var(--ad-primary);
    color: var(--ad-primary);
}

.ad-quick a i {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ad-primary-soft);
    color: var(--ad-primary);
    font-size: 1.05rem;
}

/* ---------- Orders ---------- */
.ad-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ad-border);
}

.ad-filters .ad-search {
    grid-column: 1 / -1;
}

.ad-filters .ad-field label {
    margin-bottom: 4px;
}

.ad-filters .ad-field .form-control {
    height: 42px;
}

.ad-filters .ad-btn {
    height: 42px;
}

.ad-filters .ad-range-error {
    grid-column: 1 / -1;
}

@media (min-width: 992px) {
    .ad-filters {
        grid-template-columns: minmax(0, 1fr) 170px 170px auto auto;
        align-items: end;
    }

    .ad-filters .ad-search {
        grid-column: auto;
    }
}

.ad-applied {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--ad-border);
    font-size: .75rem;
    color: var(--ad-muted);
}

.ad-applied:empty {
    display: none;
}

.ad-applied-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 3px 4px 3px 10px;
    border-radius: 999px;
    background: var(--ad-primary-soft);
    color: var(--ad-primary);
    font-weight: 600;
}

.ad-applied-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ad-applied-chip button {
    border: 0;
    background: transparent;
    color: inherit;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ad-applied-chip button:hover {
    background: rgba(31, 59, 179, .12);
}

.ad-orders {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.ad-order {
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    background: var(--ad-surface);
    min-width: 0;
    overflow: hidden;
}

.ad-order-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 14px 18px;
    background: var(--ad-surface-soft);
    border-bottom: 1px solid var(--ad-border);
}

.ad-order-no {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .9375rem;
    font-weight: 700;
    color: var(--ad-text);
    word-break: break-all;
}

.ad-order-date {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    font-size: .8125rem;
    color: var(--ad-muted);
}

.ad-order-total {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ad-order-total strong {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ad-text);
    white-space: nowrap;
}

.ad-copy {
    border: 0;
    background: transparent;
    color: #9aa1b2;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    cursor: pointer;
}

.ad-copy:hover {
    background: var(--ad-primary-soft);
    color: var(--ad-primary);
}

.ad-order-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px 18px;
}

@media (min-width: 768px) {
    .ad-order-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .ad-order-body {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.ad-order-block {
    min-width: 0;
}

.ad-label {
    display: block;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ad-muted);
    margin-bottom: 6px;
}

.ad-order-block p {
    margin: 0;
    font-size: .875rem;
    line-height: 1.5;
    color: var(--ad-text);
    word-break: break-word;
}

.ad-order-block .ad-muted {
    color: var(--ad-muted);
    font-size: .8125rem;
}

.ad-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: .875rem;
    color: var(--ad-text);
    word-break: break-word;
}

.ad-line + .ad-line {
    margin-top: 4px;
}

.ad-line a {
    color: var(--ad-text);
}

.ad-line a:hover {
    color: var(--ad-primary);
}

.ad-order-items {
    margin: 0 18px;
    border: 1px solid var(--ad-border);
    border-radius: 10px;
    overflow: hidden;
}

.ad-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 16px;
    padding: 10px 14px;
    font-size: .875rem;
}

.ad-item + .ad-item {
    border-top: 1px solid var(--ad-border);
}

.ad-item-name {
    font-weight: 600;
    color: var(--ad-text);
    word-break: break-word;
}

.ad-item-meta {
    grid-column: 1;
    font-size: .8125rem;
    color: var(--ad-muted);
}

.ad-item-total {
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: center;
    font-weight: 700;
    white-space: nowrap;
}

.ad-sum {
    background: var(--ad-surface-soft);
    border-top: 1px solid var(--ad-border);
    padding: 10px 14px;
    display: grid;
    gap: 4px;
    font-size: .8125rem;
}

.ad-sum div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--ad-muted);
}

.ad-sum div span:last-child {
    color: var(--ad-text);
    font-weight: 600;
    white-space: nowrap;
}

.ad-sum .is-total {
    padding-top: 6px;
    margin-top: 2px;
    border-top: 1px dashed var(--ad-border);
    color: var(--ad-text);
    font-weight: 700;
    font-size: .9375rem;
}

.ad-order-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 14px 18px;
    border-top: 1px solid var(--ad-border);
}

.ad-order-status {
    width: 220px;
    max-width: 100%;
}

.ad-order-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ad-order-actions .ad-act {
    height: 42px;
    padding: 0 14px;
    font-size: .8125rem;
}

.ad-act.is-whatsapp {
    background: #1faa59;
    border-color: #1faa59;
    color: #fff;
}

.ad-act.is-whatsapp:hover {
    background: #178a48;
    border-color: #178a48;
    color: #fff;
}

.ad-act:disabled,
.ad-act.is-disabled {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 767.98px) {
    .ad-orders {
        padding: 10px;
        gap: 10px;
    }

    .ad-order-head,
    .ad-order-body,
    .ad-order-foot {
        padding-left: 14px;
        padding-right: 14px;
    }

    .ad-order-items {
        margin: 0 14px;
    }

    .ad-order-status,
    .ad-order-actions {
        width: 100%;
    }

    .ad-order-actions .ad-act {
        flex: 1 1 0;
    }
}

@media (max-width: 399.98px) {
    .ad-order-total {
        width: 100%;
        justify-content: space-between;
    }
}

.ad-skel-card {
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    padding: 18px;
    display: grid;
    gap: 12px;
}

/* ---------- Toasts ---------- */
.ad-toasts {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: calc(100vw - 36px);
}

.ad-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 260px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #1f2430;
    color: #fff;
    font-size: .875rem;
    box-shadow: 0 12px 32px rgba(16, 24, 40, .22);
    animation: ad-toast-in .2s ease;
}

.ad-toast i {
    font-size: 1.1rem;
    line-height: 1.2;
}

.ad-toast.is-success i {
    color: #6ee7a8;
}

.ad-toast.is-error i {
    color: #ff9a8f;
}

@keyframes ad-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 575.98px) {
    .ad-toasts {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none;
    }

    .ad-toast {
        min-width: 0;
    }
}

/* ---------- Product detail ---------- */
.ad-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.ad-product {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 20px;
}

.ad-product > .ad-card {
    margin-bottom: 0;
}

@media (min-width: 992px) {
    .ad-product {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

@media (min-width: 1400px) {
    .ad-product {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    }
}

.ad-gallery-main {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--ad-surface-soft);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-gallery-main img,
.ad-gallery-main video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

.ad-gallery-main img {
    background: transparent;
}

.ad-gallery-empty {
    color: var(--ad-muted);
    text-align: center;
    font-size: .8125rem;
}

.ad-gallery-empty i {
    display: block;
    font-size: 2.5rem;
    color: #c3c8d4;
}

.ad-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.ad-thumb {
    position: relative;
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: var(--ad-surface-soft);
    cursor: pointer;
    outline-offset: 2px;
}

.ad-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-thumb.is-active {
    border-color: var(--ad-primary);
}

.ad-thumb.is-video {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ad-primary);
    font-size: 1.6rem;
    background: var(--ad-primary-soft);
}

.ad-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
}

.ad-price-from {
    font-size: .8125rem;
    color: var(--ad-muted);
    font-weight: 600;
}

.ad-price strong {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.01em;
    color: var(--ad-text);
}

.ad-price s {
    color: var(--ad-muted);
    font-size: 1rem;
}

.ad-specs {
    display: grid;
    grid-template-columns: 1fr;
    margin: 0;
}

@media (min-width: 576px) {
    .ad-specs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 24px;
    }
}

@media (min-width: 1200px) {
    .ad-specs.cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.ad-spec {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ad-border);
    min-width: 0;
}

.ad-spec dt {
    font-size: .8125rem;
    font-weight: 500;
    color: var(--ad-muted);
    white-space: nowrap;
}

.ad-spec dd {
    margin: 0;
    font-size: .875rem;
    font-weight: 600;
    color: var(--ad-text);
    text-align: right;
    word-break: break-word;
    min-width: 0;
}

.ad-spec dd.is-empty {
    color: #b3b9c6;
    font-weight: 500;
}

.ad-clamp {
    position: relative;
    max-height: 280px;
    overflow: hidden;
}

.ad-clamp::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 80px;
    background: linear-gradient(rgba(255, 255, 255, 0), var(--ad-surface));
    pointer-events: none;
}

.ad-clamp.is-open {
    max-height: none;
}

.ad-clamp.is-open::after,
.ad-clamp.is-short::after {
    display: none;
}

.ad-more {
    margin-top: 10px;
    border: 0;
    background: transparent;
    padding: 0;
}

.ad-variant {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ad-variant-img {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--ad-border);
    background: var(--ad-surface-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #b3b9c6;
}

.ad-num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .ad-bar-fill,
    .ad-toast,
    .ad-kpi,
    .ad-skel {
        transition: none;
        animation: none;
    }
}
