:root {
    --primary-red-color: #CC0000;
    --primary-red-light: #ffeaea;
    --primary-red-dark: #990000;
    --dark-color: #343a40;
    --light-gray: #f8f9fa;
    --lighter-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #6c757d;
    --border-radius: 12px;
}

/* Hero — now uses global .news-hero from style.css */

/* Form Section Backgrounds - Updated to red/grey */
.inquiry-section {
    background: var(--lighter-gray) !important;
    border-left: 4px solid var(--primary-red-color);
}

.submit-section {
    background: var(--medium-gray) !important;
    border: 1px solid #dee2e6;
}

.factory-info-section {
    background: white !important;
    border-left: 4px solid var(--primary-red-color);
}

.departments-subsection {
    background: var(--light-gray) !important;
    border-left: 4px solid var(--primary-red-color);
}

.contact-sidebar.bg-light {
    background: var(--light-gray) !important;
}

/* Enhanced existing styles with better section separation */
.contact-section {
    padding: 0;
}

/* Override Bootstrap danger → brand red */
.contact-section .bg-danger                    { background-color: #CC0000 !important; }
.contact-section .text-danger                  { color: #CC0000 !important; }
.contact-section .border-danger                { border-color: #CC0000 !important; }
.contact-section .btn-danger                   { background-color: #CC0000 !important; border-color: #990000 !important; }
.contact-section .btn-danger:hover,
.contact-section .btn-danger:focus             { background-color: #990000 !important; border-color: #770000 !important; }
.contact-section .btn-outline-danger           { color: #CC0000 !important; border-color: #CC0000 !important; }
.contact-section .btn-outline-danger:hover     { background-color: #CC0000 !important; color: #fff !important; }
.contact-section .spinner-border.text-danger   { color: #CC0000 !important; }

.contact-hero.compact-hero {
    padding: 4rem 0;
    margin-bottom: 0;
    border-radius: 0;
}

.contact-content.bg-light {
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--light-gray) 0%, var(--medium-gray) 100%) !important;
}

/* Form Styles - Updated colors */
.modern-form .form-section-title {
    font-weight: 600;
    border-bottom: 2px solid var(--medium-gray);
    padding-bottom: 0.5rem;
    color: var(--dark-color);
}

.form-section-title.text-primary {
    color: var(--primary-red-color) !important;
    border-left: 4px solid var(--primary-red-color);
    padding-left: 10px;
}

.form-section-title.text-danger {
    color: var(--dark-color) !important;
    border-left: 4px solid var(--primary-red-color);
    padding-left: 10px;
    border-bottom: none;
}

.form-section-title.text-success {
    color: var(--primary-red-color) !important;
    border-left: 4px solid var(--primary-red-color);
    padding-left: 10px;
}

.form-section-title.text-info {
    color: var(--primary-red-color) !important;
    border-left: 4px solid var(--primary-red-color);
    padding-left: 10px;
}

.form-floating {
    position: relative;
    margin-bottom: 1rem;
}

.form-floating label {
    color: var(--dark-gray);
    font-weight: 500;
}

.contact-section .form-control,
.contact-section .form-select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.contact-section .form-control:focus,
.contact-section .form-select:focus {
    border-color: #CC0000;
    box-shadow: 0 0 0 3px rgba(204,0,0,0.1);
    outline: none;
}

/* ==================== RADIO BUTTON STYLING ==================== */
.card-radio {
    margin-bottom: 0;
    height: 100%;
    padding-left: 0;
}

.radio-card {
    border: 2px solid var(--medium-gray);
    border-radius: 15px;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 180px;
    height: 100%;
    position: relative;
}

.radio-card:hover {
    border-color: var(--primary-red-color);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.1);
    transform: translateY(-2px);
}

/* Selected state with red border */
.card-radio input[type="radio"]:checked + label .radio-card {
    border-color: var(--primary-red-color);
    background: linear-gradient(135deg, var(--primary-red-light) 0%, #ffffff 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.15);
}

/* Selection indicator - Updated to red */
.selection-indicator {
    transition: all 0.3s ease;
    position: absolute;
    top: 8px;
    right: 8px;
}

.card-radio input[type="radio"]:checked + label .selection-indicator i {
    opacity: 1 !important;
    transform: scale(1.1);
    color: var(--primary-red-color) !important;
}

/* Radio icon styling */
.radio-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-red-color) 0%, var(--primary-red-dark) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.card-radio input[type="radio"]:checked + label .radio-icon {
    background: linear-gradient(135deg, var(--primary-red-dark) 0%, #8b0000 100%);
    transform: scale(1.05);
}

/* Radio content styling */
.radio-content .radio-title {
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
    transition: all 0.3s ease;
    display: block;
    white-space: normal;
    word-wrap: break-word;
}

.card-radio input[type="radio"]:checked + label .radio-title {
    color: var(--primary-red-color);
    font-weight: 700;
}

.radio-subtitle {
    color: var(--dark-gray);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
    white-space: normal;
    word-wrap: break-word;
}

/* Hidden radio button that covers entire card */
.card-radio input[type="radio"] {
    opacity: 0;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

/* Form check label should cover entire area */
.card-radio .form-check-label {
    width: 100%;
    margin-bottom: 0;
    cursor: pointer;
    position: relative;
}

/* Focus state for accessibility */
.card-radio input[type="radio"]:focus + label .radio-card {
    outline: 2px solid var(--primary-red-color);
    outline-offset: 2px;
}

/* Active state when clicking */
.card-radio input[type="radio"]:active + label .radio-card {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

/* Ensure proper spacing in department radios grid */
.department-radios .row.g-3 {
    align-items: stretch;
}

.department-radios .col-md-6.col-lg-3 {
    display: flex;
}

.department-radios .card-radio {
    flex: 1;
    display: flex;
    flex-direction: column;
}
/* ==================== END RADIO BUTTON STYLING ==================== */

/* Factory Information Section */
.factory-info-section {
    border-left: 4px solid var(--primary-red-color);
}

.info-item {
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item i {
    background: linear-gradient(135deg, var(--primary-red-color) 0%, var(--primary-red-dark) 100%);
    border-radius: 8px;
    color: white;
    padding: 10px;
}

/* Departments Subsection */
.departments-subsection {
    border: 1px solid var(--medium-gray);
}

.department-item {
    transition: all 0.3s ease;
    border: 1px solid transparent;
    background: white;
}

.department-item:hover {
    transform: translateX(5px);
    border-color: var(--primary-red-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.department-item i {
    background: linear-gradient(135deg, var(--primary-red-color) 0%, var(--primary-red-dark) 100%);
    border-radius: 8px;
    color: white;
    padding: 12px;
}

/* reCAPTCHA Styling */
.recaptcha-container {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid var(--medium-gray);
}

/* Submit Button */
.submit-container .btn {
    background: linear-gradient(135deg, var(--primary-red-color) 0%, var(--primary-red-dark) 100%);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 200px;
    padding: 0.75rem 2rem;
    color: white;
}

.submit-container .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
    background: linear-gradient(135deg, var(--primary-red-dark) 0%, #8b0000 100%);
}

/* Quick Cards in Sidebar */
.contact-sidebar .quick-card {
    border-radius: 15px;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    margin-bottom: 1rem;
    background: white;
}

.contact-sidebar .quick-card:last-child {
    margin-bottom: 0;
}

.contact-sidebar .quick-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.contact-sidebar .quick-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.contact-sidebar .quick-card .btn {
    margin-top: auto;
}

/* Sidebar Cards */
.contact-sidebar .info-card {
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 1.5rem;
    background: white;
}

.contact-sidebar .info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.contact-sidebar .info-card:last-child {
    margin-bottom: 0;
}

/* Card Header Colors - Updated to red theme */
.card-header.bg-primary { 
    background: linear-gradient(135deg, var(--primary-red-color) 0%, var(--primary-red-dark) 100%) !important; 
    border: none;
}

.card-header.bg-success { 
    background: linear-gradient(135deg, #495057 0%, var(--dark-color) 100%) !important; 
    border: none;
}

/* Distribution Centers */
.distribution-centers .center-item {
    transition: all 0.3s ease;
    background: var(--light-gray) !important;
}

.distribution-centers .center-item:hover {
    background: var(--medium-gray) !important;
}

.distribution-centers .fw-bold.text-success {
    color: var(--primary-red-color) !important;
}

/* Card improvements for better contrast */
.card {
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

/* Better spacing between sections */
.factory-info-section,
.contact-sidebar {
    margin-bottom: 2rem;
}

/* Enhanced department items with better background contrast */
.department-item {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.department-item:hover {
    transform: translateX(5px);
    border-color: var(--primary-red-color);
}

/* Smooth transitions for background changes */
.contact-section > * {
    transition: background-color 0.5s ease;
}

.hover-red:hover {
    background-color: var(--primary-red-color) !important;
    color: white !important;
}

/* WhatsApp Button Styling */
.btn.btn-outline-red.btn-sm.border.border-danger.text-danger.hover-red {
    background-color: white !important;
    color: var(--primary-red-color) !important;
    border: 2px solid var(--primary-red-color) !important;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    margin-top: 0.5rem;
}

.btn.btn-outline-red.btn-sm.border.border-danger.text-danger.hover-red:hover {
    background-color: var(--primary-red-color) !important;
    color: white !important;
    border-color: var(--primary-red-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    text-decoration: none;
}

/* WhatsApp icon specific styling */
.btn.btn-outline-red.btn-sm.border.border-danger.text-danger.hover-red .fab.fa-whatsapp {
    font-size: 1.1em;
    transition: transform 0.3s ease;
    color: var(--primary-red-color);
}

.btn.btn-outline-red.btn-sm.border.border-danger.text-danger.hover-red:hover .fab.fa-whatsapp {
    transform: scale(1.1);
    color: white !important;
}

/* Phone Number Button Styling */
.quick-card .btn-danger.btn-sm {
    background: linear-gradient(135deg, var(--primary-red-color) 0%, var(--primary-red-dark) 100%) !important;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.quick-card .btn-danger.btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
    background: linear-gradient(135deg, var(--primary-red-dark) 0%, #8b0000 100%) !important;
}

.quick-card .btn-danger.btn-sm .fas.fa-phone {
    margin-right: 0.5rem;
}

/* Quick Card Layout Improvements */
.quick-card .card-body {
    padding: 1.5rem !important;
}

.quick-card .d-grid.gap-2 {
    gap: 0.75rem !important;
}

/* Ensure proper spacing in the action cards */
.quick-card .card-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.quick-card .text-muted.small {
    font-size: 0.8rem;
    margin-bottom: 1rem;
    color: var(--dark-gray);
}

/* Focus states for accessibility */
.btn.btn-outline-red.btn-sm.border.border-danger.text-danger.hover-red:focus,
.quick-card .btn-danger.btn-sm:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Active state */
.btn.btn-outline-red.btn-sm.border.border-danger.text-danger.hover-red:active,
.quick-card .btn-danger.btn-sm:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(220, 53, 69, 0.3);
}

/* Animation enhancements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.contact-form .form-floating,
.department-radios .card-radio,
.quick-card,
.factory-info-section,
.contact-sidebar > * {
    animation: fadeInUp 0.6s ease forwards;
}

.departments-subsection {
    animation: fadeInUp 0.8s ease forwards;
}

/* Staggered animations for better visual flow */
.contact-form .form-floating { animation-delay: 0.1s; }
.department-radios .card-radio:nth-child(1) { animation-delay: 0.1s; }
.department-radios .card-radio:nth-child(2) { animation-delay: 0.2s; }
.department-radios .card-radio:nth-child(3) { animation-delay: 0.3s; }
.department-radios .card-radio:nth-child(4) { animation-delay: 0.4s; }
.quick-card:nth-child(1) { animation-delay: 0.1s; }
.quick-card:nth-child(2) { animation-delay: 0.2s; }
.quick-card:nth-child(3) { animation-delay: 0.3s; }

/* Icon Enhancements */
.fa-industry {
    color: var(--primary-red-color) !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.fa-search-location, .fa-handshake {
    color: var(--primary-red-color) !important;
}

/* Fix for factory-info-section height and footer overlap */
#contacto > div.contact-content.bg-light.py-5 > div > div > div.col-lg-8 {
    display: flex;
    flex-direction: column;
}

#contacto > div.contact-content.bg-light.py-5 > div > div > div.col-lg-8 > div.card.shadow-sm.border-0.mb-4 {
    flex: 0 0 auto;
    height: auto !important;
}

.factory-info-section {
    flex: 1 0 auto;
    height: auto !important;
    min-height: auto !important;
}

/* Ensure proper container height */
.contact-content .container,
.contact-content .row,
.contact-content .col-lg-8 {
    height: auto !important;
}

/* Fix for the specific card that's pushing content down */
.card.shadow-sm.border-0.mb-4 {
    overflow: visible !important;
}

/* Ensure the contact section doesn't have fixed height */
.contact-section {
    min-height: auto !important;
    height: auto !important;
}

/* Fix for the form container */
.contact-form.modern-form {
    display: flex;
    flex-direction: column;
}

/* Make sure all sections flow naturally */
.inquiry-section,
.submit-section,
.departments-subsection {
    flex: 0 0 auto;
}

/* Additional safety measures */
.main-content {
    overflow: visible !important;
}

#contacto {
    overflow: visible !important;
    position: relative;
}

/* Fix for textarea in form-floating */
.form-floating textarea.form-control {
    min-height: 120px !important;
    resize: vertical;
}

.form-floating textarea.form-control:focus {
    border-color: var(--primary-red-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Ensure form-floating works properly */
.form-floating {
    position: relative;
}

.form-floating > .form-control,
.form-floating > .form-select {
    height: calc(3.5rem + 2px);
    line-height: 1.25;
}

.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 1.5rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
    color: var(--dark-gray);
    font-weight: 500;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    color: var(--primary-red-color);
}

.form-floating > .form-control:-webkit-autofill ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* Fix for textarea label positioning */
.form-floating > textarea.form-control {
    height: auto;
    min-height: 120px !important;
    padding-top: 0.625rem;
}

.form-floating > textarea.form-control ~ label {
    transform-origin: 0 0;
    padding-top: 0.625rem;
}

/* Ensure select elements work with floating labels */
.form-floating > .form-select {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

/* Fix for focused state */
.form-floating.focused > label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    color: var(--primary-red-color);
}

/* Fix for textarea placeholder issue */
.form-control::placeholder {
    color: transparent;
}

.form-control:focus::placeholder {
    color: var(--dark-gray);
}

/* ==================== PROCESSING OVERLAY - FULL PAGE WITH CARD STYLE ==================== */
.processing-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

.processing-overlay.hidden {
    display: none !important;
    opacity: 0;
    visibility: hidden;
}

.processing-overlay:not(.hidden) {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

.processing-content {
    background: #ffffff !important; /* Changed to solid white */
    border-radius: 15px;
    padding: 3rem 2.5rem;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.4s ease-out;
    max-width: 500px;
    width: 90%;
    position: relative;
    overflow: hidden;
    /* Red border on left - KEPT AS IS */
    border-left: 6px solid var(--primary-red-color);
    /* Professional borders on other sides */
    border-top: 1px solid var(--medium-gray);
    border-right: 1px solid var(--medium-gray);
    border-bottom: 1px solid var(--medium-gray);
}

.processing-overlay:not(.hidden) .processing-content {
    transform: scale(1);
    opacity: 1;
}

/* Optional: Add a subtle glow effect to the red border */
.processing-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, 
        var(--primary-red-color) 0%, 
        var(--primary-red-dark) 50%, 
        var(--primary-red-color) 100%);
    z-index: 1;
}

/* Enhanced border glow animation */
.processing-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        transparent 0%, 
        rgba(220, 53, 69, 0.1) 30%, 
        rgba(220, 53, 69, 0.3) 50%, 
        rgba(220, 53, 69, 0.1) 70%, 
        transparent 100%);
    border-radius: 17px;
    z-index: -1;
    animation: borderPulse 2s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% { 
        opacity: 0.3;
        transform: scale(1);
    }
    50% { 
        opacity: 0.6;
        transform: scale(1.02);
    }
}

.processing-icon {
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.processing-icon .spinner-border {
    width: 4rem;
    height: 4rem;
    border-width: 0.4em;
    border-color: var(--primary-red-color);
    border-right-color: transparent;
}

.processing-title {
    color: var(--dark-color) !important; /* Ensured dark color */
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.8rem;
    position: relative;
    z-index: 2;
}

.processing-message {
    color: var(--dark-gray) !important; /* Ensured dark gray color */
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

/* Progress bar styling */
.processing-overlay .progress {
    height: 8px;
    background: var(--medium-gray);
    border-radius: 4px;
    overflow: hidden;
    margin: 2rem 0 1rem;
    position: relative;
    z-index: 2;
}

.processing-overlay .progress-bar {
    background: linear-gradient(90deg, 
        var(--primary-red-color) 0%, 
        var(--primary-red-dark) 50%, 
        var(--primary-red-color) 100%);
    border-radius: 4px;
    transition: width 0.3s ease-out;
    position: relative;
}

/* Add shimmer effect to progress bar */
.processing-overlay .progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%);
    animation: shimmer 2s infinite;
}

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

/* Body class when overlay is open */
body.overlay-open {
    overflow: hidden;
}

/* Make sure overlay covers everything and is on top */
.processing-overlay {
    z-index: 9999 !important;
}

/* Optional: Add a close button for emergency exit */
.processing-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-gray);
    cursor: pointer;
    z-index: 3;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.processing-close:hover {
    opacity: 1;
    color: var(--primary-red-color);
}

/* Responsive design */
@media (max-width: 768px) {
    .processing-content {
        padding: 2.5rem 1.5rem;
        margin: 1rem;
        max-width: 90%;
    }
    
    .processing-title {
        font-size: 1.5rem;
    }
    
    .processing-message {
        font-size: 1rem;
    }
    
    .processing-icon .spinner-border {
        width: 3rem;
        height: 3rem;
    }
}

@media (max-width: 576px) {
    .processing-content {
        padding: 2rem 1rem;
    }
    
    .processing-title {
        font-size: 1.3rem;
    }
    
    .processing-message {
        font-size: 0.9rem;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .processing-content {
        padding: 2.5rem 1.5rem;
        margin: 1rem;
        max-width: 90%;
    }
    
    .processing-title {
        font-size: 1.5rem;
    }
    
    .processing-message {
        font-size: 1rem;
    }
    
    .processing-icon .spinner-border {
        width: 3rem;
        height: 3rem;
    }
}

@media (max-width: 576px) {
    .processing-content {
        padding: 2rem 1rem;
    }
    
    .processing-title {
        font-size: 1.3rem;
    }
    
    .processing-message {
        font-size: 0.9rem;
    }
}

/* ==================== MEDIA QUERIES ==================== */

@media (max-width: 991.98px) {
    #contacto > div.contact-content.bg-light.py-5 > div > div > div.col-lg-8 {
        display: block;
    }
    
    .factory-info-section {
        margin-top: 1rem;
    }
    
    .contact-sidebar {
        margin-top: 2rem;
    }
    
    .factory-info-section {
        padding: 2rem !important;
    }
}

@media (max-width: 768px) {
    .contact-section {
        background: transparent;
        padding: 0 0 2rem;
    }

    .contact-hero.compact-hero {
        padding: 2rem 0;
    }
    
    .contact-hero.compact-hero .section-title h1 {
        font-size: 2rem;
    }
    
    .radio-card {
        padding: 1.5rem 1rem;
        min-height: 160px;
    }
    
    .radio-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .submit-container .btn {
        width: 100%;
        min-width: auto;
    }
    
    .factory-info-section .card-body {
        padding: 1.5rem !important;
    }
    
    .contact-sidebar .quick-card {
        margin-bottom: 1rem;
    }

    .contact-content.bg-light {
        padding: 2rem 0;
    }
    
    .inquiry-section,
    .submit-section,
    .factory-info-section,
    .contact-sidebar.bg-light {
        padding: 1.5rem !important;
        margin: 1rem 0;
    }
    
    .quick-card .card-body {
        padding: 1.25rem !important;
    }
    
    .btn.btn-outline-red.btn-sm.border.border-danger.text-danger.hover-red,
    .quick-card .btn-danger.btn-sm {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .processing-modal-content {
        padding: 2rem;
        margin: 1rem;
    }
}

@media (max-width: 576px) {
    .department-radios .col-md-6.col-lg-3 {
        margin-bottom: 1rem;
    }
    
    .radio-card {
        min-height: 140px;
        padding: 1.25rem 0.75rem;
    }
    
    .radio-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .selection-indicator {
        top: 6px;
        right: 6px;
    }
    
    .selection-indicator i {
        font-size: 0.9rem;
    }
    
    .processing-title {
        font-size: 1.3rem;
    }
    
    .processing-message {
        font-size: 1rem;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .radio-card {
        border: 2px solid #000 !important;
        background: #fff !important;
        box-shadow: none !important;
        transform: none !important;
    }
    
    .card-radio input[type="radio"]:checked + label .radio-card {
        border: 3px solid #000 !important;
        background: #f0f0f0 !important;
    }
    
    .selection-indicator {
        display: none;
    }
}

/* Fix Flash Messages */
.alert {
    position: relative !important;
    margin: 1rem 0 !important;
    width: auto !important;
    max-width: 100% !important;
    z-index: 1000 !important;
}

.msg_success,
.msg_error {
    position: relative !important;
    margin: 1rem 0 !important;
    width: auto !important;
    max-width: 100% !important;
    z-index: 1000 !important;
}

/* Ensure modal stays on top of everything */
.processing-modal {
    z-index: 9999 !important;
}

/* Make sure flash messages don't interfere with modal */
.alert,
.msg_success,
.msg_error {
    z-index: 1000 !important;
}
/* ==================== DEPARTMENT RADIO HEIGHT FIX ==================== */
.department-radios .row.g-3 {
    align-items: stretch;
}

.department-radios .col-md-6.col-lg-3 {
    display: flex;
    min-height: 180px; /* Set minimum height for consistency */
}

.department-radios .card-radio {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.department-radios .radio-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 180px; /* Ensure minimum height */
    height: 100%; /* Take full height of parent */
    padding: 1.5rem 1rem; /* Consistent padding */
}

.department-radios .radio-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.department-radios .radio-title {
    font-weight: 600;
    color: var(--dark-color);
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    line-height: 1.3;
    display: block;
    white-space: normal;
    word-wrap: break-word;
    width: 100%;
}

.department-radios .radio-subtitle {
    color: var(--dark-gray);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
    white-space: normal;
    word-wrap: break-word;
    width: 100%;
    margin: 0;
}

/* Ensure radio icon doesn't affect height distribution */
.department-radios .radio-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-red-color) 0%, var(--primary-red-dark) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

/* Force equal height on all department cards */
.department-radios .card-radio {
    height: 100%;
}

.department-radios .form-check-label {
    height: 100%;
    display: flex;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .department-radios .col-md-6.col-lg-3 {
        min-height: 160px;
    }
    
    .department-radios .radio-card {
        min-height: 160px;
        padding: 1.25rem 0.75rem;
    }
    
    .department-radios .radio-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 576px) {
    .department-radios .col-md-6.col-lg-3 {
        min-height: 140px;
        margin-bottom: 1rem;
    }
    
    .department-radios .radio-card {
        min-height: 140px;
        padding: 1rem 0.75rem;
    }
    
    .department-radios .radio-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .department-radios .radio-title {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
    }
    
    .department-radios .radio-subtitle {
        font-size: 0.8rem;
    }
}

/* Ensure consistent hover and selected states */
.department-radios .card-radio input[type="radio"]:checked + label .radio-card,
.department-radios .radio-card:hover {
    transform: translateY(-2px);
    min-height: 180px; /* Maintain same height on hover/select */
}

@media (max-width: 768px) {
    .department-radios .card-radio input[type="radio"]:checked + label .radio-card,
    .department-radios .radio-card:hover {
        min-height: 160px;
    }
}

@media (max-width: 576px) {
    .department-radios .card-radio input[type="radio"]:checked + label .radio-card,
    .department-radios .radio-card:hover {
        min-height: 140px;
    }
}

/* ==================== DEPARTMENT ITEMS UNIFORM SIZE ==================== */
.departments-subsection .row {
    align-items: stretch;
}

.departments-subsection .department-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 120px;
    border: 1px solid var(--medium-gray);
    border-radius: 10px;
    padding: 1.5rem;
    background: white;
    transition: all 0.3s ease;
    position: relative;
}

/* Ensure all department items have equal dimensions */
.departments-subsection .col-md-6 {
    display: flex;
    margin-bottom: 1rem;
}

.departments-subsection .department-item {
    flex: 1;
    width: 100%;
}

/* Department item content alignment */
.department-item .d-flex {
    flex: 1;
    display: flex;
    align-items: center;
    height: 100%;
}

.department-item .flex-grow-1 {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

/* Department text content */
.department-item h6 {
    font-weight: 600;
    color: var(--dark-color);
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    line-height: 1.3;
    white-space: normal;
    word-wrap: break-word;
}

.department-item p {
    color: var(--dark-gray);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
    white-space: normal;
    word-wrap: break-word;
    margin: 0;
    flex: 1;
}

/* Department icons */
.department-item .fa-stack {
    flex-shrink: 0;
    margin-right: 1rem;
    width: 50px;
    height: 50px;
}

.department-item .fa-stack .fa-circle {
    color: var(--primary-red-color);
    font-size: 2.5em;
}

.department-item .fa-stack .fa-inverse {
    font-size: 1em;
    color: white;
}

/* Hover effects with consistent dimensions */
.department-item:hover {
    transform: translateX(5px);
    border-color: var(--primary-red-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    height: 100%; /* Maintain same height on hover */
}

/* Ensure all items in the same row have equal height */
.departments-subsection .row.g-3 {
    display: flex;
    flex-wrap: wrap;
}

.departments-subsection .row.g-3 > .col-md-6 {
    display: flex;
}

/* Specific height control for different screen sizes */
@media (min-width: 768px) {
    .departments-subsection .department-item {
        min-height: 120px;
    }
}

@media (max-width: 767.98px) {
    .departments-subsection .department-item {
        min-height: 110px;
        padding: 1.25rem;
    }
    
    .department-item .fa-stack {
        width: 45px;
        height: 45px;
        margin-right: 0.75rem;
    }
    
    .department-item h6 {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
    }
    
    .department-item p {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .departments-subsection .department-item {
        min-height: 100px;
        padding: 1rem;
    }
    
    .department-item .fa-stack {
        width: 40px;
        height: 40px;
        margin-right: 0.75rem;
    }
    
    .department-item .fa-stack .fa-circle {
        font-size: 2em;
    }
    
    .department-item .fa-stack .fa-inverse {
        font-size: 0.9em;
    }
}

/* Force equal width distribution */
.departments-subsection .row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.departments-subsection .col-md-6 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    flex: 0 0 50%;
    max-width: 50%;
}

/* Ensure consistent spacing between items */
.departments-subsection .row.g-3 {
    gap: 0; /* Remove gap utility and use padding instead */
}

.departments-subsection .col-md-6 {
    margin-bottom: 1rem;
}

/* Make sure the entire subsection has consistent layout */
.departments-subsection .card-body {
    padding: 1.5rem !important;
}

/* Uniform animation states */
.department-item {
    transition: all 0.3s ease;
}

.department-item:active {
    transform: translateX(2px);
}

/* Focus state for accessibility */
.department-item:focus-within {
    outline: 2px solid var(--primary-red-color);
    outline-offset: 2px;
}

/* Print styles for consistency */
@media print {
    .departments-subsection .department-item {
        border: 1px solid #000 !important;
        background: #fff !important;
        box-shadow: none !important;
        transform: none !important;
        min-height: 100px !important;
        page-break-inside: avoid;
    }
    
    .departments-subsection .col-md-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

/* ==================== DEPARTMENT RADIOS MOBILE STACKING ==================== */
/* For mobile screens (less than 768px), force single column */
@media (max-width: 768px) {
    .department-radios .col-md-6.col-lg-3 {
        flex: 0 0 100% !important; /* Force full width */
        max-width: 100% !important; /* Force full width */
        min-height: 140px; /* Adjust for single column */
    }
    
    /* Adjust card padding for single column layout */
    .department-radios .radio-card {
        min-height: 140px;
        padding: 1.25rem;
    }
    
    /* Center content better in single column */
    .department-radios .radio-content {
        padding: 0 0.5rem;
    }
}

/* For very small screens (less than 576px) */
@media (max-width: 576px) {
    .department-radios .col-md-6.col-lg-3 {
        min-height: 130px;
    }
    
    .department-radios .radio-card {
        min-height: 130px;
        padding: 1rem;
    }
    
    .department-radios .radio-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }
    
    .department-radios .radio-title {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
    }
    
    .department-radios .radio-subtitle {
        font-size: 0.8rem;
        line-height: 1.2;
    }
}

/* Ensure consistent hover and selected states on mobile */
@media (max-width: 768px) {
    .department-radios .card-radio input[type="radio"]:checked + label .radio-card,
    .department-radios .radio-card:hover {
        min-height: 140px;
        transform: translateY(-2px) scale(1.02); /* Slight scale for better feedback */
    }
}

/* Optional: Add smooth transition for layout changes */
.department-radios .col-md-6.col-lg-3 {
    transition: all 0.3s ease;
}

/* ==================== ON-SITE DEPARTMENTS MOBILE STACKING ==================== */
@media (max-width: 768px) {
    .departments-subsection .col-md-6 {
        flex: 0 0 100% !important; /* Force full width */
        max-width: 100% !important; /* Force full width */
    }
    
    .departments-subsection .department-item {
        min-height: 100px;
        padding: 1.25rem;
    }
}

@media (max-width: 576px) {
    .departments-subsection .department-item {
        min-height: 90px;
        padding: 1rem;
    }
    
    .department-item .d-flex {
        align-items: flex-start; /* Better alignment for stacked layout */
    }
    
    .department-item i {
        margin-top: 0.25rem; /* Align icon with top of text */
    }
}

/* ============================================================
   REDESIGNED CONTACT PAGE — 2025
   ============================================================ */

/* (hero styles moved to top of file) */

/* Page background */
.contact-content {
    background: #f4f6f8 !important;
    padding: 2.5rem 0 !important;
}

/* Unified card */
.contact-card {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06) !important;
    overflow: hidden;
}

/* Card header strip */
.contact-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: #fff;
    border-bottom: 2px solid #f0f0f0;
    border-left: 4px solid #CC0000;
}
.contact-card-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: #fff0f0;
    color: #CC0000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.contact-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

/* Form inside card — remove inner bg boxes */
.contact-card .card-body { background: #fff; }
.contact-card .inquiry-section,
.contact-card .submit-section {
    background: #f8fafc !important;
    border-left: none !important;
    border-radius: 8px;
}

/* Form section title */
.contact-card .form-section-title.text-danger {
    color: #1e293b !important;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    border-left: 3px solid #CC0000;
    padding-left: 0.6rem;
    border-bottom: none;
}

/* Info items in Sales Offices */
.contact-card .card-body .d-flex.flex-column.align-items-center strong {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.2rem;
}

/* Distribution center location boxes */
.dist-location {
    border-left: 3px solid #CC0000;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
}
.dist-location h6 { color: #1e293b; margin-bottom: 0.25rem; font-size: 0.9rem; }

/* Support cards — no nested shadow */
.contact-card .quick-card {
    border: 1px solid #f0f0f0 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    transition: box-shadow 0.2s, transform 0.2s;
}
.contact-card .quick-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.09) !important;
    transform: translateY(-2px);
}
.contact-card .quick-card .card-body { padding: 1.5rem !important; }

/* Factory info items */
.factory-info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.fii-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: #fff0f0;
    color: #CC0000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.factory-info-item strong {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.15rem;
}

/* Department chips */
.dept-heading {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin: 1.5rem 0 0.75rem;
    font-weight: 600;
}
.dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.6rem;
}
.dept-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    background: #f8fafc;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    font-size: 0.85rem;
}
.dept-chip i {
    color: #CC0000;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}
.dept-chip strong { display: block; font-size: 0.83rem; color: #1e293b; }
.dept-chip small  { display: block; font-size: 0.75rem; color: #94a3b8; }

@media (max-width: 576px) {
    .contact-hero { padding: 2rem 1rem; }
    .contact-hero-title { font-size: 1.6rem; }
    .dept-grid { grid-template-columns: 1fr 1fr; }
}
