/* ================================================================
   OFERTAS FLOATING WIDGET
   ================================================================ */

/* Pull tab */
#oferta-tab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9998;
    background: linear-gradient(135deg, #e63946 0%, #f4a261 100%);
    color: #fff;
    padding: 14px 10px;
    border-radius: 12px 0 0 12px;
    cursor: pointer;
    box-shadow: -3px 4px 16px rgba(230,57,70,.45);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    user-select: none;
    transition: padding .2s, box-shadow .2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
#oferta-tab:hover {
    padding-right: 14px;
    box-shadow: -5px 6px 22px rgba(230,57,70,.55);
}
#oferta-tab .tab-icon { writing-mode: horizontal-tb; font-size: 16px; }
#oferta-tab .tab-count {
    writing-mode: horizontal-tb;
    background: rgba(255,255,255,.3);
    border-radius: 50%;
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 900;
}

/* Drawer */
#oferta-drawer {
    position: fixed;
    right: -360px;
    top: 0; bottom: 0;
    width: 340px;
    background: #1a1f2e;
    z-index: 9999;
    box-shadow: -6px 0 30px rgba(0,0,0,.4);
    transition: right .3s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#oferta-drawer.open { right: 0; }

/* Drawer header */
.odr-header {
    padding: 18px 18px 14px;
    background: linear-gradient(135deg, #e63946 0%, #f4a261 100%);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.odr-header h3 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    flex: 1;
    letter-spacing: .3px;
}
.odr-close {
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.odr-close:hover { background: rgba(255,255,255,.4); }

/* Offer cards scroll area */
.odr-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}
.odr-body::-webkit-scrollbar { width: 4px; }
.odr-body::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

/* Individual offer card */
.odr-card {
    background: #242938;
    border-radius: 14px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.odr-card-header {
    padding: 10px 14px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.odr-card-name {
    flex: 1;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.odr-card-desc {
    color: #aaa;
    font-size: 11px;
    padding: 0 14px 8px;
}

/* Countdown */
.odr-countdown {
    display: flex;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(0,0,0,.2);
}
.odr-cd-unit {
    flex: 1;
    text-align: center;
    background: rgba(255,255,255,.06);
    border-radius: 8px;
    padding: 6px 4px;
}
.odr-cd-num {
    display: block;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.odr-cd-lbl {
    display: block;
    color: #888;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-top: 2px;
}

/* Stock bar (until_stock_out) */
.odr-stock-bar {
    padding: 8px 14px;
    background: rgba(0,0,0,.15);
}
.odr-stock-lbl {
    color: #aaa;
    font-size: 11px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}
.odr-stock-lbl strong { color: #fff; }
.odr-progress {
    height: 6px;
    background: rgba(255,255,255,.1);
    border-radius: 3px;
    overflow: hidden;
}
.odr-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #e63946, #f4a261);
    border-radius: 3px;
    transition: width .6s ease;
}

/* Product mini-slider */
.odr-products { padding: 10px 14px 14px; }
.odr-prod-slider { position: relative; }
.odr-prod-slide { display: none; }
.odr-prod-slide.active { display: flex; gap: 12px; align-items: flex-start; }

.odr-prod-img {
    flex-shrink: 0;
    width: 72px; height: 90px; /* 4:5 */
    border-radius: 8px;
    object-fit: cover;
    background: #333;
}
.odr-prod-info { flex: 1; min-width: 0; }
.odr-prod-name {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.odr-prod-ref { color: #888; font-size: 11px; margin-bottom: 6px; }
.odr-prod-orig {
    color: #666;
    font-size: 12px;
    text-decoration: line-through;
}
.odr-prod-new {
    color: #4ade80;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.1;
}
.odr-disc-badge {
    display: inline-block;
    background: linear-gradient(135deg, #e63946, #f4a261);
    color: #fff;
    font-weight: 800;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: 4px;
}
.odr-stock-info { color: #888; font-size: 11px; margin-top: 4px; }

/* Slider nav dots */
.odr-slider-nav {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    align-items: center;
}
.odr-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #444;
    cursor: pointer;
    border: none;
    padding: 0;
    transition: background .2s, transform .2s;
}
.odr-dot.active {
    background: linear-gradient(135deg, #e63946, #f4a261);
    transform: scale(1.3);
}
.odr-nav-btn {
    background: rgba(255,255,255,.08);
    border: none;
    color: #aaa;
    width: 24px; height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.odr-nav-btn:hover { background: rgba(255,255,255,.18); color: #fff; }

/* Overlay backdrop */
#oferta-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 9997;
}
#oferta-overlay.show { display: block; }

/* Dashboard widget */
.dash-offers-section {
    background: linear-gradient(135deg, #1a1f2e 0%, #2d1f3d 100%);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
    color: #fff;
}
.dash-offers-title {
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.dash-offers-title .fire { font-size: 16px; }
.dash-offer-row-label {
    color: #ccc;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.dash-offer-cards-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
/* Compact card ~100px wide */
.dash-offer-card {
    width: 100px;
    flex-shrink: 0;
    background: rgba(255,255,255,.07);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,.08);
    transition: transform .2s, box-shadow .2s;
}
.dash-offer-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.dash-offer-card-img {
    width: 100%;
    height: 80px;
    position: relative;
    overflow: hidden;
    background: #242938;
}
.dash-offer-card-img img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
.dash-offer-card-img .disc-badge-abs {
    position: absolute;
    top: 4px; left: 4px;
    background: linear-gradient(135deg, #e63946, #f4a261);
    color: #fff;
    font-weight: 900;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 10px;
}
.dash-offer-card-body { padding: 6px 7px 7px; }
.dash-offer-card-name { font-weight: 600; font-size: 10px; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-offer-price-orig { color: #555; font-size: 9px; text-decoration: line-through; }
.dash-offer-price-new  { color: #4ade80; font-size: 12px; font-weight: 900; line-height: 1.2; }
.dash-stock-lbl { color: #f4a261; font-size: 9px; margin-top: 3px; }
.dash-offer-countdown { display: flex; gap: 2px; margin-top: 4px; }
.dash-cd-unit { flex: 1; text-align: center; background: rgba(0,0,0,.3); border-radius: 4px; padding: 2px 1px; }
.dash-cd-num  { display: block; font-size: 10px; font-weight: 900; color: #fff; line-height: 1; }
.dash-cd-lbl  { display: block; font-size: 7px; color: #666; text-transform: uppercase; }
.dash-offers-nav { display: flex; align-items: center; gap: 8px; }
.dash-offers-nav-btn { background: rgba(255,255,255,.1); border: none; color: #ccc; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 11px; transition: background .2s; }
.dash-offers-nav-btn:hover { background: rgba(255,255,255,.2); color: #fff; }
.dash-offers-counter { color: #888; font-size: 11px; }

/* Drawer card header – clickable hint */
.odr-card-header {
    cursor: pointer;
    transition: background .15s;
}
.odr-card-header:hover { background: rgba(255,255,255,.06); }

/* ================================================================
   OFFER DETAIL MODAL
   ================================================================ */
#oferta-detail-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 10500;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#oferta-detail-modal.open { display: flex; }

.ofm-box {
    background: #1a1f2e;
    border-radius: 18px;
    width: 100%;
    max-width: 680px;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}
.ofm-box::-webkit-scrollbar { width: 4px; }
.ofm-box::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.ofm-close {
    position: sticky;
    top: 12px;
    float: right;
    margin: 12px 12px 0 0;
    z-index: 2;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.ofm-close:hover { background: rgba(255,255,255,.3); }

.ofm-header {
    padding: 22px 56px 16px 22px;
    background: linear-gradient(135deg, #e63946 0%, #f4a261 100%);
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 18px 18px 0 0;
}
.ofm-header-title {
    flex: 1;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .2px;
}
.ofm-disc-badge {
    background: rgba(255,255,255,.25);
    color: #fff;
    font-weight: 900;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 20px;
    flex-shrink: 0;
}

.ofm-desc {
    padding: 12px 22px;
    color: #aaa;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

/* Modal countdown */
.ofm-cd-wrap {
    display: flex;
    gap: 8px;
    padding: 14px 22px;
    background: rgba(0,0,0,.2);
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.ofm-cd-unit {
    flex: 1;
    text-align: center;
    background: rgba(255,255,255,.07);
    border-radius: 10px;
    padding: 10px 6px;
}
.ofm-cd-num {
    display: block;
    color: #fff;
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.ofm-cd-lbl {
    display: block;
    color: #888;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-top: 4px;
}

/* Modal stock bar */
.ofm-stock-bar {
    padding: 14px 22px;
    background: rgba(0,0,0,.15);
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.ofm-stock-lbl {
    color: #aaa;
    font-size: 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}
.ofm-stock-lbl strong { color: #fff; }
.ofm-progress {
    height: 8px;
    background: rgba(255,255,255,.1);
    border-radius: 4px;
    overflow: hidden;
}
.ofm-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #e63946, #f4a261);
    border-radius: 4px;
}

/* Modal products grid */
.ofm-prod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 16px 22px 22px;
}
.ofm-prod-card {
    background: rgba(255,255,255,.06);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.08);
}
.ofm-prod-img-wrap {
    width: 100%;
    padding-top: 125%;
    position: relative;
    overflow: hidden;
    background: #242938;
}
.ofm-prod-img-wrap img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
.ofm-prod-badge {
    position: absolute;
    top: 8px; left: 8px;
    background: linear-gradient(135deg, #e63946, #f4a261);
    color: #fff;
    font-weight: 900;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 20px;
}
.ofm-prod-body { padding: 10px 12px 12px; }
.ofm-prod-name {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ofm-prod-ref { color: #777; font-size: 10px; margin-bottom: 6px; }
.ofm-prod-orig { color: #555; font-size: 11px; text-decoration: line-through; }
.ofm-prod-new { color: #4ade80; font-size: 17px; font-weight: 900; line-height: 1.2; }
.ofm-prod-stock { color: #777; font-size: 10px; margin-top: 4px; }

@media (max-width: 767px) {
    #oferta-drawer { width: 100%; right: -100%; }
    #oferta-tab { top: auto; bottom: 20px; transform: none; writing-mode: horizontal-tb; border-radius: 30px 0 0 30px; padding: 10px 14px; flex-direction: row; }
    .ofm-prod-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .ofm-cd-num { font-size: 20px; }
}
