/* ===================================================
   loja.css — Estilos exclusivos da página de vitrine
   Lovintence | não altera styles.css existente
   =================================================== */

/* Layout da loja */
.loja-container {
    display: block;
    margin-top: 24px;
    margin-bottom: 40px;
}

@media (min-width: 768px) {
    .loja-container {
        display: grid;
        grid-template-columns: 250px 1fr;
        gap: 32px;
        margin-top: 32px;
    }
}

/* Sidebar da loja — herda .sidebar do styles.css */
.loja-sidebar {
    height: fit-content;
    position: sticky;
    top: 16px;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

.breadcrumb-item:hover {
    color: var(--site-primary, #008000);
}

.breadcrumb-item.active {
    color: #333;
    font-weight: 600;
    cursor: default;
}

.breadcrumb-separator {
    color: #aaa;
    font-size: 0.75rem;
}

/* ===== TOOLBAR ===== */
.loja-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.loja-results-count {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.loja-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #333;
}

.loja-sort select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #333;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.loja-sort select:focus {
    border-color: var(--site-primary, #008000);
}

/* ===== GRID DE PRODUTOS DA LOJA ===== */
.loja-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

@media (min-width: 768px) {
    .loja-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .loja-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* ===== CARD DE PRODUTO DA LOJA ===== */
.loja-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.loja-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Botão favoritar */
.loja-card-favorite {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.loja-card-favorite i {
    font-size: 0.9rem;
    color: #ccc;
    transition: color 0.2s;
}

.loja-card-favorite:hover i,
.loja-card-favorite.active i {
    color: #e74c3c;
}

/* Imagem do card */
.loja-card-image {
    position: relative;
    padding-top: 100%;
    background: #f5f5f5;
}

.loja-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.loja-card:hover .loja-card-image img {
    transform: scale(1.04);
}

/* Badge de desconto */
.loja-card-discount {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--site-accent, #FF4500);
    color: #fff;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 2;
}

/* Informações do card */
.loja-card-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.loja-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.3;
}

.loja-card-old-price {
    font-size: 0.78rem;
    color: #999;
    text-decoration: line-through;
    margin: 0;
}

.loja-card-price {
    font-size: 1rem;
    font-weight: bold;
    color: var(--site-accent, #FF4500);
    margin: 0;
}

.loja-card-installments {
    font-size: 0.75rem;
    color: #666;
    margin: 0;
}

/* Estrelas de avaliação */
.loja-card-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 4px;
}

.loja-card-stars i {
    font-size: 0.7rem;
    color: #f5a623;
}

.loja-card-stars span {
    font-size: 0.72rem;
    color: #888;
    margin-left: 4px;
}

/* Botão adicionar ao carrinho no card (mobile/base) */
.loja-card-add-btn {
    margin: 0 12px 12px;
    padding: 9px;
    background: var(--site-primary, #008000);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s;
    width: calc(100% - 24px);
}

.loja-card-add-btn:hover {
    background: var(--site-primary, #006600);
}

/* ===== ESTADO VAZIO ===== */
.loja-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.loja-empty i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 16px;
    display: block;
}

.loja-empty p {
    font-size: 1rem;
    color: #888;
}

/* ===== MODAL DO PRODUTO ===== */
.product-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.product-modal-overlay.active {
    display: flex;
}

.product-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 820px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

.product-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #666;
    z-index: 2;
    line-height: 1;
    transition: color 0.2s;
}

.product-modal-close:hover {
    color: #000;
}

.product-modal-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 32px 24px 24px;
}

@media (min-width: 600px) {
    .product-modal-body {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* Galeria do modal */
.product-modal-gallery {
    flex: 0 0 auto;
    width: 100%;
}

@media (min-width: 600px) {
    .product-modal-gallery {
        width: 280px;
    }
}

.product-modal-main-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 12px;
}

.product-modal-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-modal-thumbnails {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-thumb {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s;
    background: #f5f5f5;
}

.modal-thumb.active {
    border-color: var(--site-primary, #008000);
}

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

/* Informações do modal */
.product-modal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-modal-info h2 {
    font-size: 1.4rem;
    color: #333;
    margin: 0;
    line-height: 1.3;
}

.modal-price-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-price {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--site-accent, #FF4500);
    margin: 0;
}

.modal-installments {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

.modal-label {
    font-size: 0.85rem;
    color: #555;
    margin: 0 0 8px 0;
    font-weight: 500;
}

/* Variações do modal */
.modal-variation-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-variation-btn {
    padding: 7px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    color: #333;
    transition: all 0.2s ease;
}

.modal-variation-btn:hover {
    border-color: var(--site-primary, #008000);
    color: var(--site-primary, #008000);
}

.modal-variation-btn.active {
    border-color: var(--site-primary, #008000);
    background: var(--site-primary, #008000);
    color: #fff;
}

/* Quantidade do modal */
.modal-quantity-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-qty-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-weight: bold;
}

.modal-qty-btn:hover {
    background: #f0f0f0;
}

#modalQtyValue {
    font-size: 1.1rem;
    font-weight: bold;
    min-width: 24px;
    text-align: center;
}

.modal-stock {
    font-size: 0.8rem;
    color: #888;
    margin: 0;
}

/* Ações do modal */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.btn-buy-now {
    padding: 13px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 600;
}

.btn-buy-now:hover {
    background: #111;
}

.btn-add-modal {
    padding: 13px;
    background: var(--site-primary, #008000);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 600;
}

.btn-add-modal:hover {
    background: var(--site-secondary, #006400);
}

/* ===== RESPONSIVIDADE MOBILE ===== */
@media (max-width: 767px) {
    .loja-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .product-modal-body {
        padding: 40px 16px 20px;
    }

    .product-modal-info h2 {
        font-size: 1.2rem;
    }

    .modal-price {
        font-size: 1.3rem;
    }
}

.breadcrumb-home {
    text-decoration: none;
    color: #666;
    transition: color 0.2s;
}

.breadcrumb-home:hover {
    color: var(--site-primary, #008000);
}

/* ===== PRODUTO ESGOTADO ===== */
.loja-card-sold-out {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #c0392b;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: bold;
    z-index: 2;
    letter-spacing: 0.03em;
}

.loja-card-image.is-sold-out img {
    filter: grayscale(80%);
    opacity: 0.7;
}

.loja-card-sold-out-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 12px 12px;
}

.loja-card-notify-btn,
.loja-card-order-btn {
    padding: 9px;
    border: none;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    font-family: inherit;
}

.loja-card-notify-btn {
    background: #fff;
    color: var(--site-primary, #008000);
    border: 1.5px solid var(--site-primary, #008000);
}

.loja-card-notify-btn:hover {
    background: var(--site-primary, #008000);
    color: #fff;
}

.loja-card-order-btn {
    background: #25D366;
    color: #fff;
}

.loja-card-order-btn:hover {
    opacity: 0.9;
}

/* Modal — produto esgotado */
.modal-stock.is-out {
    color: #c0392b;
    font-weight: 600;
}

.modal-sold-out-actions {
    display: none;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.btn-notify-modal,
.btn-order-modal {
    padding: 13px;
    border-radius: 7px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: inherit;
    border: none;
}

.btn-notify-modal {
    background: #fff;
    color: var(--site-primary, #008000);
    border: 2px solid var(--site-primary, #008000);
}

.btn-notify-modal:hover {
    background: var(--site-primary, #008000);
    color: #fff;
}

.btn-order-modal {
    background: #25D366;
    color: #fff;
}

.btn-order-modal:hover {
    opacity: 0.9;
}

/* ===== MODAL DE NOTIFICAÇÃO ===== */
.notify-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 10002;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.notify-modal-overlay.active {
    display: flex;
}

.notify-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    padding: 32px 28px;
    text-align: center;
    animation: modalFadeIn 0.25s ease;
    position: relative;
}

.notify-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: #888;
    line-height: 1;
}

.notify-modal-icon {
    font-size: 2.6rem;
    color: var(--site-primary, #008000);
    margin-bottom: 14px;
}

.notify-modal h3 {
    font-size: 1.15rem;
    color: #333;
    margin-bottom: 8px;
}

.notify-modal-product {
    font-size: 0.9rem;
    color: var(--site-primary, #008000);
    font-weight: 600;
    margin-bottom: 6px;
}

.notify-modal p {
    font-size: 0.88rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.notify-modal input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.92rem;
    outline: none;
    margin-bottom: 14px;
    text-align: center;
}

.notify-modal input:focus {
    border-color: var(--site-primary, #008000);
}

.notify-modal-btn {
    width: 100%;
    padding: 12px;
    background: var(--site-primary, #008000);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.notify-modal-btn:hover {
    background: var(--site-secondary, #006400);
}

.notify-modal-btn:disabled {
    background: #aaa;
    cursor: not-allowed;
}

.notify-modal-message {
    font-size: 0.85rem;
    margin-top: 12px;
    display: none;
}

.notify-modal-message.success { color: #166534; display: block; }
.notify-modal-message.error   { color: #c0392b; display: block; }