/* ==========================================================
   CALCULADORA DE ALIMENTOS - BEM CSS
   ========================================================== */

/* Componente Principal */
#calculator {
    max-width: 1080px;
    margin: 60px auto;
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
#calculator .calculator__header {
    background: linear-gradient(to right, #7e66c8, #7b33cd);
    color: white;
    height: 80px;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    border-radius: 24px 24px 0 0;
}

#calculator .calculator__header-icon {
    width: 28px;
    height: 28px;
    margin-right: 8px;
}

#calculator .calculator__header-title {
    font-size: 16px;
    margin: 0;
    display: flex;
    align-items: center;
}

@media (min-width: 768px) {
    #calculator .calculator__header-title {
        font-size: 20px;
    }
}

/* Content */
#calculator .calculator__content {
    padding: 20px 20px;
}

@media (min-width: 768px) {
    #calculator .calculator__content {
        padding: 26px 32px;
    }
}

/* Alert */
#calculator .calculator__alert {
    margin-bottom: 12px;
    padding: 12px;
    border-left: 4px solid #fbbf24;
    border-radius: 0 8px 8px 0;
    background-color: #fefce8;
}

#calculator .calculator__alert--info {
    background-color: #eff6ff;
    border-left-color: #3b82f6;
}

#calculator .calculator__alert--warning {
    background-color: #fefce8;
    border-left-color: #fbbf24;
}

#calculator .calculator__alert-text {
    font-size: 14px;
    margin: 0;
    color: #78350f;
}

#calculator .calculator__alert--info .calculator__alert-text {
    color: #1e40af;
}

#calculator .calculator__alert--warning .calculator__alert-text {
    color: #78350f;
}

/* Navigator Top */
#calculator .calculator__navigator--top {
    margin-bottom: 35px;
    display: flex;
    justify-content: center;
}

#calculator .calculator__steps-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

#calculator .calculator__step {
    margin-right: 50px;
    position: relative;
    cursor: pointer;
}

#calculator .calculator__step:last-child {
    margin-right: 0;
}

#calculator .calculator__step::before {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 55px;
    width: 100%;
    height: 4px;
    background: #999;
}

#calculator .calculator__step:last-child::before {
    display: none;
}

#calculator .calculator__step-wrapper {
    padding: 5px;
    border-radius: 50%;
}

#calculator .calculator__step-number {
    margin-block-end: 0;
    width: 50px;
    height: 50px;
    background: #999;
    color: #fff;
    text-align: center;
    line-height: 50px;
    border-radius: 50%;
    margin: 0;
}

#calculator .calculator__step--active::before {
    background: #6c5dd4;
}

#calculator .calculator__step--active .calculator__step-number {
    background: #6c5dd4;
}

@media (max-width: 768px) {
    #calculator .calculator__step-number {
        width: 40px;
        height: 40px;
        line-height: 40px;
    }
    
    #calculator .calculator__steps-list {
        max-width: 250px;
    }
    
    #calculator .calculator__step {
        margin-right: 0;
    }
    
    #calculator .calculator__step::before {
        left: 30px;
    }
    #calculator .calculator__tab {
        width: 90% !important;
    }
}

/* Tabs */
#calculator .calculator__tabs {
    width: 100%;
}

#calculator .calculator__tab {
    display: block;
    width: 700px;
    max-width: 900px;
    margin: 0 auto;
}

#calculator .calculator__tab--hidden {
    display: none;
}

#calculator .calculator__tab-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

#calculator .calculator__tab-title {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin: 0 0 24px 0;
    color: #1f2937;
}

/* Labels e Inputs */
#calculator .calculator__label {
    display: flex;
    flex-direction: column;
    font-weight: 500;
    color: #374151;
}

#calculator .calculator__input {
    width: 200px;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 16px;
    font-size: 16px;
    margin-top: 8px;
    transition: border-color 0.3s ease;
}

#calculator .calculator__input:focus {
    outline: none;
    border-color: #6c5dd4;
}

@media (min-width: 768px) {
    #calculator .calculator__input {
        width: 300px;
    }
}

/* Perfil */
#calculator .calculator__perfil {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

#calculator .calculator__perfil-title {
    font-weight: bold;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #a0a0a0;
    color: #1f2937;
}

#calculator .calculator__perfil-group {
    padding-left: 25px;
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#calculator .calculator__perfil-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #374151;
}

#calculator .calculator__radio {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Navigator Bottom */
#calculator .calculator__navigator--bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

@media (min-width: 1024px) {
    #calculator .calculator__navigator--bottom {
        flex-direction: row;
        justify-content: center;
    }
}

#calculator .calculator__btn {
    min-width: 170px;
    height: 50px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#calculator .calculator__btn--primary {
    background-color: #6c5dd4;
    color: white;
    border-color: #6c5dd4;
}

#calculator .calculator__btn--primary:hover {
    background-color: #5a4bc2;
    border-color: #5a4bc2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 93, 212, 0.3);
}

#calculator .calculator__btn--ghost {
    background-color: #6c5dd4;
    color: white;
    border-color: #6c5dd4;
}

#calculator .calculator__btn--ghost:hover {
    background-color: #5a4bc2;
    border-color: #5a4bc2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 93, 212, 0.3);
}

#calculator .calculator__btn--secondary {
    background-color: white;
    color: #6c5dd4;
    border-color: #6c5dd4;
}

