/* =========================================================
   OFERTAS V1 — lectura real
   ========================================================= */

.offers-page {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 44px 0 96px;
}

.offers-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.offers-eyebrow {
    margin: 0 0 6px;
    color: #52627b;
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .08em;
}

.offers-header h1 {
    margin: 0;
    color: #101828;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
    letter-spacing: -.04em;
}

.offers-subtitle {
    margin: 8px 0 0;
    color: #667085;
    font-size: 1rem;
}

.offers-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.offers-business-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid #e4e7ec;
    border-radius: 999px;
    background: #fff;
    color: #475467;
    font-size: .86rem;
}

.offers-business-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #12b76a;
}

.offers-add-button {
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    background: #2f62e9;
    color: #fff;
    font: inherit;
    font-size: .88rem;
    font-weight: 900;
    box-shadow: 0 7px 18px rgba(47, 98, 233, .16);
}

.offers-add-button:disabled {
    opacity: .72;
    cursor: not-allowed;
}

.offers-filters {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    padding-bottom: 22px;
    border-bottom: 1px solid #e4e7ec;
}

.offers-filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 39px;
    padding: 0 12px;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    background: #fff;
    color: #475467;
    font: inherit;
    font-size: .82rem;
    font-weight: 800;
    cursor: pointer;
}

.offers-filter span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 23px;
    height: 23px;
    padding: 0 6px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #344054;
}

.offers-filter.is-active {
    border-color: #bfd1ff;
    background: #eef4ff;
    color: #2457d6;
}

.offers-filter-dot,
.offers-section-dot {
    display: inline-block;
    flex: 0 0 auto;
    border-radius: 50%;
}

.offers-filter-dot {
    width: 8px;
    height: 8px;
}

.offers-section-dot {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.offers-filter-dot.active,
.offers-section-dot.active {
    background: #12b76a;
}

.offers-filter-dot.archived,
.offers-section-dot.archived {
    background: #98a2b3;
}

.offers-section {
    margin-top: 22px;
    padding: 20px;
    border: 1px solid #e4e7ec;
    border-radius: 20px;
    background: #fff;
}

.offers-section--active {
    border-color: #ccebd9;
    background: linear-gradient(180deg, #f4fbf7 0%, #fff 42%);
}

.offers-section--archived {
    background: linear-gradient(180deg, #f8f9fb 0%, #fff 35%);
}

.offers-section-head {
    margin-bottom: 14px;
}

.offers-section-head h2 {
    display: flex;
    align-items: center;
    margin: 0;
    color: #101828;
    font-size: 1.05rem;
}

.offers-section-head p {
    margin: 5px 0 0 24px;
    color: #667085;
    font-size: .86rem;
}

.offers-list {
    display: grid;
    gap: 12px;
}

.offer-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #e4e7ec;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
}

.offer-image-wrap {
    position: relative;
    min-height: 180px;
    background: #f2f4f7;
    overflow: hidden;
}

.offer-image-wrap img,
.offer-image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
}

.offer-image-placeholder {
    display: grid;
    place-items: center;
    color: #98a2b3;
    font-size: 2rem;
}

.offer-status {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 0 10px;
    border-radius: 9px;
    font-size: .73rem;
    font-weight: 900;
    box-shadow: 0 2px 6px rgba(16, 24, 40, .08);
}

.offer-status--active {
    background: #12b76a;
    color: #fff;
}

.offer-status--unavailable,
.offer-status--sold_out,
.offer-status--expired {
    background: #f4b400;
    color: #332600;
}

.offer-status--archived {
    background: #667085;
    color: #fff;
}

.offer-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    grid-template-areas:
        "copy time"
        "actions actions";
    gap: 14px 18px;
    padding: 18px;
}

.offer-card-copy {
    grid-area: copy;
    min-width: 0;
}

.offer-card-copy h3 {
    margin: 0;
    color: #101828;
    font-size: 1.02rem;
}

.offer-card-copy > p {
    margin: 5px 0 12px;
    color: #667085;
    font-size: .86rem;
    line-height: 1.4;
}

.offer-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.offer-price-row strong {
    color: #101828;
    font-size: 1.35rem;
}

.offer-price-row del {
    color: #98a2b3;
    font-size: .86rem;
}

.offer-discount {
    padding: 4px 8px;
    border-radius: 999px;
    background: #fee4e2;
    color: #d92d20;
    font-size: .72rem;
    font-weight: 900;
}

.offer-meta {
    display: grid;
    gap: 5px;
    margin-top: 10px;
    color: #475467;
    font-size: .82rem;
}

