/* WTA Catálogo - Estilos Principais */

/* Variáveis */
:root {
    --wta-primary: #991b1b;
    --wta-primary-dark: #7f1d1d;
    --wta-primary-light: #dc2626;
    --wta-secondary: #f3f4f6;
    --wta-text: #1f2937;
    --wta-text-light: #6b7280;
    --wta-border: #e5e7eb;
    --wta-white: #ffffff;
    --wta-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --wta-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --wta-radius: 0.5rem;
    --wta-radius-lg: 1rem;
}

/* Container Principal */
.wta-catalogo-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-areas:
        "header header"
        "sidebar main";
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.wta-catalogo-header {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--wta-white);
    border-radius: var(--wta-radius-lg);
    box-shadow: var(--wta-shadow);
    flex-wrap: wrap;
    gap: 1rem;
}

.wta-header-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wta-header-logo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.wta-header-logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--wta-text);
    margin: 0;
}

.wta-header-logo p {
    font-size: 0.75rem;
    color: var(--wta-text-light);
    margin: 0;
}

.wta-header-search {
    flex: 1;
    max-width: 500px;
    display: flex;
    position: relative;
}

.wta-header-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 3rem;
    border: 1px solid var(--wta-border);
    border-radius: var(--wta-radius);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.wta-header-search input:focus {
    outline: none;
    border-color: var(--wta-primary);
}

.wta-header-search button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.25rem;
}

.wta-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wta-btn-cart {
    position: relative;
    background: var(--wta-secondary);
    border: none;
    padding: 0.75rem;
    border-radius: var(--wta-radius);
    cursor: pointer;
    font-size: 1.25rem;
    transition: background 0.2s;
}

.wta-btn-cart:hover {
    background: var(--wta-border);
}

.wta-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--wta-primary);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wta-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--wta-text);
}

.wta-btn-logout {
    color: var(--wta-primary);
    text-decoration: none;
    font-weight: 500;
}

.wta-btn-logout:hover {
    text-decoration: underline;
}

/* Sidebar */
.wta-catalogo-sidebar {
    grid-area: sidebar;
    background: var(--wta-white);
    border-radius: var(--wta-radius-lg);
    box-shadow: var(--wta-shadow);
    padding: 1.5rem;
    height: fit-content;
}

.wta-catalogo-sidebar h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--wta-text);
}

.wta-categorias-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wta-categorias-menu li {
    margin-bottom: 0.25rem;
}

.wta-categoria-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    border-radius: var(--wta-radius);
    color: var(--wta-text);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.wta-categoria-link:hover,
.wta-categoria-link.active {
    background: var(--wta-primary);
    color: white;
}

.wta-categoria-link span {
    background: var(--wta-secondary);
    color: var(--wta-text);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
}

.wta-categoria-link.active span,
.wta-categoria-link:hover span {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Main Content */
.wta-catalogo-main {
    grid-area: main;
}

.wta-results-info {
    margin-bottom: 1rem;
}

.wta-results-info p {
    color: var(--wta-text-light);
    font-size: 0.875rem;
}

/* Grid de Produtos */
.wta-produtos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.wta-produtos-grid.wta-col-2 {
    grid-template-columns: repeat(2, 1fr);
}

.wta-produtos-grid.wta-col-3 {
    grid-template-columns: repeat(3, 1fr);
}

.wta-produtos-grid.wta-col-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Card de Produto */
.wta-produto-card {
    background: var(--wta-white);
    border-radius: var(--wta-radius-lg);
    box-shadow: var(--wta-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.wta-produto-card:hover {
    box-shadow: var(--wta-shadow-lg);
}

.wta-produto-imagem {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--wta-secondary);
    cursor: pointer;
}

.wta-produto-imagem img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.wta-produto-card:hover .wta-produto-imagem img {
    transform: scale(1.05);
}

.wta-produto-info {
    padding: 1rem;
}

.wta-produto-categoria {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--wta-text-light);
    border: 1px solid var(--wta-border);
    padding: 0.25rem 0.5rem;
    border-radius: var(--wta-radius);
    margin-bottom: 0.5rem;
}

.wta-produto-titulo {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--wta-text);
    margin: 0 0 0.25rem 0;
    line-height: 1.4;
    cursor: pointer;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wta-produto-titulo:hover {
    color: var(--wta-primary);
}

.wta-produto-codigo {
    font-size: 0.75rem;
    color: var(--wta-text-light);
    margin: 0 0 0.5rem 0;
}

.wta-produto-preco {
    font-size: 1rem;
    font-weight: 700;
    color: var(--wta-primary);
    margin: 0 0 0.75rem 0;
}

.wta-btn-adicionar {
    width: 100%;
    padding: 0.625rem;
    background: var(--wta-primary);
    color: white;
    border: none;
    border-radius: var(--wta-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.wta-btn-adicionar:hover {
    background: var(--wta-primary-dark);
}

/* Login Form */
.wta-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--wta-primary) 0%, var(--wta-primary-dark) 100%);
    padding: 2rem;
}

.wta-login-box {
    width: 100%;
    max-width: 420px;
    background: var(--wta-white);
    border-radius: var(--wta-radius-lg);
    box-shadow: var(--wta-shadow-lg);
    padding: 2.5rem;
}

.wta-login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.wta-login-logo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--wta-white);
    box-shadow: var(--wta-shadow);
    margin-bottom: 1rem;
}

.wta-login-logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--wta-text);
    margin: 0 0 0.25rem 0;
}

.wta-login-logo p {
    font-size: 0.875rem;
    color: var(--wta-text-light);
    margin: 0;
}

.wta-login-form {
    margin-bottom: 1.5rem;
}

.wta-form-group {
    margin-bottom: 1rem;
}

