/* =========================================================
   HISTÓRICO — SUB-TABS
========================================================= */

.history-subtabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding-bottom: 0;
}

.subtab-btn {
    background: none;
    border: none;
    color: #8899b0;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px 12px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
    white-space: nowrap;
}

.subtab-btn:hover {
    color: #fff;
}

.subtab-btn.active {
    color: #00d9ff;
    border-bottom-color: #00d9ff;
}

.subtab-content {
    display: none;
}

.subtab-content.active {
    display: block;
}

/* PDV card */
.pdv-card {
    border-color: rgba(255,184,0,0.18) !important;
}

.pdv-badge {
    font-size: 12px;
    font-weight: 700;
    color: #ffb800;
    background: rgba(255,184,0,0.10);
    border: 1px solid rgba(255,184,0,0.22);
    border-radius: 20px;
    padding: 4px 12px;
    white-space: nowrap;
}

.pdv-info-banner {
    background: rgba(255,184,0,0.07);
    border: 1px solid rgba(255,184,0,0.18);
    border-radius: 14px;
    padding: 12px 18px;
    color: #ffda6a;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 20px;
}

.pdv-troco {
    font-size: 13px;
    color: #00d084;
}

.pdv-atendente {
    font-size: 12px;
    color: #8899b0;
    padding: 8px 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.order-item-no-img {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

/* =========================================================
   FAVORITOS TAB
========================================================= */

.favorites-tab {
    padding: 4px 0;
}

.favorites-header {
    margin-bottom: 20px;
}

.favorites-header h2 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
}

.favorites-loading {
    color: #8899b0;
    padding: 40px;
    text-align: center;
    font-size: 14px;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.fav-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    transition: transform .2s, border-color .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}

.fav-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0,217,255,0.25);
    box-shadow: 0 8px 30px rgba(0,217,255,0.08);
}

.fav-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    background: rgba(10,14,26,0.85);
    border: 1px solid rgba(255,68,68,0.3);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s, transform .2s;
    padding: 0;
}

.fav-remove-btn:hover {
    background: rgba(255,68,68,0.15);
    transform: scale(1.1);
}

.fav-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.fav-card-img {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: rgba(255,255,255,0.03);
}

.fav-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.fav-card:hover .fav-card-img img {
    transform: scale(1.05);
}

.fav-card-info {
    padding: 14px 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.fav-card-info h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #e8edf5;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fav-price {
    font-size: 15px;
    font-weight: 800;
    color: #00d9ff;
}

.fav-date {
    font-size: 11px;
    color: #5a6a80;
}

.fav-ver-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    color: #00d9ff;
    padding: 10px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    transition: background .2s, color .2s;
}

.fav-ver-btn:hover {
    background: rgba(0,217,255,0.08);
    color: #fff;
}

/* =========================================================
   BOTÃO FAVORITAR (nos cards de produto)
========================================================= */

.btn-favoritar {
    position: absolute;
    top: 10px;
    right: 10px;   /* lado direito — oposto ao badge de desconto */
    left: auto;
    z-index: 3;
    background: rgba(10,14,26,0.82);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s, transform .2s, border-color .2s;
    padding: 0;
    backdrop-filter: blur(8px);
}

.btn-favoritar:hover {
    transform: scale(1.12);
    background: rgba(255,68,68,0.15);
    border-color: rgba(255,68,68,0.4);
}

.btn-favoritar.ativo {
    background: rgba(255,68,68,0.14);
    border-color: rgba(255,68,68,0.45);
}

.btn-favoritar svg {
    transition: transform .2s;
}

.btn-favoritar.ativo svg {
    filter: drop-shadow(0 0 4px rgba(255,68,68,0.6));
}

/* =========================================================
   BOTÃO FAVORITAR na página do produto (ao lado da qtd)
========================================================= */

.qty-fav-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-fav-row .quantity-wrapper {
    flex: 0 0 auto;
}

/* Resetar position absolute dos cards quando dentro da página do produto */
.qty-fav-row .btn-favoritar {
    position: static;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    flex-shrink: 0;
}

/* Grupo de botões ação (favoritar + compartilhar) */
.action-btns-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-favoritar-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 11px 18px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #b0bccf;
    transition: background .2s, border-color .2s, color .2s, transform .15s;
    white-space: nowrap;
    height: 46px;
    box-sizing: border-box;
}

/* =========================================================
   BOTÃO COMPARTILHAR (mesmo estilo do favoritar)
========================================================= */

.share-wrapper {
    position: relative;
}

.btn-compartilhar {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, border-color .2s, transform .15s;
    padding: 0;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
}

.btn-compartilhar:hover {
    background: rgba(0,217,255,0.10);
    border-color: rgba(0,217,255,0.35);
    transform: scale(1.06);
}

.btn-compartilhar:hover svg {
    stroke: #00d9ff;
}

/* Dropdown sobe a partir do botão */
.share-dropdown {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13,21,37,0.97);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    padding: 6px;
    z-index: 50;
    min-width: 170px;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.share-dropdown.open {
    display: block;
    animation: popupIn .18s ease;
}

/* Setinha do dropdown apontando pro botão */
.share-dropdown::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: rgba(13,21,37,0.97);
    border-right: 1px solid rgba(255,255,255,0.10);
    border-bottom: 1px solid rgba(255,255,255,0.10);
}

.share-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #b0bccf;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
    border: none;
    background: none;
    width: 100%;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
}

.share-option:hover {
    background: rgba(255,255,255,0.06);
    color: white;
}

.share-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(10,14,26,0.96);
    border: 1px solid rgba(0,217,255,0.35);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: 30px;
    z-index: 9999;
    opacity: 0;
    transition: opacity .25s, transform .25s;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 6px 30px rgba(0,0,0,0.5);
}