.offer-time {
    grid-area: time;
    align-self: start;
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f2f4f7;
    color: #475467;
    font-size: .78rem;
}

.offer-time strong {
    color: #344054;
}

.offer-time--active {
    background: #ecfdf3;
    color: #067647;
}

.offer-time--active strong {
    color: #067647;
}

.offer-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.offer-action {
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    color: #344054;
    font: inherit;
    font-size: .78rem;
    font-weight: 800;
}

.offer-action--primary {
    border-color: #2f62e9;
    background: #2f62e9;
    color: #fff;
}

.offer-action--danger {
    border-color: #f04438;
    background: #f04438;
    color: #fff;
}

.offer-action--icon {
    width: 42px;
    padding: 0;
}

.offer-action:disabled {
    opacity: .72;
    cursor: not-allowed;
}

.offers-empty {
    padding: 28px 18px;
    border: 1px dashed #d0d5dd;
    border-radius: 14px;
    background: rgba(255,255,255,.7);
    color: #667085;
    text-align: center;
}

.offers-message {
    margin-top: 18px;
    padding: 13px 15px;
    border-radius: 12px;
}

.offers-message.is-error {
    border: 1px solid #fecdca;
    background: #fef3f2;
    color: #b42318;
}

.offers-v1-note {
    display: grid;
    gap: 4px;
    margin-top: 20px;
    padding: 16px 18px;
    border: 1px solid #d1e0ff;
    border-radius: 14px;
    background: #eff4ff;
    color: #344054;
    font-size: .84rem;
}

.offers-v1-note strong {
    color: #2457d6;
}

/* Tablet */
@media (max-width: 1050px) {
    .offer-card {
        grid-template-columns: 150px minmax(0, 1fr);
    }

    .offer-card-body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "copy"
            "time"
            "actions";
    }

    .offer-time {
        width: fit-content;
    }

    .offer-actions {
        justify-content: flex-start;
    }
}