.wta-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--wta-text);
    margin-bottom: 0.375rem;
}

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

.wta-input-icon {
    position: absolute;
    left: 0.875rem;
    font-size: 1rem;
}

.wta-input-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-left: 2.5rem;
    border: 1px solid var(--wta-border);
    border-radius: var(--wta-radius);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.wta-input-wrapper input:focus {
    outline: none;
    border-color: var(--wta-primary);
}

.wta-toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
}

.wta-btn-login {
    width: 100%;
    padding: 0.875rem;
    background: var(--wta-primary);
    color: white;
    border: none;
    border-radius: var(--wta-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.wta-btn-login:hover {
    background: var(--wta-primary-dark);
}

#wta-login-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--wta-radius);
    font-size: 0.875rem;
    display: none;
}

#wta-login-message.error {
    background: #fee2e2;
    color: #991b1b;
    display: block;
}

#wta-login-message.success {
    background: #d1fae5;
    color: #065f46;
    display: block;
}

.wta-login-demo {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--wta-border);
}

.wta-login-demo p {
    font-size: 0.75rem;
    color: var(--wta-text-light);
    margin: 0 0 0.5rem 0;
}

.wta-login-demo code {
    display: inline-block;
    background: var(--wta-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--wta-radius);
    font-size: 0.75rem;
    color: var(--wta-text);
    margin: 0.125rem;
    font-family: monospace;
}

/* Modal */
.wta-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.wta-modal.active {
    display: flex;
}

.wta-modal-content {
    background: var(--wta-white);
    border-radius: var(--wta-radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.wta-modal-content.wta-modal-large {
    max-width: 800px;
}

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

.wta-modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.wta-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--wta-text-light);
    line-height: 1;
}

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

.wta-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.wta-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--wta-border);
}

.wta-btn-quote {
    width: 100%;
    padding: 0.875rem;
    background: var(--wta-primary);
    color: white;
    border: none;
    border-radius: var(--wta-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.wta-btn-quote:hover {
    background: var(--wta-primary-dark);
}

/* Carrinho */
.wta-cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--wta-secondary);
    border-radius: var(--wta-radius);
    margin-bottom: 0.75rem;
}

.wta-cart-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--wta-radius);
}

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

.wta-cart-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wta-cart-item-code {
    font-size: 0.75rem;
    color: var(--wta-text-light);
    margin: 0;
}

.wta-cart-item-remove {
    background: none;
    border: none;
    color: var(--wta-text-light);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
}

.wta-cart-item-remove:hover {
    color: var(--wta-primary);
}

.wta-empty-cart {
    text-align: center;
    color: var(--wta-text-light);
    padding: 2rem;
}

/* Detalhes do Produto no Modal */
.wta-product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.wta-product-detail-image {
    aspect-ratio: 1;
    background: var(--wta-secondary);
    border-radius: var(--wta-radius);
    overflow: hidden;
}

.wta-product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wta-product-detail-info h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.wta-product-detail-desc {
    font-size: 0.875rem;
    color: var(--wta-text-light);
    margin-bottom: 1rem;
}

.wta-product-detail-meta {
    margin-bottom: 1rem;
}

.wta-product-detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
}

.wta-product-detail-meta-item span:first-child {
    color: var(--wta-text-light);
}

.wta-product-detail-prices {
    margin-bottom: 1rem;
}

.wta-product-detail-prices h5 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.wta-price-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.wta-price-item {
    background: var(--wta-secondary);
    padding: 0.5rem;
    border-radius: var(--wta-radius);
}

.wta-price-item-label {
    font-size: 0.625rem;
    color: var(--wta-text-light);
    text-transform: uppercase;
}

.wta-price-item-value {
    font-size: 0.875rem;
    font-weight: 600;
}

/* Categorias Shortcode */
.wta-categorias-container {
    background: var(--wta-white);
    padding: 1.5rem;
    border-radius: var(--wta-radius-lg);
    box-shadow: var(--wta-shadow);
}

.wta-categorias-container h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.wta-categorias-lista {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wta-categorias-lista li {
    margin-bottom: 0.5rem;
}

.wta-categorias-lista a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--wta-radius);
    color: var(--wta-text);
    text-decoration: none;
    transition: background 0.2s;
}

.wta-categorias-lista a:hover {
    background: var(--wta-secondary);
}

.wta-categorias-lista img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--wta-radius);
}

/* No Results */
.wta-no-results {
    text-align: center;
    padding: 3rem;
    color: var(--wta-text-light);
    grid-column: 1 / -1;
}

/* Responsivo */
@media (max-width: 1024px) {
    .wta-catalogo-container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main";
    }
    
    .wta-catalogo-sidebar {
        display: none;
    }
    
    .wta-produtos-grid.wta-col-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .wta-catalogo-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wta-header-search {
        max-width: none;
        order: 3;
    }
    
    .wta-header-actions {
        justify-content: space-between;
    }
    
    .wta-produtos-grid,
    .wta-produtos-grid.wta-col-3,
    .wta-produtos-grid.wta-col-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wta-product-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .wta-produtos-grid,
    .wta-produtos-grid.wta-col-2,
    .wta-produtos-grid.wta-col-3,
    .wta-produtos-grid.wta-col-4 {
        grid-template-columns: 1fr;
    }
    
    .wta-login-box {
        padding: 1.5rem;
    }
    
    .wta-modal-content {
        max-height: 95vh;
    }
}

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

.wta-produto-card {
    animation: wta-fade-in 0.3s ease-out;
}

/* Loading */
.wta-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.wta-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid var(--wta-border);
    border-top-color: var(--wta-primary);
    border-radius: 50%;
    animation: wta-spin 1s linear infinite;
}

@keyframes wta-spin {
    to {
        transform: rotate(360deg);
    }
}
