/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    background: #000000;
    color: #333;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* Home Page Styles */
.home-container {
    min-height: 100vh;
    background: #000000;
    background-image: url('backoffice/serve_slide_image.php?image=Slide-MundoMolduras-molduras.jpg&v=1.0');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    padding-bottom: 60px;
}

.home-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.85) 30%, rgba(0, 0, 0, 0.75) 60%, rgba(0, 0, 0, 0.65) 100%);
    z-index: 0;
}

.home-container > * {
    position: relative;
    z-index: 1;
}

/* Home top bar with logo and account menu */
.home-top-bar {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 15px;
}

.home-top-logo {
    height: 40px;
    display: none;
}

/* Ensure account menu appears above everything in home container */
.home-container .account-menu-container {
    z-index: 9999999 !important;
    position: relative;
}

.home-container .account-menu-dropdown {
    z-index: 9999999 !important;
}

.home-footer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #999;
    font-size: 12px;
    text-align: center;
}

.home-header {
    text-align: center;
    margin-bottom: 20px;
    color: white;
}

.home-header img {
    height: 70px;
    margin-bottom: 10px;
}

.home-header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.home-header p {
    font-size: 14px;
    opacity: 0.9;
}

.main-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    max-width: 1000px;
    width: 100%;
}

.main-nav-card {
    background: white;
    padding: 25px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    color: #333;
    display: flex;
    flex-direction: column;
}

.main-nav-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.main-nav-icon {
    font-size: 64px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
}

.main-nav-icon svg {
    width: 100%;
    height: 100%;
    max-width: 200px;
    max-height: 200px;
}

.catalog-thumbnail {
    width: 100%;
    height: 200px;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.catalog-thumbnail:hover .catalog-thumb-img {
    transform: scale(1.05);
}

.main-nav-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #333;
}

.main-nav-card p {
    font-size: 13px;
    margin-bottom: auto;
    color: #666;
    flex-grow: 1;
}

.main-nav-btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 15px;
    width: 100%;
    box-sizing: border-box;
}

.main-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.catalog-buttons-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
}

.catalog-btn-split {
    flex: 1;
    margin-top: 0;
    text-align: center;
}

.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Account Menu Styles */
.account-menu-container {
    position: relative;
    display: inline-block;
    z-index: 9999999 !important;
}

.account-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    position: relative;
    z-index: 9999999 !important;
}

.account-menu-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.account-menu-btn svg {
    width: 16px;
    height: 16px;
}

.account-menu-dropdown {
    display: none;
    position: fixed !important;
    top: auto !important;
    bottom: auto !important;
    right: 20px !important;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 220px;
    z-index: 9999999 !important;
    overflow: hidden;
    isolation: isolate;
}

.account-menu-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.account-menu-header {
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.account-menu-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-menu-user-email {
    font-size: 14px;
    font-weight: 500;
    word-break: break-word;
}

.account-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #2c3e50;
    text-decoration: none;
    transition: background 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
}

.account-menu-item:hover {
    background: #f8f9fa;
}

.account-menu-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #7f8c8d;
}

.account-menu-item-danger {
    color: #e74c3c;
}

.account-menu-item-danger:hover {
    background: #fee;
}

.account-menu-item-danger svg {
    color: #e74c3c;
}

.account-menu-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 4px 0;
}

@media (max-width: 768px) {
    .home-top-bar {
        top: 15px;
        right: 15px;
        left: 15px;
        justify-content: space-between;
        align-items: center;
        flex-direction: row;
        gap: 15px;
    }
    
    .home-top-logo {
        display: block;
        height: 45px;
    }
    
    .home-container .account-menu-container {
        flex-shrink: 0;
    }
    
    .home-header {
        margin-top: 80px;
    }
    
    .home-header h1 {
        font-size: 24px;
    }
    
    .home-header p {
        font-size: 14px;
    }
    
    .home-header img {
        display: none;
    }
    
    .main-nav-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        max-width: 100%;
        padding: 0 15px;
    }
    
    .main-nav-card {
        padding: 15px 12px;
        border-radius: 8px;
    }
    
    .main-nav-icon {
        height: 120px;
        margin-bottom: 10px;
    }
    
    .main-nav-icon svg {
        max-width: 120px;
        max-height: 120px;
    }
    
    .catalog-thumbnail {
        height: 120px;
    }
    
    .main-nav-card h3 {
        font-size: 16px;
        margin-bottom: 5px;
    }
    
    .main-nav-card p {
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    .main-nav-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    background-image: url('backoffice/serve_slide_image.php?image=Slide-MundoMolduras-molduras.jpg&v=1.0');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

.login-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.85) 30%, rgba(0, 0, 0, 0.75) 60%, rgba(0, 0, 0, 0.65) 100%);
    z-index: 1;
}