/* Mobile */
@media (max-width: 720px) {
    .offers-page {
        width: calc(100% - 32px);
        padding: 30px 0 110px;
    }

    .offers-header {
        align-items: stretch;
        flex-direction: column;
        gap: 15px;
    }

    .offers-header-actions {
        width: 100%;
    }

    .offers-business-pill {
        display: none;
    }

    .offers-add-button {
        width: 100%;
        min-height: 50px;
    }

    .offers-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .offers-filter {
        justify-content: center;
    }

    .offers-section {
        padding: 14px 12px;
        border-radius: 17px;
    }

    .offers-section-head h2 {
        font-size: .98rem;
    }

    .offers-section-head p {
        margin-left: 24px;
        font-size: .8rem;
    }

    .offer-card {
        grid-template-columns: 110px minmax(0, 1fr);
        border-radius: 14px;
    }

    .offer-image-wrap,
    .offer-image-wrap img,
    .offer-image-placeholder {
        min-height: 128px;
    }

    .offer-card-body {
        gap: 10px;
        padding: 12px;
    }

    .offer-card-copy h3 {
        font-size: .92rem;
    }

    .offer-card-copy > p {
        margin-bottom: 8px;
        font-size: .76rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .offer-price-row {
        gap: 7px;
    }

    .offer-price-row strong {
        font-size: 1.05rem;
    }

    .offer-meta {
        font-size: .73rem;
    }

    .offer-time {
        width: auto;
        padding: 9px 10px;
        font-size: .72rem;
    }

    .offer-actions {
        grid-column: 1 / -1;
        margin-left: -122px;
        padding-top: 4px;
        justify-content: stretch;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .offer-action {
        min-height: 36px;
        padding: 0 8px;
        font-size: .72rem;
    }

    .offer-action--icon {
        width: auto;
    }
}

@media (max-width: 430px) {
    .offer-card {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .offer-image-wrap,
    .offer-image-wrap img,
    .offer-image-placeholder {
        min-height: 112px;
    }

    .offer-actions {
        margin-left: -104px;
    }
}

/* =========================================================
   OFERTAS V1.1 — FIX MÓVIL
   Evita imagen estirada y solapamiento de controles.
   ========================================================= */

@media (max-width: 720px) {
    .offer-card {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        grid-template-rows: auto auto;
        overflow: hidden;
    }

    .offer-image-wrap {
        grid-column: 1;
        grid-row: 1;
        min-height: 0;
        height: 150px;
        align-self: start;
    }

    .offer-image-wrap img,
    .offer-image-placeholder {
        width: 100%;
        height: 150px;
        min-height: 0;
        object-fit: cover;
        display: block;
    }

    .offer-card-body {
        grid-column: 2;
        grid-row: 1;
        display: block;
        min-width: 0;
        padding: 12px;
    }

    .offer-card-copy {
        min-width: 0;
    }

    .offer-time {
        width: auto;
        margin-top: 10px;
    }

    .offer-actions {
        grid-column: 1 / -1;
        grid-row: 2;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 0;
        padding: 10px 12px 12px;
        border-top: 1px solid #eaecf0;
        background: #fff;
    }

    .offer-action {
        width: 100%;
        min-height: 38px;
        padding: 0 8px;
        font-size: .73rem;
    }

    .offer-action--icon {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .offer-card {
        grid-template-columns: 94px minmax(0, 1fr);
    }

    .offer-image-wrap,
    .offer-image-wrap img,
    .offer-image-placeholder {
        height: 138px;
    }

    .offer-card-body {
        padding: 10px;
    }

    .offer-actions {
        padding: 9px 10px 10px;
    }
}

/* =========================================================
   OFERTAS V1.2 — estructura de tarjeta corregida
   Acciones como fila independiente de image/body.
   ========================================================= */

.offer-card {
    grid-template-columns: 180px minmax(0, 1fr);
    grid-template-areas:
        "image body"
        "actions actions";
}

.offer-image-wrap {
    grid-area: image;
}

.offer-card-body {
    grid-area: body;
}

.offer-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 18px 16px;
    background: #fff;
}

@media (max-width: 1050px) {
    .offer-card {
        grid-template-columns: 150px minmax(0, 1fr);
    }
}

@media (max-width: 720px) {
    .offer-card {
        grid-template-columns: 104px minmax(0, 1fr);
        grid-template-areas:
            "image body"
            "actions actions";
        grid-template-rows: auto auto;
    }

    .offer-image-wrap {
        height: 150px;
        min-height: 0;
    }

    .offer-image-wrap img,
    .offer-image-placeholder {
        height: 150px;
        min-height: 0;
    }

    .offer-card-body {
        display: block;
        min-width: 0;
        padding: 12px;
    }

    .offer-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 0;
        padding: 10px 12px 12px;
        border-top: 1px solid #eaecf0;
        background: #fff;
    }

    .offer-action {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .offer-card {
        grid-template-columns: 94px minmax(0, 1fr);
    }

    .offer-image-wrap,
    .offer-image-wrap img,
    .offer-image-placeholder {
        height: 138px;
    }

    .offer-card-body {
        padding: 10px;
    }

    .offer-actions {
        padding: 9px 10px 10px;
    }
}

/* =========================================================
   OFERTAS V1.3 — FIX FINAL FILA DE ACCIONES EN MÓVIL
   Neutraliza desplazamientos heredados y evita recortes.
   ========================================================= */

@media (max-width: 720px) {
    .offer-actions {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        transform: none !important;
        box-sizing: border-box;
        overflow: visible;
        padding: 10px 12px 12px !important;
    }

    .offer-action {
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
        overflow: visible;
        white-space: nowrap;
    }
}

@media (max-width: 430px) {
    .offer-actions {
        margin-left: 0 !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* =========================================================
   OFERTAS V1.6 — UI simplificada
   Solo Activas y Archivadas.
   ========================================================= */

@media (max-width: 720px) {
    .offers-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 430px) {
    .offers-filters {
        grid-template-columns: 1fr 1fr;
    }

    .offers-filter[data-offer-filter="all"] {
        grid-column: 1 / -1;
    }
}

/* =========================================================
   OFERTAS V1.7 — EDITAR OFERTA
   ========================================================= */

.offer-modal[hidden] {
    display: none !important;
}

.offer-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
}

.offer-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 24, 40, .55);
    backdrop-filter: blur(3px);
}

.offer-modal-panel {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: min(820px, calc(100vh - 48px));
    overflow: auto;
    border: 1px solid #e4e7ec;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(16, 24, 40, .22);
}

.offer-modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid #eaecf0;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(10px);
}

.offer-modal-header h2 {
    margin: 0;
    color: #101828;
    font-size: 1.35rem;
}

.offer-modal-close {
    width: 38px;
    height: 38px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    color: #475467;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.offer-edit-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 20px 22px 24px;
}

.offer-field {
    display: grid;
    gap: 7px;
}

.offer-field--full {
    grid-column: 1 / -1;
}

.offer-field > span {
    color: #344054;
    font-size: .82rem;
    font-weight: 800;
}

.offer-field input,
.offer-field textarea {
    width: 100%;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    color: #101828;
    padding: 10px 12px;
    font: inherit;
}

.offer-field textarea {
    resize: vertical;
}

.offer-field input:focus,
.offer-field textarea:focus {
    outline: 3px solid rgba(47, 98, 233, .12);
    border-color: #84adff;
}

.offer-edit-message {
    grid-column: 1 / -1;
    margin: 0;
    padding: 11px 12px;
    border-radius: 10px;
    background: #f2f4f7;
    color: #475467;
    font-size: .82rem;
}

.offer-edit-message.is-error {
    background: #fef3f2;
    color: #b42318;
}

.offer-modal-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding-top: 4px;
}

