/* --- JRJ Premium Catalog Styles (Scoped) --- */
.catalog-container {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin: 0 auto 50px auto;
    max-width: 1200px;
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333333;
}

/* Filter Bar Styles */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* Reserve room for the selected button to grow without touching its neighbours. */
    gap: 18px;
    margin-bottom: 30px;
    padding: 10px;
    background: #f4f6fa;
    border-radius: 30px;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.filter-btn {
    border: 1px solid transparent;
    background: transparent;
    color: #555555;
    padding: 8px 20px;
    font-size: 13.5px;
    /* Keep the same text width in both normal and selected states. */
    font-weight: 700;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    outline: none;
}

.filter-btn:hover {
    background: rgba(45, 54, 144, 0.05);
    color: #2f59b5;
}

.filter-btn.active {
    background: #2f59b5 !important; /* JRJ Navy */
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(45, 54, 144, 0.25);
    position: relative;
    z-index: 1;
    transform: scale(1.05);
}

/* Results Counter */
.results-counter {
    font-size: 14px;
    color: #666666;
    margin-bottom: 25px;
    font-weight: 500;
    padding-left: 10px;
    border-left: 3px solid #2f59b5;
    text-align: left;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Product Card */
.product-card {
    background: #ffffff;
    border: 1px solid #e1e4e8;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    position: relative;
    cursor: pointer;
    box-sizing: border-box;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(45, 54, 144, 0.1);
    border-color: rgba(45, 54, 144, 0.3);
}

.product-card.active-card {
    border: 2.5px solid #2f59b5 !important;
    box-shadow: 0 12px 28px rgba(45, 54, 144, 0.15) !important;
}

.product-card-img-wrapper {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    background: #fafafa;
    border-radius: 8px;
    padding: 12px;
    transition: background 0.3s ease;
}

.product-card:hover .product-card-img-wrapper {
    background: #f4f6fa;
}

.product-card-img-wrapper img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.product-badge {
    align-self: flex-start;
    font-size: 10px;
    font-weight: 700;
    color: #2f59b5;
    background: rgba(45, 54, 144, 0.08);
    padding: 4px 10px;
    border-radius: 12px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-card-title {
    font-size: 19px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
    line-height: 1.3;
    text-align: left;
}

.product-pills-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
}

.product-pill {
    font-size: 11px;
    background: #f0f2f5;
    color: #4b5563;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
}

.product-card-btn {
    margin-top: auto;
    background: transparent;
    border: 2px solid #2f59b5;
    color: #2f59b5;
    font-weight: 700;
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    cursor: pointer;
}

.product-card:hover .product-card-btn {
    background: #2f59b5;
    color: #ffffff;
}

/* Modal Overlay Container */
.detail-panel-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

.detail-panel {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 850px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalReveal {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.detail-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.detail-title {
    font-size: 24px;
    font-weight: 800;
    color: #2f59b5;
    margin: 0;
}

.detail-close-btn {
    background: #f3f4f6;
    border: none;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0 0 4px 0; /* Correction offset for standard multiplication sign font alignment */
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4b5563;
}

.detail-close-btn:hover {
    background: #2f59b5;
    color: #ffffff;
}

/* Modal Content Grid */
.detail-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    .detail-grid-layout {
        grid-template-columns: 300px 1fr;
    }
}

.detail-img-wrapper {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    height: 300px;
}

.detail-img-wrapper img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.detail-desc-col {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.detail-desc-col h4 {
    color: #1e293b;
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-desc-text {
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 20px;
    text-align: justify;
}

/* Specifications Grid */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.spec-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: left;
}

.spec-label {
    font-size: 9px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 2px;
}

.spec-value {
    font-size: 12px;
    color: #1e293b;
    font-weight: 700;
}

/* Feature Icons Bar */
.feature-icons-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
    align-items: center;
}

.feature-icon-img {
    height: 34px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
    border-radius: 4px;
    background: #f1f5f9;
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    transition: all 0.2s ease;
}

.feature-icon-img:hover {
    transform: scale(1.1);
    border-color: #2f59b5;
}

/* Action Buttons */
.detail-actions {
    display: flex;
    gap: 15px;
    margin-top: auto;
}

.btn-solicitar {
    background: #2f59b5;
    color: #ffffff !important;
    font-weight: 700;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(45, 54, 144, 0.3);
    text-decoration: none;
    display: inline-block;
    border: none;
    text-align: center;
    cursor: pointer;
}

.btn-solicitar:hover {
    background: #1d2570;
    box-shadow: 0 6px 20px rgba(45, 54, 144, 0.4);
    transform: translateY(-1px);
}

.btn-fechar {
    background: #f1f5f9;
    color: #475569 !important;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    border: 1px solid #cbd5e1;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    cursor: pointer;
}

.btn-fechar:hover {
    background: #e2e8f0;
    color: #1e293b !important;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .catalog-container {
        padding: 20px 15px;
    }
    .products-grid {
        grid-template-columns: 1fr;
    }
    .detail-panel {
        padding: 20px;
    }
    .detail-img-wrapper {
        height: 220px;
    }
    .detail-actions {
        flex-direction: column;
        gap: 10px;
    }
    .detail-actions a, .detail-actions button {
        width: 100%;
    }
}

/* Scrollbar Style for Modal */
.detail-panel::-webkit-scrollbar {
    width: 8px;
}
.detail-panel::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 8px;
}
.detail-panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
}
.detail-panel::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Legacy product list hiding */
.button_cont {
    display: none !important;
}