.login-overlay > * {
    position: relative;
    z-index: 2;
}

.login-footer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #999;
    font-size: 12px;
    text-align: center;
    z-index: 2;
}

.login-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-logo {
    height: 80px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    background: transparent;
    filter: brightness(0);
}

.login-logo[src=""] {
    display: none;
}

.login-logo:not([src]) {
    display: none;
}

.login-header h2 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 1px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.login-input-group label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.login-input-group input {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.login-input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 45px;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.3s ease;
}

.password-toggle-btn:hover {
    color: #667eea;
}

.password-toggle-btn:focus {
    outline: none;
}

.eye-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.login-button {
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.login-button:active {
    transform: translateY(0);
}

.login-error {
    color: #d32f2f;
    font-size: 14px;
    margin-top: 10px;
    padding: 10px;
    background: #ffebee;
    border-radius: 8px;
    border: 1px solid #ffcdd2;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 18px;
    color: #333;
    font-weight: 500;
}

.simulator-container {
    margin: 0 auto;
    background: white;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    min-height: 100vh;
    width: 100%;
}

/* Cabeçalho */
.header {
    background: #000000;
    color: white;
    padding: 12px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 9999998;
    margin-bottom: 0;
    border-bottom: none;
}

.header .account-menu-container {
    z-index: 9999999 !important;
    position: relative;
}

.header .account-menu-dropdown {
    z-index: 9999999 !important;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 15px;
    padding: 0 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 0 0 auto;
}

.header-logo {
    height: 40px;
    margin-right: 0;
}

.header h1 {
    font-size: 20px;
    margin: 0;
    font-weight: bold;
    text-align: left;
    flex: 0 0 auto;
}

.header-content .catalog-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex: 0 0 auto;
}

.catalog-back-btn,
.catalog-logout-btn {
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s;
    font-size: 14px;
}

.catalog-back-btn:hover,
.catalog-logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Legacy styles - mantidos para compatibilidade se necessário */
.logo-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.logo-header a {
    display: inline-block;
    transition: opacity 0.3s;
}

.logo-header a:hover {
    opacity: 0.8;
}

.logo-image {
    height: 50px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
}

.logo-icon {
    display: inline-block;
}

/* Legacy styles - mantidos para compatibilidade se necessário */
.title-header {
    font-weight: 300;
    font-size: 24px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.title-icon {
    display: inline-block;
}

/* Dimensões */
.dimensions-section {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-bottom: 3px solid #667eea;
    margin-top: 0;
    border-top: none;
}

.dimensions-content {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    max-width: 100%;
    margin: 0;
    padding: 0 15px;
    flex-wrap: wrap;
}

.dimensions-inputs {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 320px;
    max-width: 320px;
    flex-shrink: 0;
}

.dimension-row {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.dimension-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: bold;
    min-width: 140px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    font-size: 14px;
}

.dimension-label svg {
    width: 16px;
    height: 16px;
}

.dimension-input {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 12px 16px;
    border-radius: 10px;
    border: 2px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
    min-height: 45px;
}

.dimension-input:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.dimension-input input {
    border: none;
    background: transparent;
    font-size: 18px;
    font-weight: bold;
    width: 100px;
    text-align: right;
    color: #667eea;
    flex: 1;
}

.dimension-input span {
    color: #666;
    font-size: 14px;
    font-weight: 600;
    min-width: 30px;
}

/* Tabela Principal */
.main-table {
    margin: 3px 20px;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr 1fr 1fr;
    gap: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 9px 9px;
    font-weight: bold;
    text-align: center;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 15px;
}

.col-label {
    text-align: left;
}

.component-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr 1fr 1fr;
    gap: 10px;
    padding: 2px 9px;
    border-bottom: 1px solid #e0e0e0;
    align-items: center;
    transition: all 0.3s ease;
}

