/* ============================================
   Manufacturer Grid Shortcode Styles
   File: css/manufacturer-styles.css
   WCAG 2.1 AA Compliant
   ============================================ */

/* === Screen Reader Only === */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === Manufacturers Section === */
.manufacturers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Grid Columns Based on Data Attribute */
/* === Manufacturer Card === */

.columns-wrapper {
    padding: 0 !important;
    margin: unset;
    max-width: 100%;
}

.manufacturer-card {
    background: #F5F5F5;
    border: 1px solid #A82C23;
    border-radius: 8px;
    padding: 28px;
}

/* === Manufacturer Image === */
.manufacturer-image {
    margin-bottom: 46px;
    text-align: center;
}

.manufacturer-image img {
    width: 100%;
    max-width: 460px;
    height: 150px;
    object-fit: contain;
}

.manufacturer-action {
    margin-top: 20px;
}

/* === Manufacturer Content === */

.manufacturer-title {
    font-size: 28px !important;
    line-height: 32px;
    font-weight: 600;
    color: #232323;
    margin-bottom: 12px;
    padding: 0;
}

.manufacturer-meta {
    font-size: 14px;
    color: #666666;
    margin: 0 0 8px 0;
}

.product-count {
    font-weight: 600;
    color: #0073aa;
}

.manufacturer-description {
    font-size: 14px;
    color: #666666;
    line-height: 1.5;
    margin: 8px 0 0 0;
}

/* === Manufacturer Action === */
.manufacturer-cta:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.cta-icon {
    font-size: 18px;
    line-height: 1;
    transition: transform 0.3s ease;
}

.manufacturer-cta:hover .cta-icon {
    transform: translateX(4px);
}

/* === No Manufacturers Message === */
.no-manufacturers {
    text-align: center;
    padding: 40px 20px;
    color: #666666;
    font-size: 16px;
}

/* === Project Modal Styles === */
.project-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.project-modal[hidden] {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4.25px);
}

.modal-container {
    position: relative;
    background: #fff;
    width: 90%;
    padding: 20px;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 8px;
    transform: translate(-50%, -50%);
    left: 50%;
    top: 50%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

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

/* === Modal Header === */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h2.modal-title {
    font-size: 28px !important;
    line-height: 32px;
    font-weight: 600;
    color: #343434;
}

/* === Modal Body === */

.modal-description {
    color: #8D8D8D;
    margin: 0 0 24px 0;
    font-size: 16px;
}

.modal-description a {
    color: #A82C23 !important;
}

/* === Project Form === */
.project-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group{
    display: flex;
    flex-direction: column;
}

/* File Upload Section Toggle */
.form-group-full {
    overflow: hidden;
    transition: opacity 0.3s ease !important;
}
/*
.form-group-full[aria-hidden="true"] {
    opacity: 0;
    pointer-events: none;
}
*/

.form-group-full[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
}

/* Optional: Add visual indication when section appears */
.form-group-full.tax-exempt-files {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px dashed #0066cc;
    margin-top: 20px;
}

/* Highlight effect when shown */
@keyframes highlightSection {
    0% { background-color: #e3f2fd; }
    100% { background-color: #f8f9fa; }
}

.form-group-full.tax-exempt-files.just-shown {
    animation: highlightSection 1s ease;
}

.form-label,
legend.form-label {
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    display: block;
}

legend.form-label {
    padding: 0;
    margin: 0 0 8px 0;
}

.form-label abbr {
    color: #dc3545;
    text-decoration: none;
    font-weight: 700;
}

.form-control {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 16px;
    color: #333333;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus-visible {
    outline: 2px solid #000;
}

.form-control[readonly] {
    background: #f5f5f5 !important;
    color: #666 !important;
    cursor: not-allowed;
}

.form-control:invalid {
    border-color: #dc3545;
}

.form-help {
    font-size: 13px;
    color: #666666;
    margin: 0;
}

.error-message {
    font-size: 13px;
    color: #dc3545;
    font-weight: 600;
    margin: 0;
    display: block;
}

.optional {
    font-weight: 400;
    color: #666666;
}

/* === Radio Group === */
.radio-group {
    display: flex;
    gap: 24px;
    padding: 8px 0;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.radio-item input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #0073aa;
}

.radio-item label {
    font-size: 16px;
    color: #333333;
    cursor: pointer;
    font-weight: 400;
}

.radio-item input[type="radio"]:focus-visible {
    outline: 2px solid #000;
    outline-offset: 1px;
}

/* === File Upload === */
.file-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 8px;
}

.file-upload-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    border: 2px dashed #0073aa;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease;
    min-height: 100px;
}

.file-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-upload-icon {
    font-size: 24px;
}

.file-upload-text {
    font-size: 14px;
    font-weight: 600;
    color: #0073aa;
    text-align: center;
}

.file-name {
    font-size: 12px;
    color: #666666;
    text-align: center;
    word-break: break-all;
    margin: 0;
    min-height: 18px;
}

/* Remove File Button */
.remove-file-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background-color 0.2s;
}
.remove-file-btn:hover {
    background: #bb2d3b;
}
.remove-file-btn:focus {
    outline: 2px solid #dc3545;
    outline-offset: 2px;
}

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

/* === Loading Overlay === */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10002;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.loading-overlay[hidden] {
    display: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .manufacturers-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .manufacturer-card {
        padding: 20px;
    }
    
    .modal-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .file-upload-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-footer {
        flex-direction: column-reverse;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .manufacturer-image {
        margin-bottom: 20px;
    }
    .manufacturer-image img {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .radio-group {
        flex-direction: column;
        gap: 12px;
    }
}

/* === High Contrast Mode === */
@media (prefers-contrast: high) {
    .manufacturer-card,
    .form-control,
    .file-upload-label {
        border-width: 3px;
    }
    
    .manufacturer-cta,
    .btn {
        border: 2px solid currentColor;
    }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}