/* Full-width specifications layout under top columns in detail modal */
.detail-full-specs {
    margin-top: 30px;
    border-top: 1px solid #e2e8f0;
    padding-top: 25px;
}

.detail-full-specs h4 {
    color: #1e293b;
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 8px;
}

/* Button style for + Info button */
.btn-info {
    background: #00c0ff; /* Vibrant sky blue */
    color: #ffffff !important;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(0, 192, 255, 0.2);
    text-decoration: none;
    display: inline-block;
    border: none;
    text-align: center;
    cursor: pointer;
}

.btn-info:hover {
    background: #0099cc;
    box-shadow: 0 6px 20px rgba(0, 192, 255, 0.3);
    transform: translateY(-1px);
}

/* Corporate Dropdown Navigation Styles */
.dropdown-filter {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.filter-btn.dropdown-label {
    border-radius: 20px 0 0 20px;
    padding-right: 12px;
}

/* Scale the Equipamentos label and arrow together when it is selected. */
.filter-btn.dropdown-label.active {
    transform: none;
}

.dropdown-filter.is-selected {
    position: relative;
    z-index: 1;
    transform: scale(1.05);
}

.dropdown-arrow {
    border: none;
    border-radius: 0 20px 20px 0;
    background: transparent;
    color: #444;
    cursor: pointer;
    padding: 8px 14px 8px 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-arrow:hover,
.dropdown-arrow:focus {
    background: rgba(45, 54, 144, 0.05);
    color: #2f59b5;
    outline: none;
}

.dropdown-arrow i {
    font-size: 10px;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Submenu layout */
.dropdown-menu-custom {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #ffffff;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(45, 54, 144, 0.15);
    border-radius: 12px;
    padding: 8px;
    z-index: 100;
    border: 1px solid rgba(45, 54, 144, 0.08);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.28s;
}

/* Open only when the user clicks the arrow beside Equipamentos. */
.dropdown-filter.open .dropdown-menu-custom {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(5px);
    transition-delay: 0s;
}

.dropdown-filter.open .dropdown-arrow i {
    transform: rotate(180deg);
}

/* Dropdown item buttons */
.dropdown-item-btn {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    color: #4b5563;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.dropdown-item-btn:hover {
    background: rgba(45, 54, 144, 0.05);
    color: #2f59b5;
}

.dropdown-item-btn.active {
    background: #2f59b5;
    color: #ffffff !important;
}

/* When a sub-item is active, style the parent button as highlighted */
.dropdown-filter.has-active .filter-btn.dropdown-label {
    border-color: rgba(45, 54, 144, 0.3);
    color: #2f59b5;
    background: rgba(45, 54, 144, 0.06);
}