.component-row:nth-child(even) {
    background: #f8f9ff;
}

.component-row:hover {
    background: #e8edff !important;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.component-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: default;
    font-size: 15px;
}

.component-label .toggle-icon {
    display: none;
}

.component-content {
    display: contents;
}

.price-cell {
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.select-cell {
    background: linear-gradient(135deg, #fff4e6 0%, #ffe0b2 100%);
    border: 2px solid #ff9800;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}

.select-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.select-cell select {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    color: #f57c00;
}

.metro-cell {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #2196f3;
    color: #0d47a1;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.pvp-cell {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #2196f3;
    color: #0d47a1;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.total-cell {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
    color: #1b5e20;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
    font-size: 15px;
    font-weight: bold;
}

/* Configuração */
.config-section {
    margin: 15px 0 0 0;
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    border: 2px solid #9c27b0;
    border-radius: 10px;
    padding: 12px 18px;
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.2);
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: center;
}

.config-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.config-label {
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    min-width: 180px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    font-size: 13px;
}

.config-input {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    padding: 8px 14px;
    border-radius: 8px;
    border: 2px solid #9c27b0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.config-input input {
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: bold;
    width: 80px;
    text-align: center;
    color: #9c27b0;
}

.config-input span {
    color: #666;
    font-size: 13px;
    font-weight: 600;
}

/* Totais */
.totals-section {
    margin: 15px 20px;
    display: flex;
    flex-direction: row;
    gap: 15px;
    justify-content: space-between;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 0;
}

.total-row:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.total-row:first-child {
    background: linear-gradient(135deg, #fff4e6 0%, #ffe0b2 100%);
    border: 2px solid #ff9800;
    color: #e65100;
}

.vat-row {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid #5a67d8;
}

.total-label {
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.total-label svg {
    width: 16px;
    height: 16px;
}

.total-value {
    font-size: 20px;
    font-weight: bold;
}

.order-code-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 12px 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border: 2px solid #cccccc;
    margin-top: 0;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    gap: 12px;
    height: fit-content;
}

.order-code-label {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.order-code-label svg {
    width: 14px;
    height: 14px;
}

.order-code-input {
    flex: 1;
    max-width: 100%;
    padding: 6px 10px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    background: white;
    color: #333;
    transition: all 0.3s ease;
}

.order-code-input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Rodapé */
.footer {
    background: #000000;
    color: white;
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
}

.footer-top {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: auto;
}

.connection-status-footer {
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.footer-brand {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.footer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.company-name-input-group {
    display: flex;
    align-items: center;
}

.company-name-input {
    padding: 6px 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    min-width: 180px;
    transition: border-color 0.3s ease;
}

.company-name-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.config-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.config-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
}

.config-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.export-pdf-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.export-pdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.export-pdf-btn svg {
    width: 14px;
    height: 14px;
}

.send-email-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.send-email-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.send-email-btn svg {
    width: 16px;
    height: 16px;
}

.clear-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(231, 76, 60, 0.3);
}

.clear-btn svg {
    width: 14px;
    height: 14px;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(231, 76, 60, 0.4);
}

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


.connection-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connection-status button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(76, 175, 80, 0.3);
}

.connection-status button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.4);
}

/* Botão de conexão no topo (antes das dimensões) */
.connection-button-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    padding: 0;
    margin: 0;
    max-width: 100%;
    background: transparent;
    min-height: 0;
}

.connect-button-top {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(76, 175, 80, 0.3);
}

.connect-button-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.4);
}

.connect-button-top:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.connection-status-top {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Área para mostrar foto da moldura */
.frame-image-section {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 0;
}

.frame-image-container {
    width: 125px;
    height: 125px;
    max-width: 125px;
    max-height: 125px;
    min-width: 125px;
    min-height: 125px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex-shrink: 0;
}

.frame-image-container img {
    width: 125px;
    height: 125px;
    max-width: 125px;
    max-height: 125px;
    object-fit: cover;
    display: block;
}

.frame-image-placeholder {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
    font-style: italic;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal de zoom da imagem */
.image-zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000000; /* Maior que o cabeçalho (9999998) */
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-zoom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
    z-index: 10000000;
}

.image-zoom-content {
    position: relative;
    z-index: 10000001; /* Maior que o overlay */
    width: 90vw;
    height: 90vh;
    max-width: 800px;
    max-height: 800px;
    min-width: 200px;
    min-height: 200px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-zoom-content img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    background: white;
}

.image-zoom-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000002; /* Maior que o conteúdo do modal */
    transition: background 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.image-zoom-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Botão Visualizar Molduras */
.view-frames-button-section {
    padding: 10px 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 auto;
}

.view-frames-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.view-frames-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.3);
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
}