.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.btn-favoritar-inline:hover {
    background: rgba(255,68,68,0.10);
    border-color: rgba(255,68,68,0.35);
    color: #ff7070;
    transform: translateY(-1px);
}

.btn-favoritar-inline.ativo {
    background: rgba(255,68,68,0.12);
    border-color: rgba(255,68,68,0.40);
    color: #ff5555;
}

.btn-favoritar-inline.ativo:hover {
    background: rgba(255,68,68,0.06);
    border-color: rgba(255,68,68,0.20);
    color: #8899b0;
}

.btn-favoritar-inline .fav-heart {
    transition: transform .2s;
    flex-shrink: 0;
}

.btn-favoritar-inline:hover .fav-heart,
.btn-favoritar-inline.ativo .fav-heart {
    transform: scale(1.15);
}

@media (max-width: 480px) {
    .qty-fav-row {
        gap: 8px;
    }
    .btn-favoritar-inline span {
        display: none;
    }
    .btn-favoritar-inline {
        padding: 11px 14px;
    }
}
.fav-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(10,14,26,0.96);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: 30px;
    z-index: 9999;
    opacity: 0;
    transition: opacity .25s, transform .25s;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 6px 30px rgba(0,0,0,0.5);
}

.fav-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.fav-toast.added {
    border-color: rgba(255,68,68,0.4);
}

.fav-toast.removed {
    border-color: rgba(100,120,160,0.4);
    color: #8899b0;
}

/* =========================================================
   RESPONSIVO
========================================================= */

@media (max-width: 600px) {
    .favorites-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .history-subtabs {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .history-subtabs::-webkit-scrollbar { display: none; }
}

/* =========================================================
   AVALIAÇÃO — botão, badge e modal
========================================================= */

.btn-avaliar-item {
    background: rgba(255,184,0,0.10);
    border: 1px solid rgba(255,184,0,0.30);
    color: #ffda6a;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, transform .15s;
    flex-shrink: 0;
}

.btn-avaliar-item:hover {
    background: rgba(255,184,0,0.18);
    transform: translateY(-1px);
}

.badge-avaliado {
    font-size: 11px;
    font-weight: 700;
    color: #00d084;
    background: rgba(0,208,132,0.10);
    border: 1px solid rgba(0,208,132,0.25);
    border-radius: 8px;
    padding: 5px 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.order-item-row {
    flex-wrap: nowrap;
}

.order-item-price {
    flex-shrink: 0;
}

/* ── Modal de avaliação ──────────────── */

.review-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.78);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.review-modal {
    background: #0d1525;
    border: 1px solid rgba(255,184,0,.25);
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 440px;
    width: 92%;
    position: relative;
    animation: popupIn .22s ease;
}

.review-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.review-modal-img {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    background: rgba(255,255,255,0.05);
}

.review-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #e8edf5;
    line-height: 1.3;
}

.review-modal-stars {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    justify-content: center;
}

.review-modal-stars span {
    font-size: 32px;
    cursor: pointer;
    color: rgba(255,255,255,0.15);
    transition: color .15s, transform .15s;
}

.review-modal-stars span:hover {
    transform: scale(1.15);
}

.review-modal-stars span.active {
    color: #ffb800;
    text-shadow: 0 0 8px rgba(255,184,0,0.4);
}

.review-modal-input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    padding: 11px 14px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    margin-bottom: 10px;
    box-sizing: border-box;
    outline: none;
    transition: border-color .2s;
}

.review-modal-input:focus {
    border-color: rgba(255,184,0,0.4);
}

.review-modal-textarea {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    padding: 11px 14px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    margin-bottom: 12px;
    box-sizing: border-box;
    resize: vertical;
    min-height: 80px;
    outline: none;
    transition: border-color .2s;
}

.review-modal-textarea:focus {
    border-color: rgba(255,184,0,0.4);
}

.review-modal-msg {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    min-height: 18px;
}

.review-modal-msg.ok { color: #00d084; }
.review-modal-msg.err { color: #ff5555; }

.review-modal-submit {
    width: 100%;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    padding: 13px 20px;
    border-radius: 12px;
}

/* =========================================================
   POPUP FAVORITAR (visitante não logado)
   — mesmo padrão do popup do carrinho
========================================================= */

.login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.login-popup {
    background: #0d1525;
    border: 1px solid rgba(0,217,255,.3);
    border-radius: 20px;
    padding: 36px 32px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: popupIn .22s ease;
}

@keyframes popupIn {
    from { opacity:0; transform: scale(.94) translateY(10px); }
    to   { opacity:1; transform: scale(1)  translateY(0); }
}

.popup-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255,255,255,.4);
    font-size: 1.1rem;
    cursor: pointer;
}

.popup-close:hover { color: white; }

.popup-icon { font-size: 3rem; margin-bottom: 14px; }

.login-popup h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: #fff;
}

.login-popup p {
    font-size: .88rem;
    color: rgba(255,255,255,.6);
    margin-bottom: 22px;
    line-height: 1.5;
}

.btn-ghost {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.2);
    background: transparent;
    color: rgba(255,255,255,.7);
    font-family: 'Inter', sans-serif;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, color .2s;
    box-sizing: border-box;
}

.btn-ghost:hover {
    background: rgba(255,255,255,.1);
    color: white;
}

.popup-skip {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: rgba(255,255,255,.3);
    font-size: .8rem;
    cursor: pointer;
    margin-top: 14px;
    text-decoration: underline;
    font-family: 'Inter', sans-serif;
}

.popup-skip:hover { color: rgba(255,255,255,.6); }