/**
 * Sabor+FPG - Frontend Styles
 */

/* === Reset & Base === */
.fpg-wrap *,
.fpg-modal * {
    box-sizing: border-box;
}

/* === Products Grid === */
.fpg-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 30px 0;
    padding: 0;
}

.fpg-product-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
}

.fpg-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.fpg-product-card.fpg-out-of-stock {
    opacity: 0.6;
}

.fpg-product-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
}

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

.fpg-product-card:hover .fpg-product-image img {
    transform: scale(1.05);
}

.fpg-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: #ccc;
}

.fpg-product-code {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.fpg-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.fpg-badge-out {
    background: #dc3232;
}

.fpg-badge-low {
    background: #f56e28;
    animation: fpg-pulse 1.5s infinite;
}

@keyframes fpg-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

.fpg-product-info {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.fpg-product-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

.fpg-product-desc {
    margin: 0 0 12px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
}

.fpg-product-meta {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fpg-product-meta li {
    background: #f8f9fa;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: #555;
}

.fpg-meta-label {
    color: #888;
    font-weight: 600;
}

.fpg-product-weight {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff8f4;
    border: 1px solid #ffd9b3;
    color: #c2410c;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.fpg-weight-icon {
    font-size: 14px;
}

.fpg-product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.fpg-product-price {
    font-size: 22px;
    font-weight: 800;
    color: #ff6b35;
}

/* === Buttons === */
.fpg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1;
}

.fpg-btn-primary {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.fpg-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 107, 53, 0.4);
}

.fpg-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.fpg-btn-secondary:hover {
    background: #e0e0e0;
}

.fpg-btn-success {
    background: #46b450;
    color: #fff;
}

.fpg-btn-success:hover {
    background: #3ea547;
}

.fpg-btn-danger {
    background: #dc3232;
    color: #fff;
}

.fpg-btn-disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

.fpg-btn-icon {
    font-size: 18px;
    font-weight: 700;
}

/* === Cart Trigger === */
.fpg-cart-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #fff;
    border: none;
    padding: 16px 22px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.4);
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.fpg-cart-trigger:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(255, 107, 53, 0.5);
}

.fpg-cart-icon {
    font-size: 22px;
}

.fpg-cart-count {
    background: #fff;
    color: #ff6b35;
    border-radius: 50%;
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    padding: 0 6px;
}

/* === Modals === */
.fpg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fpg-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.fpg-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fpg-modal-in 0.3s ease;
}

.fpg-modal-lg {
    max-width: 800px;
}

@keyframes fpg-modal-in {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

.fpg-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #fff;
}

.fpg-modal-header h2,
.fpg-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #fff;
}

.fpg-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.fpg-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.fpg-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* === Cart Items === */
.fpg-cart-items {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.fpg-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.fpg-cart-item:last-child {
    border-bottom: none;
}

.fpg-cart-item-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
}

.fpg-cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fpg-cart-item-info {
    flex: 1;
    min-width: 0;
}

.fpg-cart-item-name {
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px;
    font-size: 14px;
}

.fpg-cart-item-price {
    color: #888;
    font-size: 13px;
}

.fpg-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.fpg-cart-item-inc,
.fpg-cart-item-dec {
    width: 26px;
    height: 26px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.fpg-cart-item-inc:hover,
.fpg-cart-item-dec:hover {
    background: #ff6b35;
    color: #fff;
    border-color: #ff6b35;
}

.fpg-cart-item-qty-input {
    width: 42px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 4px;
    font-weight: 600;
    font-size: 13px;
    background: #f9f9f9;
    -moz-appearance: textfield;
}

.fpg-cart-item-qty-input::-webkit-outer-spin-button,
.fpg-cart-item-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.fpg-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fpg-qty-btn:hover {
    background: #f5f5f5;
}

.fpg-qty-input {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 4px;
    font-weight: 600;
}

.fpg-cart-item-remove {
    background: none;
    border: none;
    color: #dc3232;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.fpg-cart-item-remove:hover {
    background: rgba(220, 50, 50, 0.1);
}

.fpg-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-top: 2px solid #ff6b35;
    margin-top: 12px;
    font-size: 18px;
    font-weight: 700;
}

.fpg-cart-total-value {
    color: #ff6b35;
    font-size: 22px;
}

/* === Cart Action Buttons (Delivery / Pickup) === */
.fpg-cart-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.fpg-action-card {
    padding: 20px;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.fpg-action-card:hover {
    border-color: #ff6b35;
    background: #fff8f4;
    transform: translateY(-2px);
}

.fpg-action-card-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.fpg-action-card-title {
    font-weight: 700;
    margin-bottom: 4px;
    color: #1a1a1a;
}

.fpg-action-card-desc {
    font-size: 12px;
    color: #888;
}

.fpg-empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.fpg-empty-cart-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* === Forms === */
.fpg-form-group {
    margin-bottom: 16px;
}

.fpg-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.fpg-form-row-3 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
}

.fpg-form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.fpg-form-label .required {
    color: #dc3232;
}

.fpg-form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.fpg-form-control:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

textarea.fpg-form-control {
    resize: vertical;
    min-height: 80px;
}

/* === Pickup Address (cart modal) === */
.fpg-pickup-info {
    background: #fff8f4;
    border: 1px solid #ffd9b3;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.fpg-pickup-info-title {
    font-weight: 700;
    color: #ff6b35;
    margin-bottom: 6px;
}