.view-frames-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.download-catalog-btn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.download-catalog-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
}

/* Modal de Visualização de Molduras */
.frames-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frames-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.frames-modal-content {
    position: relative;
    z-index: 10001;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.frames-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.frames-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.frames-modal-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

.frames-modal-search {
    padding: 20px 30px;
    border-bottom: 2px solid #e0e0e0;
    position: relative;
    display: flex;
    align-items: center;
}

.frames-modal-search input {
    width: 100%;
    padding: 12px 45px 12px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.frames-modal-search input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.frames-modal-search svg {
    position: absolute;
    right: 45px;
    color: #999;
    pointer-events: none;
}

.frames-modal-filter {
    display: flex;
    gap: 10px;
    padding: 15px 30px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.filter-btn {
    padding: 8px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #f0f0f0;
}

.filter-btn.active {
    background: #667eea;
    color: white;
}

.frames-modal-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.frames-modal-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.frames-modal-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.frames-modal-item.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
}

.frames-modal-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    background: #f5f5f5;
}

.frames-modal-item-number {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.frames-modal-item-placeholder {
    width: 100px;
    height: 100px;
    background: #f5f5f5;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.title {
    font-size: 26px;
    font-weight: bold;
    letter-spacing: 2px;
}

/* Painel de Conexão */
.connection-panel {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-top: 3px solid #2196f3;
    padding: 12px 20px;
    margin-top: 12px;
    display: none;
}

.status-disconnected {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.status-disconnected button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.status-disconnected button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Responsividade */
@media (max-width: 1200px) {
    .table-header,
    .component-row {
        grid-template-columns: 2fr 1.5fr 1fr 1fr 1fr;
        gap: 10px;
        padding: 2px 9px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 5px 3px;
        font-size: 13px;
    }

    .simulator-container {
        margin: 0;
        border-radius: 0;
    }
    
    .header {
        padding: 10px 15px;
    }
    
    .header-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        gap: 8px;
    }
    
    .header-left {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
    }
    
    .header-logo {
        margin-right: 0;
        margin-bottom: 0;
        height: 35px;
    }
    
    .header h1 {
        font-size: 14px;
    }
    
    .header-content .catalog-header-actions {
        margin-left: 0;
        flex: 0 0 auto;
        gap: 6px;
    }
    
    .catalog-back-btn,
    .catalog-logout-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .logo-header {
        font-size: 16px;
        justify-content: center;
    }
    
    .title-header {
        font-size: 16px;
        justify-content: center;
    }
    
    .dimensions-section {
        padding: 10px 12px;
        margin-bottom: 8px;
    }
    
    .dimensions-content {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .dimensions-inputs {
        width: 100%;
        max-width: 100%;
        flex-direction: column;
        gap: 10px;
        order: 1;
        flex: 0 0 100%;
    }
    
    .dimension-row {
        flex-direction: row;
        gap: 6px;
        align-items: stretch;
        width: 100%;
    }
    
    .dimension-label {
        flex: 0 0 calc(50% - 3px);
        width: calc(50% - 3px);
        box-sizing: border-box;
        padding: 8px 12px;
        font-size: 12px;
        min-width: auto;
    }
    
    .dimension-input {
        flex: 0 0 calc(50% - 3px);
        width: calc(50% - 3px);
        box-sizing: border-box;
        padding: 8px 12px;
        min-height: auto;
        height: auto;
    }
    
    .dimension-input input {
        text-align: left;
        width: 100%;
        flex: 1;
        padding: 0;
        font-size: 14px;
        height: auto;
    }
    
    /* Foto e botão lado a lado em mobile */
    .frame-image-section {
        flex: 0 0 calc(63% - 3px);
        width: calc(63% - 3px);
        display: flex;
        justify-content: flex-start;
        align-items: center;
        order: 2;
    }
    
    .frame-image-container {
        width: 63%;
        height: auto;
        max-width: 100%;
        max-height: none;
        min-width: 0;
        min-height: 0;
        aspect-ratio: 1;
        margin: 0;
    }
    
    .frame-image-container img {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: cover;
    }
    
    .view-frames-button-section {
        flex: 0 0 calc(37% - 3px);
        width: calc(37% - 3px);
        padding: 0;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 0;
        flex-wrap: nowrap;
        order: 2;
    }
    
    .view-frames-btn {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        justify-content: center;
        align-items: center;
        font-size: 14px;
        font-weight: 600;
        padding: 16px 8px;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.3;
        text-align: center;
    }
    
    .view-frames-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .image-zoom-content {
        width: 90vw;
        height: 90vw;
        max-width: 800px;
        max-height: 800px;
        min-width: 200px;
        min-height: 200px;
        padding: 10px;
    }
    
    .image-zoom-content img {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
    }
    
    .main-table {
        margin: 3px;
        margin-bottom: 8px;
    }

    .table-header {
        display: none;
    }
    
    .component-row {
        border: 2px solid #667eea;
        margin-bottom: 6px;
        border-radius: 6px;
        padding: 4px;
        gap: 4px;
        background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .component-row .component-label {
        width: 100%;
        flex-basis: 100%;
        order: 1;
    }
    
    .component-row .select-cell {
        width: 100%;
        flex-basis: 100%;
        order: 2;
    }
    
    /* Metro e PVP na mesma linha - cada um com 45% */
    .component-row .metro-cell {
        flex: 0 0 45%;
        order: 3;
        margin-right: 5%;
        max-width: 45%;
        min-width: 0;
    }
    
    .component-row .pvp-cell {
        flex: 0 0 45%;
        order: 3;
        max-width: 45%;
        min-width: 0;
    }
    
    .component-row .total-cell {
        width: 100%;
        flex-basis: 100%;
        order: 4;
    }
    
    .component-label {
        font-weight: bold;
        font-size: 15px;
        color: #333;
        padding: 4px 6px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border-radius: 6px;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 3px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        user-select: none;
    }
    
    .component-label span:first-child {
        flex: 1;
        text-align: center;
    }
    
    .toggle-icon {
        font-size: 18px;
        font-weight: bold;
        line-height: 1;
        min-width: 18px;
        text-align: center;
    }
    
    .component-content {
        width: 100%;
        flex-basis: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
        order: 2;
    }
    
    .component-row.collapsed .component-content {
        display: none;
    }
    
    .component-label .toggle-icon {
        display: block;
    }
    
    .price-cell {
        display: grid;
        grid-template-columns: 90px 1fr;
        align-items: center;
        padding: 4px;
        background: white;
        border-radius: 6px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        gap: 4px;
        width: 100%;
        box-sizing: border-box;
        font-size: 15px;
    }
    
    /* Em mobile, Metro e PVP não devem usar grid, devem usar flex e ficar lado a lado */
    .component-row .metro-cell.price-cell,
    .component-row .pvp-cell.price-cell {
        display: flex !important;
        grid-template-columns: none !important;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 45% !important;
        flex-basis: 45% !important;
    }
    
    .component-row .metro-cell.price-cell {
        margin-right: 5% !important;
    }
    
    .component-row .pvp-cell.price-cell {
        margin-left: auto !important;
    }
    
    .component-row .metro-cell.price-cell::before {
        content: attr(data-label);
        margin-right: auto;
    }
    
    .component-row .pvp-cell.price-cell::before {
        content: attr(data-label);
        margin-right: auto;
    }
    
    .price-cell::before {
        content: attr(data-label);
        font-weight: 600;
        color: #667eea;
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
    
    /* Em desktop, não mostrar o label (já está no header) */
    @media (min-width: 769px) {
        .price-cell::before {
            display: none;
        }
        
        .price-cell {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        /* Garantir que todos os total-cell tenham o mesmo estilo em desktop */
        .total-cell {
            background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%) !important;
            border: 2px solid #4caf50 !important;
            color: #1b5e20 !important;
            box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2) !important;
            font-size: 15px !important;
            font-weight: bold !important;
        }
    }
    
    .price-cell select {
        width: 100%;
        padding: 4px 6px;
        border: 1px solid #ddd;
        border-radius: 6px;
        font-size: 15px;
        background: white;
    }
    
    /* Container para Metro e PVP na mesma linha em mobile */
    .component-row {
        position: relative;
    }
    
    .metro-cell,
    .pvp-cell {
        text-align: right;
        font-weight: 600;
        font-size: 15px;
        width: calc(50% - 7px);
        display: inline-block;
        vertical-align: top;
        box-sizing: border-box;
    }
    
    .metro-cell {
        margin-right: 14px;
    }
    
    /* Criar um wrapper flex para Metro e PVP */
    .component-row::after {
        content: '';
        display: block;
        clear: both;
    }
    
    .total-cell {
        text-align: right;
        font-weight: 600;
        font-size: 15px;
        width: 100%;
        clear: both;
    }
    
    .select-cell {
        padding: 4px;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    
    .metro-cell {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    
    .pvp-cell {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .dimension-input input {
        width: 100%;
    }

    .config-section {
        padding: 10px 12px;
    }

    .config-row {
        flex-direction: column;
        gap: 8px;
    }

    .config-label,
    .config-input {
        width: 100%;
    }

    .totals-section {
        margin: 8px 10px;
        margin-top: 8px;
        gap: 6px;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .total-row {
        padding: 10px 12px;
        font-size: 14px;
        flex-direction: column;
        gap: 6px;
    }
    
    /* Primeiro total-row (TOTAL S/IVA) fica lado a lado com order-code-row */
    .total-row:first-of-type {
        flex: 0 0 calc(50% - 3px);
        width: calc(50% - 3px);
        min-width: 0;
    }
    
    /* TOTAL C/IVA fica numa linha separada, ocupando 100% */
    .total-row.vat-row {
        flex: 0 0 100%;
        width: 100%;
    }
    
    .total-label {
        font-size: 12px;
    }

    .total-value {
        font-size: 20px;
    }
    
    .order-code-row {
        display: flex;
        padding: 10px 12px;
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
        margin: 0;
        max-width: none;
        flex: 0 0 calc(50% - 3px);
        width: calc(50% - 3px);
        min-width: 0;
    }
    
    .order-code-label {
        font-size: 12px;
        width: 100%;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        text-align: left;
        gap: 6px;
    }
    
    .order-code-input {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        text-align: left;
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 12px 15px;
        display: flex;
        position: relative;
    }
    
    .footer-top {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .footer-bottom {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 8px 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        margin-top: auto;
    }
    
    .footer-left {
        justify-content: center;
        text-align: center;
    }
    
    .footer-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .company-name-input-group {
        width: 100%;
        grid-column: 1 / -1;
    }
    
    .company-name-input {
        width: 100%;
        min-width: unset;
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .export-pdf-btn,
    .send-email-btn,
    .clear-btn,
    .config-btn {
        width: 100%;
        justify-content: center;
        padding: 8px 12px;
        font-size: 11px;
    }
    

    .logo-header {
        font-size: 20px;
    }

    .title-header {
        font-size: 16px;
    }

    .title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .dimension-label {
        min-width: auto;
        padding: 8px 10px;
        font-size: 12px;
        flex: 0 0 calc(50% - 3px);
        width: calc(50% - 3px);
        box-sizing: border-box;
    }

    .dimension-input {
        padding: 8px 10px;
        flex: 0 0 calc(50% - 3px);
        width: calc(50% - 3px);
        box-sizing: border-box;
    }
    
    .dimension-input input {
        font-size: 14px;
        padding: 0;
        width: 100%;
        text-align: left;
    }
    
    .dimension-row {
        flex-direction: row;
        gap: 6px;
        align-items: stretch;
        width: 100%;
    }
    
    .dimension-label {
        flex: 0 0 calc(50% - 3px);
        width: calc(50% - 3px);
    }
    
    .dimension-input {
        flex: 0 0 calc(50% - 3px);
        width: calc(50% - 3px);
    }
    
    .frames-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .frames-modal-header {
        padding: 15px 20px;
    }
    
    .frames-modal-header h2 {
        font-size: 20px;
    }
    
        .frames-modal-search {
            padding: 15px 20px;
        }
        
        .frames-modal-filter {
            padding: 12px 20px;
            flex-wrap: wrap;
        }
        
        .filter-btn {
            padding: 8px 16px;
            font-size: 13px;
        }
    
    .frames-modal-list {
        padding: 15px 20px;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .frames-modal-item-image,
    .frames-modal-item-placeholder {
        width: 80px;
        height: 80px;
    }
    
    .frames-modal-item-number {
        font-size: 14px;
    }
    
    .view-frames-button-section {
        padding: 8px 12px;
        justify-content: center;
        flex-direction: row;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .view-frames-btn {
        flex: 1;
        min-width: 120px;
        max-width: 180px;
        justify-content: center;
        font-size: 11px;
        padding: 8px 12px;
    }

    .component-label {
        font-size: 14px;
    }

    .total-row {
        padding: 15px 20px;
        font-size: 14px;
    }

    .total-label {
        font-size: 13px;
    }
    
    .total-value {
        font-size: 22px;
    }
    
    .order-code-row {
        display: flex;
        padding: 12px 15px;
        flex-direction: column;
        gap: 8px;
        align-items: center;
        margin: 15px auto;
        margin-top: 10px;
        max-width: 100%;
    }
    
    .order-code-label {
        font-size: 13px;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        gap: 8px;
    }
    
    .order-code-input {
        font-size: 14px;
        padding: 10px 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
    
    .footer-bottom {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 12px 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        margin-top: 10px;
    }
    
    .price-cell {
        padding: 10px;
        font-size: 13px;
    }
    
    .price-cell select {
        font-size: 13px;
        padding: 8px;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.simulator-container {
    animation: fadeIn 0.5s ease;
}

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

/* Notificações personalizadas */
.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.notification {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 0;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    min-width: 300px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 12px;
}

.notification-icon {
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

.notification-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.notification-close:hover {
    color: #333;
}

.notification-button {
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    margin-left: 8px;
}

.notification-button:hover {
    background: #229954;
}

.notification-error .notification-button {
    background: #e74c3c;
}

.notification-error .notification-button:hover {
    background: #c0392b;
}

.notification-warning .notification-button {
    background: #f39c12;
}

.notification-warning .notification-button:hover {
    background: #e67e22;
}

.notification-info .notification-button {
    background: #3498db;
}

.notification-info .notification-button:hover {
    background: #2980b9;
}

.notification-success {
    border-left: 4px solid #27ae60;
}

.notification-success .notification-icon {
    color: #27ae60;
}

.notification-error {
    border-left: 4px solid #e74c3c;
}

.notification-error .notification-icon {
    color: #e74c3c;
}

.notification-warning {
    border-left: 4px solid #f39c12;
}

.notification-warning .notification-icon {
    color: #f39c12;
}

.notification-info {
    border-left: 4px solid #3498db;
}

.notification-info .notification-icon {
    color: #3498db;
}

/* Caixa de confirmação */
.notification-confirm {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    padding: 0;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
    min-width: 350px;
    border-left: 4px solid #f39c12;
}

.notification-confirm.show {
    opacity: 1;
    transform: scale(1);
}

.confirm-content {
    padding: 20px;
}

.confirm-message {
    font-size: 15px;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.confirm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.confirm-yes {
    background: #e74c3c;
    color: white;
}

.confirm-yes:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.confirm-no {
    background: #6c757d;
    color: white;
}

.confirm-no:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Mobile responsive para notificações */
@media (max-width: 768px) {
    .notifications-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
    
    .notification,
    .notification-confirm {
        min-width: auto;
        width: 100%;
    }
}

.calculating {
    background: #fff3cd !important;
    animation: pulse 1.5s infinite;
}

/* Estados dos inputs */
input:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

input:hover,
select:hover {
    transform: translateY(-1px);
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Loading state */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Order Confirmation Modal */
.order-confirmation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.order-confirmation-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1000001;
    overflow: hidden;
}

.order-confirmation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 2px solid #e0e0e0;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.order-confirmation-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.order-confirmation-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.order-confirmation-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.order-confirmation-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Compact order confirmation styles */
.order-confirmation-details-compact {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-header-compact {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.order-frame-image-compact {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 6px;
    overflow: hidden;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-frame-image-compact img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-header-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.order-header-label {
    font-weight: 500;
    color: #666;
    font-size: 13px;
    min-width: 80px;
}

.order-header-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.order-components-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.order-component-compact {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    font-size: 13px;
}

.order-component-compact .component-name {
    font-weight: 600;
    color: #2c3e50;
    min-width: 100px;
}

.order-component-compact .component-ref {
    flex: 1;
    color: #666;
}

.order-component-compact .component-total {
    font-weight: 600;
    color: #27ae60;
    text-align: right;
    min-width: 80px;
}

.order-totals-compact {
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    border-left: 4px solid #27ae60;
}

.order-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
}

.order-total-row:first-child {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
    margin-bottom: 8px;
}

.order-total-row span:first-child {
    color: #666;
    font-weight: 500;
}

.order-total-row span:last-child {
    font-weight: 600;
    color: #2c3e50;
}

.order-total-row.order-total-highlight span:last-child {
    color: #27ae60;
    font-size: 16px;
}

.order-email-notice {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 16px;
    background: #e8f5e9;
    border-radius: 6px;
    border-left: 4px solid #4caf50;
    font-size: 13px;
    color: #2c3e50;
}

.order-email-notice svg {
    flex-shrink: 0;
    color: #4caf50;
}

.order-confirmation-contact-compact {
    margin-bottom: 12px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #3498db;
}

.order-confirmation-contact-compact p {
    margin: 0;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.order-confirmation-contact-compact a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.order-confirmation-contact-compact a:hover {
    text-decoration: underline;
}

.order-confirmation-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.order-detail-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #3498db;
}

.order-detail-section h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
}

.order-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.order-detail-row:last-child {
    border-bottom: none;
}

.order-detail-label {
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.order-detail-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    text-align: right;
}

.order-total-highlight {
    color: #27ae60;
    font-size: 18px;
}

.order-components-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-component-item {
    background: white;
    border-radius: 6px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    transition: box-shadow 0.2s;
}

.order-component-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.order-component-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-component-header strong {
    color: #2c3e50;
    font-size: 15px;
}

.order-component-total {
    font-weight: 600;
    color: #27ae60;
    font-size: 16px;
}

.order-component-details {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #666;
}

.order-component-details span {
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 4px;
}

.order-totals-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left-color: #27ae60;
}

.order-confirmation-footer {
    padding: 16px 20px;
    border-top: 2px solid #e0e0e0;
    background: #f8f9fa;
}

.order-confirmation-contact {
    margin-bottom: 20px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.order-confirmation-contact p {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.order-confirmation-contact a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.order-confirmation-contact a:hover {
    text-decoration: underline;
}

.order-confirmation-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.order-confirmation-cancel,
.order-confirmation-confirm {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-confirmation-cancel {
    background: #e0e0e0;
    color: #555;
}

.order-confirmation-cancel:hover {
    background: #d0d0d0;
}

.order-confirmation-confirm {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.order-confirmation-confirm:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
    box-shadow: 0 6px 16px rgba(39, 174, 96, 0.4);
    transform: translateY(-1px);
}

.order-confirmation-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 768px) {
    .order-confirmation-content {
        max-width: 100%;
        max-height: 95vh;
        margin: 10px;
    }
    
    .order-confirmation-header {
        padding: 16px;
    }
    
    .order-confirmation-header h2 {
        font-size: 18px;
    }
    
    .order-confirmation-body {
        padding: 16px;
    }
    
    .order-header-compact {
        flex-direction: column;
        align-items: center;
    }
    
    .order-frame-image-compact {
        width: 80px;
        height: 80px;
    }
    
    .order-header-info {
        width: 100%;
        text-align: center;
    }
    
    .order-header-row {
        justify-content: space-between;
    }
    
    .order-component-compact {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .order-component-compact .component-total {
        text-align: left;
        width: 100%;
    }
    
    .order-confirmation-footer {
        padding: 16px;
    }
    
    .order-confirmation-actions {
        flex-direction: column;
    }
    
    .order-confirmation-cancel,
    .order-confirmation-confirm {
        width: 100%;
        justify-content: center;
    }
    
    .order-detail-section {
        padding: 16px;
    }
    
    .order-detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .order-detail-value {
        text-align: left;
    }
}