.offer-modal-actions .offer-action {
    min-width: 130px;
}

body.offer-modal-open {
    overflow: hidden;
}

@media (max-width: 720px) {
    .offer-modal {
        align-items: end;
        padding: 0;
    }

    .offer-modal-panel {
        width: 100%;
        max-height: calc(100vh - 24px);
        border-radius: 20px 20px 0 0;
    }

    .offer-edit-form {
        grid-template-columns: 1fr;
        padding: 18px 18px calc(22px + env(safe-area-inset-bottom));
    }

    .offer-field--full,
    .offer-edit-message,
    .offer-modal-actions {
        grid-column: auto;
    }

    .offer-modal-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .offer-modal-actions .offer-action {
        min-width: 0;
    }
}

/* OFERTAS V1.8 — imagen editable */

.offer-image-editor-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 14px;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    background: #f9fafb;
}

.offer-image-editor-preview {
    width: 150px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    background: #fff;
    color: #98a2b3;
    font-size: .8rem;
}

.offer-image-editor-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.offer-image-editor-controls {
    display: grid;
    gap: 8px;
}

.offer-image-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #bfd1ff;
    border-radius: 10px;
    background: #eef4ff;
    color: #2457d6;
    font-weight: 850;
    cursor: pointer;
}

.offer-image-upload input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.offer-image-editor-controls small {
    color: #667085;
    line-height: 1.35;
}

@media (max-width: 720px) {
    .offer-image-editor-row {
        grid-template-columns: 110px minmax(0, 1fr);
        gap: 12px;
    }

    .offer-image-editor-preview {
        width: 110px;
    }

    .offer-image-upload {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .offer-image-editor-row {
        grid-template-columns: 1fr;
    }

    .offer-image-editor-preview {
        width: 100%;
        max-width: 220px;
        justify-self: center;
    }
}

/* OFERTAS V1.9 — finalizar / reactivar */

.offer-modal-panel--small {
    width: min(520px, 100%);
}

.offer-lifecycle-view {
    display: grid;
    gap: 18px;
    padding: 22px;
}

.offer-lifecycle-view[hidden] {
    display: none !important;
}

.offer-lifecycle-view > p {
    margin: 0;
    color: #475467;
    line-height: 1.55;
}

.offer-lifecycle-view .offer-modal-actions {
    padding-top: 0;
}

@media (max-width: 720px) {
    .offer-modal-panel--small {
        width: 100%;
    }

    .offer-lifecycle-view {
        padding: 18px 18px calc(22px + env(safe-area-inset-bottom));
    }
}

/* OFERTAS V1.10 — borrar oferta */

#offerDeleteModal .offer-lifecycle-view {
    gap: 16px;
}

#offerDeleteModal .offer-action--danger {
    min-width: 170px;
}

@media (max-width: 720px) {
    #offerDeleteModal .offer-action--danger {
        min-width: 0;
    }
}

/* OFERTAS V1.11 — añadir oferta */

#offerCreateModal .offer-image-editor {
    margin-bottom: 2px;
}

#offerCreateModal .offer-modal-actions {
    margin-top: 2px;
}

/* =========================================================
   SIDEBAR MICROFERTAS — identidad visual estable
   Bloque local a esta pantalla. No modifica el CSS global.
   ========================================================= */

.sidebar {
    color: #fff;
    border-right-color: transparent;
    background: #111a2e;
}

.sidebar .brand {
    color: #fff;
}

.sidebar .brand-mark {
    color: #111a2e;
    background: #fff;
}

.sidebar .nav-item {
    color: #b9c1d1;
    text-decoration: none;
}

.sidebar .nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, .06);
}

.sidebar .nav-item.active {
    color: #fff;
    background: rgba(255, 255, 255, .11);
}

.sidebar .small-label,
.sidebar .sidebar-user,
.sidebar .logout-button {
    color: #aeb8ca;
}

.sidebar .business-select {
    color: #fff;
    border-color: rgba(255, 255, 255, .14);
    background: #18243d;
}

