/*
 * Aços América - Custom Styles
 * Complemento ao Tailwind CSS
 */

/* ============================================
   SMOOTH SCROLLING
   ============================================ */
html {
    scroll-behavior: smooth;
}

/* ============================================
   FONTS
   ============================================ */
/*
 * Nota: Adicionar @font-face para a fonte ALLER quando disponível
 * Exemplo:
 * @font-face {
 *   font-family: 'ALLER';
 *   src: url('../assets/fonts/Aller-Regular.woff2') format('woff2');
 *   font-weight: 400;
 *   font-style: normal;
 *   font-display: swap;
 * }
 */

/* ============================================
   PRODUCT CARDS - ANIMAÇÕES
   ============================================ */
.product-card-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
}

.product-card-content.active {
    max-height: 2200px; /* Altura máxima generosa */
}

.product-card-icon {
    transition: transform 0.3s ease-in-out;
}

.product-card-icon.rotated {
    transform: rotate(180deg);
}

/* ============================================
   SIDEBAR - MOBILE
   ============================================ */
#sidebar.active {
    display: block !important;
}

/* ============================================
   CATEGORY LINKS - ACTIVE STATE
   ============================================ */
.category-link.active {
    background-color: #F9F9F9;
    border-left-color: #E20F18;
}

.category-link.active .font-bold {
    color: #E20F18;
}

/* ============================================
   SCROLL OFFSET (para âncoras com header fixo)
   ============================================ */
.scroll-mt-24 {
    scroll-margin-top: 6rem;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */
.hover-lift {
    transition: transform 0.2s ease-in-out;
}

.hover-lift:hover {
    transform: translateY(-4px);
}

/* ============================================
   TABELAS RESPONSIVAS
   ============================================ */
/* Espaço extra para tabelas largas não cobrirem CTAs */
.product-card-content .overflow-x-auto {
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.product-card-content .overflow-x-auto::-webkit-scrollbar {
    height: 8px;
}

.product-card-content .overflow-x-auto::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.product-card-content .overflow-x-auto::-webkit-scrollbar-thumb {
    background: #7A7A7A;
    border-radius: 4px;
}

.product-card-content .overflow-x-auto::-webkit-scrollbar-thumb:hover {
    background: #E20F18;
}

.product-card-content table thead th {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #1D1D1B;
}

.product-card-content table thead th:first-child {
    left: 0;
    z-index: 40;
}

.product-card-content table thead tr:nth-child(2) th {
    background: #333333;
}

.product-card-content table tbody td:first-child,
.product-card-content table thead th:first-child {
    position: sticky;
    left: 0;
}

.product-card-content table tbody td:first-child {
    z-index: 25;
    background: linear-gradient(90deg, #ffffff 0%, #f3f3f3 100%);
    font-weight: 600;
    color: #1D1D1B;
    box-shadow: 8px 0 12px rgba(0, 0, 0, 0.06);
    border-right: 1px solid #e5e7eb;
}

.product-card-content table tbody tr:nth-child(even) td:first-child {
    background: linear-gradient(90deg, #f9f9f9 0%, #f1f1f1 100%);
}

@media (max-width: 768px) {
    table {
        font-size: 12px;
    }

    table th,
    table td {
        padding: 8px !important;
    }
}

/* ============================================
   LOADING SPINNER (para formulário)
   ============================================ */
.spinner {
    border: 3px solid #F9F9F9;
    border-top: 3px solid #E20F18;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   FORM VALIDATION STATES
   ============================================ */
input:invalid:focus,
textarea:invalid:focus,
select:invalid:focus {
    border-color: #E20F18;
    box-shadow: 0 0 0 3px rgba(226, 15, 24, 0.1);
}

input:valid:focus,
textarea:valid:focus,
select:valid:focus {
    border-color: #E20F18;
    box-shadow: 0 0 0 3px rgba(226, 15, 24, 0.1);
}

/* ============================================
   UTILITIES
   ============================================ */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    header,
    footer,
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
/* Focus visible para navegação por teclado */
*:focus-visible {
    outline: 2px solid #E20F18;
    outline-offset: 2px;
}

/* Skip to content link (acessibilidade) */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #E20F18;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #F9F9F9;
}

::-webkit-scrollbar-thumb {
    background: #7A7A7A;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #E20F18;
}