.fpg-pickup-info-text {
    color: #555;
    font-size: 14px;
}

/* === Quantity Modal === */
.fpg-qty-modal-body {
    text-align: center;
    padding: 30px 20px;
}

.fpg-qty-modal-product {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    text-align: left;
}

.fpg-qty-modal-img {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    background: #f5f5f5;
}

.fpg-qty-modal-info h3 {
    margin: 0 0 4px;
    font-size: 18px;
}

.fpg-qty-modal-info .fpg-qty-modal-price {
    color: #ff6b35;
    font-size: 20px;
    font-weight: 700;
}

.fpg-qty-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 24px 0;
}

.fpg-qty-selector-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f5f5f5;
    border: none;
    font-size: 24px;
    font-weight: 700;
    color: #ff6b35;
    cursor: pointer;
    transition: all 0.2s;
}

.fpg-qty-selector-btn:hover {
    background: #ff6b35;
    color: #fff;
}

.fpg-qty-selector-input {
    width: 80px;
    height: 50px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
}

.fpg-qty-selector-input:focus {
    outline: none;
    border-color: #ff6b35;
}

.fpg-qty-stock-info {
    color: #888;
    font-size: 13px;
    margin-top: 8px;
}

.fpg-qty-total {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px;
    margin-top: 16px;
    font-size: 16px;
}

.fpg-qty-total strong {
    color: #ff6b35;
    font-size: 20px;
}

/* === Order Success === */
.fpg-order-success {
    text-align: center;
    padding: 30px 20px;
}

.fpg-success-icon {
    width: 80px;
    height: 80px;
    background: #46b450;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
    animation: fpg-success-pop 0.5s ease;
}

@keyframes fpg-success-pop {
    0%   { transform: scale(0); }
    50%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.fpg-order-code {
    background: #f8f9fa;
    padding: 12px 20px;
    border-radius: 10px;
    display: inline-block;
    margin: 16px 0;
    font-family: monospace;
    font-size: 18px;
    font-weight: 700;
    color: #ff6b35;
}

.fpg-whatsapp-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.fpg-whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: #25d366;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    transition: all 0.2s;
}

.fpg-whatsapp-btn:hover {
    background: #1ebe57;
    transform: translateY(-2px);
    color: #fff;
}

.fpg-whatsapp-btn-secondary {
    background: #075e54;
}

.fpg-whatsapp-btn-secondary:hover {
    background: #054d44;
    color: #fff;
}

/* === Empty State === */
.fpg-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 20px 0;
}

/* === Notifications === */
.fpg-toast {
    position: fixed;
    bottom: 100px;
    right: 24px;
    background: #1a1a1a;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 99999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: fpg-toast-in 0.3s ease, fpg-toast-out 0.3s ease 2.7s forwards;
}

.fpg-toast-success {
    background: #46b450;
}

.fpg-toast-error {
    background: #dc3232;
}

@keyframes fpg-toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fpg-toast-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* === Responsive === */
@media (max-width: 640px) {
    .fpg-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }

    .fpg-product-image {
        height: 140px;
    }

    .fpg-product-title {
        font-size: 15px;
    }

    .fpg-product-price {
        font-size: 18px;
    }

    .fpg-cart-trigger {
        padding: 12px 18px;
        font-size: 14px;
    }

    .fpg-modal-content {
        max-height: 95vh;
        border-radius: 12px 12px 0 0;
        align-self: flex-end;
    }

    .fpg-modal {
        align-items: flex-end;
        padding: 0;
    }

    .fpg-cart-actions {
        grid-template-columns: 1fr;
    }

    .fpg-form-row,
    .fpg-form-row-3 {
        grid-template-columns: 1fr;
    }
}

/* =========================================================================
   v2.7.0 — Sabor+FPG
   Quebra de totais (Subtotal + Tele-entrega + Total) no checkout e sucesso.
   ========================================================================= */

.fpg-totals-breakdown {
    background: linear-gradient(135deg, #fff8f4 0%, #fffbf7 100%);
    border: 2px solid #ffd9b3;
    border-radius: 12px;
    padding: 18px 20px;
    margin-top: 18px;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.08);
}

.fpg-totals-header {
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid #ffd9b3;
    text-align: center;
}

.fpg-totals-breakdown .fpg-totals-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 15px;
}

.fpg-totals-breakdown .fpg-totals-label {
    color: #4a5568;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fpg-totals-breakdown .fpg-totals-value {
    color: #2d3748;
    font-weight: 700;
    font-size: 15px;
}

.fpg-totals-separator {
    height: 1px;
    background: #ffd9b3;
    margin: 8px 0;
}

.fpg-totals-breakdown .fpg-totals-final {
    margin-top: 0;
    padding-top: 12px;
    border-top: 2px solid #ff6b35;
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
}

.fpg-totals-breakdown .fpg-totals-final .fpg-totals-label {
    color: #ff6b35;
    font-weight: 700;
    font-size: 16px;
}

.fpg-totals-breakdown .fpg-totals-final .fpg-totals-value {
    color: #ff6b35;
    font-size: 18px;
}

/* No modal de sucesso, dá um respiro maior. */
.fpg-order-success .fpg-totals-breakdown {
    margin-top: 14px;
    text-align: left;
}

.fpg-badge-featured{position:absolute;top:10px;left:10px;background:#111827;color:#fff;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:700;z-index:2}
