/* ===================================
   Reset & Base Styles
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #EA1D2C;
    --secondary-color: #FFB800;
    --success-color: #25D366;
    --background: #F8F9FA;
    --surface: #FFFFFF;
    --text-primary: #2E2E2E;
    --text-secondary: #717171;
    --border-color: #E8E8E8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===================================
   Header
   =================================== */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #C91825 100%);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2.5rem;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.establishment-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.establishment-location {
    font-size: 0.875rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-details {
    display: flex;
    gap: 20px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(10px);
}

/* ===================================
   Banner de Avisos
   =================================== */
.banner-notice {
    background: linear-gradient(90deg, var(--secondary-color) 0%, #FFA000 100%);
    color: var(--text-primary);
    padding: 12px 0;
    text-align: center;
    font-weight: 500;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notice-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.notice-content i {
    font-size: 1.2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* ===================================
   Busca
   =================================== */
.search-section {
    padding: 24px 0;
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.search-box input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--surface);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(234, 29, 44, 0.1);
}

/* ===================================
   Categorias
   =================================== */
.categories-section {
    padding: 16px 0;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 80px;
    z-index: 90;
}

.categories-tabs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: none;
}

.categories-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--background);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.category-tab:hover {
    border-color: var(--primary-color);
    background: rgba(234, 29, 44, 0.05);
}

.category-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.category-tab i {
    font-size: 1.1rem;
}

/* ===================================
   Produtos
   =================================== */
.products-section {
    padding: 32px 0 100px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.product-card.unavailable {
    opacity: 0.6;
}

.product-card.unavailable::after {
    content: 'Indisponível';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    z-index: 10;
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--background);
}

.product-info {
    padding: 16px;
}

.product-category {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.product-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.btn-add {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-add:hover {
    background: #C91825;
    transform: scale(1.05);
}

.btn-add:active {
    transform: scale(0.95);
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.no-results p {
    font-size: 1.1rem;
}

/* ===================================
   Carrinho Flutuante
   =================================== */
.cart-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.cart-float-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #C91825 100%);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    position: relative;
}

.cart-float-btn:hover {
    transform: scale(1.1);
}

.cart-float-btn:active {
    transform: scale(0.95);
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--secondary-color);
    color: var(--text-primary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid white;
}

/* ===================================
   Modal
   =================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--background);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

/* ===================================
   Carrinho
   =================================== */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--background);
    border-radius: var(--radius-md);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-item-observations {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.cart-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.qty-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.qty-display {
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.cart-item-price {
    font-weight: 700;
    color: var(--primary-color);
}

.btn-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-remove:hover {
    background: rgba(234, 29, 44, 0.1);
    color: var(--primary-color);
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-cart i {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.cart-summary {
    margin-bottom: 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.95rem;
}

.summary-row.total {
    border-top: 2px solid var(--border-color);
    margin-top: 8px;
    padding-top: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ===================================
   Formulários
   =================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--surface);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(234, 29, 44, 0.1);
}

.radio-group {
    display: flex;
    gap: 16px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    flex: 1;
    justify-content: center;
}

.radio-label:hover {
    border-color: var(--primary-color);
    background: rgba(234, 29, 44, 0.05);
}

.radio-label input[type="radio"] {
    width: auto;
}

.radio-label input[type="radio"]:checked+span {
    font-weight: 600;
}

.radio-label:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(234, 29, 44, 0.1);
}

/* ===================================
   Modal de Produto
   =================================== */
.product-modal-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.product-modal-description {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.product-modal-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 24px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 20px;
    background: var(--background);
    border-radius: var(--radius-md);
    margin-top: 20px;
}

.quantity-selector .qty-btn {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
}

.quantity-selector .qty-display {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 40px;
}

/* ===================================
   Botões
   =================================== */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #C91825;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #1FB855;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-block {
    width: 100%;
}

.btn:active {
    transform: translateY(0);
}

/* ===================================
   Footer
   =================================== */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 24px 0;
    text-align: center;
    margin-top: 40px;
}

.footer p {
    margin-bottom: 8px;
    opacity: 0.8;
}

.admin-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.admin-link:hover {
    color: white;
    text-decoration: underline;
}

/* ===================================
   Responsividade
   =================================== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-details {
        width: 100%;
        justify-content: space-between;
    }

    .establishment-name {
        font-size: 1.3rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .product-image {
        height: 140px;
    }

    .product-name {
        font-size: 0.95rem;
    }

    .product-price {
        font-size: 1.1rem;
    }

    .btn-add {
        padding: 8px 12px;
        font-size: 0.875rem;
    }

    .cart-float {
        bottom: 16px;
        right: 16px;
    }

    .cart-float-btn {
        width: 56px;
        height: 56px;
        font-size: 1.3rem;
    }

    .modal-content {
        max-height: 95vh;
    }

    .radio-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .categories-section {
        top: 120px;
    }

    .category-tab {
        font-size: 0.85rem;
        padding: 8px 16px;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-image {
        height: 200px;
    }
}