#calculator .calculator__btn--secondary:hover {
    background-color: #f3f4f6;
    transform: translateY(-2px);
}

#calculator .calculator__btn--hidden {
    display: none !important;
}

#calculator .calculator__btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Categorias (Cardápio e Utensílios) */
#calculator .calculator__categoria {
    border: 1px solid #bfbfbf;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
}
#calculator .calculator__categoria--utensilios {
    padding: 12px;
}

#calculator .calculator__categoria--open .calculator__categoria-content {
    max-height: 5000px;
    padding-top: 20px;
}

#calculator .calculator__categoria-button {
    width: 100%;
    padding: 12px;
    background: white !important;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

#calculator .calculator__categoria-button:hover {
    color: #6c5dd4;
}

#calculator .calculator__categoria-title {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    padding: 0;
}

#calculator .calculator__categoria-arrow {
    font-size: 24px;
    color: #999;
    transition: transform 0.3s ease;
    font-weight: 900;
}

#calculator .calculator__categoria-chevron {
    width: 26px;
    height: 26px;
    font-weight: 900;
}

#calculator .calculator__categoria-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out;
    padding: 0 16px;
}

#calculator .calculator__categoria-content--open {
    max-height: 5000px;
    padding-top: 20px;
}

#calculator .calculator__categoria-items {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: center;
}

@media (min-width: 640px) {
    #calculator .calculator__categoria-items {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    #calculator .calculator__categoria-items {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
}

/* Item do Cardápio */
#calculator .calculator__item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 50px;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    border: 1.5px solid #a0a0a0;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

#calculator .calculator__item:hover {
    border-color: #6c5dd4;
}

#calculator .calculator__item-text {
    font-size: 16px;
    color: #1f2937;
    line-height: 1.2rem;
}

#calculator .calculator__item-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Utensílios (sempre aberto) */
#calculator .calculator__categoria--open {
    padding-bottom: 12px;
}

/* Resultado */
#calculator .calculator__result {
    width: 100%;
}

#calculator .calculator__result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

#calculator .calculator__result-actions .calculator__btn {
    flex: 1;
    min-width: 180px;
    max-width: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#calculator .calculator__result-actions .calculator__btn svg {
    width: 20px;
    height: 20px;
}

#calculator .calculator__result-title {
    font-size: 30px;
    font-weight: bold;
    margin-bottom: 24px;
    text-align: center;
    color: #1f2937;
}

#calculator .calculator__result-highlight {
    font-weight: bold;
    color: #6c5dd4;
}

#calculator .calculator__result-dica {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

@media (min-width: 768px) {
    #calculator .calculator__result-dica {
        flex-wrap: nowrap;
    }
}

#calculator .calculator__result-dica-icon {
    width: 24px;
    height: 24px;
    margin-right: 4px;
}

#calculator .calculator__result-espaco {
    font-weight: normal;
}

#calculator .calculator__result-lista-title {
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
    margin-bottom: 16px;
    color: #374151;
    page-break-after: avoid;
    break-after: avoid;
}

#calculator .calculator__lista-insumos-container {
    width: 100%;
    page-break-inside: auto;
}

#calculator .calculator__result-table {
    width: 100%;
    max-width: 900px;
    border-collapse: collapse;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    page-break-inside: auto;
}

#calculator .calculator__result-thead {
    background-color: #6c5dd4;
    color: white;
    page-break-after: avoid;
    break-after: avoid;
}

#calculator .calculator__result-th {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    padding: 12px;
}

#calculator .calculator__result-tbody {
    background-color: white;
}

#calculator .calculator__result-tr {
    transition: background-color 0.2s ease;
    page-break-inside: avoid;
    break-inside: avoid;
}

#calculator .calculator__result-tr:hover {
    background-color: #f9fafb;
}

#calculator .calculator__result-td {
    font-size: 14px;
    padding: 12px;
    text-align: left;
    page-break-inside: avoid;
    break-inside: avoid;
}

#calculator .calculator__result-td--quantidade {
    font-weight: bold;
    color: #6c5dd4;
}

#calculator .calculator__result-error {
    color: #b91c1c;
    font-weight: 600;
    padding: 16px;
    background-color: #fee2e2;
    border-radius: 8px;
}

#calculator .calculator__result-empty {
    color: #6b7280;
    padding: 16px;
    background-color: #fef3c7;
    border-radius: 8px;
}

/* Shared (Compartilhamento) */
#calculator .calculator__shared {
    margin-bottom: 24px;
    padding: 16px;
    background-color: #f9fafb;
    border-radius: 8px;
    text-align: center;
}

/* Error Message */
#calculator .calculator__error {
    color: #dc2626;
    font-weight: 600;
    margin-top: 16px;
    padding: 12px;
    background-color: #fee2e2;
    border-left: 4px solid #dc2626;
    border-radius: 4px;
    animation: slideIn 0.3s ease-out;
}

/* Success Toast */
.calculator__success-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #10b981;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    z-index: 9999;
    animation: slideInUp 0.3s ease-out;
}

.calculator__success-toast svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.calculator__success-toast--hide {
    animation: slideOutDown 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

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

.calculator p, .calculator h3, .calculator h4 {
    margin-block-start: 0;
    margin-block-end: 0;
}
