/**
 * FreioGas Frontend Styles
 * Autor: Dumont Web (https://dumontweb.com.br)
 * Versão: 1.0.0
 */

:root {
    --fg-bg-dark: #042918;
    --fg-primary: #04653d;
    --fg-secondary: #024c2f;
    --fg-whatsapp: #0cd55e;
    --fg-cta: #f88a2b;
    --fg-neutral: #d8ddd6;
    --fg-white: #fcfdfd;
    --fg-radius: 12px;
    --fg-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --fg-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Products Grid */
.fg-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.fg-product-card {
    background: var(--fg-white);
    border-radius: var(--fg-radius);
    box-shadow: var(--fg-shadow);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fg-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--fg-shadow-lg);
}

.fg-product-sku {
    display: inline-block;
    background: var(--fg-primary);
    color: var(--fg-white);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
    width: fit-content;
}

.fg-product-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--fg-bg-dark);
    margin: 0 0 0.5rem;
}

.fg-product-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--fg-primary);
    margin-bottom: 0.75rem;
}

.fg-product-stock {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--fg-whatsapp);
    margin-bottom: 1rem;
}

.fg-product-stock::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--fg-whatsapp);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.fg-product-stock.out-of-stock {
    color: #dc3232;
}

.fg-product-stock.out-of-stock::before {
    background: #dc3232;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.fg-product-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--fg-whatsapp);
    color: var(--fg-white);
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--fg-radius);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
    margin-top: auto;
}

.fg-product-btn:hover {
    background: #0bb54e;
    transform: scale(1.02);
}

.fg-product-btn:active {
    transform: scale(0.98);
}

.fg-product-btn svg {
    width: 20px;
    height: 20px;
}

/* Order Form */
.fg-order-form {
    background: var(--fg-white);
    border-radius: var(--fg-radius);
    box-shadow: var(--fg-shadow-lg);
    padding: 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.fg-order-form h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fg-bg-dark);
    margin: 0 0 1.5rem;
    text-align: center;
}

.fg-form-group {
    margin-bottom: 1.25rem;
}

.fg-form-group label {
    display: block;
    font-weight: 600;
    color: var(--fg-bg-dark);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.fg-form-group label .required {
    color: #dc3232;
}

.fg-form-group select,
.fg-form-group input,
.fg-form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--fg-neutral);
    border-radius: var(--fg-radius);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--fg-white);
}

.fg-form-group select:focus,
.fg-form-group input:focus,
.fg-form-group textarea:focus {
    outline: none;
    border-color: var(--fg-primary);
    box-shadow: 0 0 0 3px rgba(4, 101, 61, 0.1);
}

.fg-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.fg-quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fg-quantity-btn {
    width: 44px;
    height: 44px;
    border: 2px solid var(--fg-neutral);
    background: var(--fg-white);
    border-radius: var(--fg-radius);
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fg-quantity-btn:hover {
    border-color: var(--fg-primary);
    background: var(--fg-primary);
    color: var(--fg-white);
}

.fg-quantity-input {
    width: 60px !important;
    text-align: center;
    font-weight: 700;
}

.fg-submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--fg-whatsapp);
    color: var(--fg-white);
    font-size: 1.125rem;
    font-weight: 700;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--fg-radius);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1.5rem;
}

.fg-submit-btn:hover {
    background: #0bb54e;
    transform: translateY(-2px);
    box-shadow: var(--fg-shadow-lg);
}

.fg-submit-btn:disabled {
    background: var(--fg-neutral);
    cursor: not-allowed;
    transform: none;
}

.fg-submit-btn svg {
    width: 24px;
    height: 24px;
}

.fg-form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: var(--fg-radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.fg-form-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    padding: 0.75rem 1rem;
    border-radius: var(--fg-radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Floating WhatsApp Button */
.fg-whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    width: 60px;
    height: 60px;
    background: var(--fg-whatsapp);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(12, 213, 94, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.fg-whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(12, 213, 94, 0.5);
}

.fg-whatsapp-float svg {
    width: 32px;
    height: 32px;
    fill: var(--fg-white);
}

/* Loading Spinner */
.fg-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--fg-white);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Add Item Section - Destacado */
.fg-inline-actions {
    background: linear-gradient(135deg, var(--fg-primary) 0%, var(--fg-secondary) 100%);
    border-radius: var(--fg-radius);
    padding: 1.25rem;
    margin: 1.5rem 0;
    text-align: center;
}

.fg-add-item-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--fg-cta);
    color: var(--fg-white);
    font-size: 1.125rem;
    font-weight: 700;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--fg-radius);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(248, 138, 43, 0.4);
    width: 100%;
    margin-bottom: 0.75rem;
}

.fg-add-item-btn:hover {
    background: #e67a1a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(248, 138, 43, 0.5);
}

.fg-add-item-btn:active {
    transform: translateY(0);
}

.fg-add-item-btn::before {
    content: '+';
    font-size: 1.5rem;
    font-weight: 800;
}

.fg-add-hint {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Items List - Melhorado */
.fg-items-wrapper {
    background: #f8faf9;
    border: 2px dashed var(--fg-primary);
    border-radius: var(--fg-radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.fg-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--fg-neutral);
}

.fg-items-header span:first-child {
    font-weight: 700;
    color: var(--fg-bg-dark);
    font-size: 1rem;
}

.fg-items-total {
    font-weight: 800;
    color: var(--fg-primary);
    font-size: 1.125rem;
}

.fg-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fg-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--fg-white);
    padding: 0.875rem 1rem;
    border-radius: var(--fg-radius);
    margin-bottom: 0.5rem;
    box-shadow: var(--fg-shadow);
}

.fg-item-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.fg-item-info strong {
    color: var(--fg-bg-dark);
    font-size: 0.95rem;
}

.fg-item-info span {
    color: var(--fg-text-muted);
    font-size: 0.875rem;
}

.fg-remove-item {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.fg-remove-item:hover {
    background: #dc2626;
    color: white;
}

.fg-items-empty {
    text-align: center;
    color: var(--fg-text-muted);
    font-style: italic;
    padding: 1rem;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
    .fg-products-grid {
        grid-template-columns: 1fr;
    }
    
    .fg-order-form {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .fg-whatsapp-float {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
    
    .fg-item {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .fg-item-info {
        justify-content: center;
    }
}
