/* ===== PRODUCTS PAGE SPECIFIC STYLES ===== */

.products-page-section {
    padding: 100px 0 80px;
    background-color: var(--light);
    position: relative;
    overflow: hidden;
}

.products-page-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

body.dark-mode .products-page-section {
    background-color: var(--dark);
}

body.dark-mode .products-page-section::before {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.05) 0%, transparent 50%);
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.section-title {
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

body.dark-mode .section-title {
    color: var(--secondary);
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

body.dark-mode .section-subtitle {
    color: var(--text-dark);
}

/* Product Category Styles */
.product-category {
    margin-bottom: 80px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.product-category:nth-child(2) { animation-delay: 0.1s; }
.product-category:nth-child(3) { animation-delay: 0.2s; }
.product-category:nth-child(4) { animation-delay: 0.3s; }
.product-category:nth-child(5) { animation-delay: 0.4s; }
.product-category:nth-child(6) { animation-delay: 0.5s; }
.product-category:nth-child(7) { animation-delay: 0.6s; }
.product-category:nth-child(8) { animation-delay: 0.7s; }
.product-category:nth-child(9) { animation-delay: 0.8s; }

.product-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

body.dark-mode .product-category {
    background: var(--card-dark);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

body.dark-mode .product-category:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.category-title {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 25px 30px;
    margin: 0;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.category-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.category-title:hover::before {
    transform: translateX(100%);
}

.category-icon {
    font-size: 1.4rem;
    opacity: 0.9;
}

body.dark-mode .category-title {
    background: linear-gradient(135deg, #00264d 0%, #001a33 100%);
}

.category-content {
    padding: 40px 30px;
}

.category-subsection {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.category-subsection:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.subsection-title {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
    font-weight: 600;
}

.subsection-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--primary);
}

body.dark-mode .subsection-title {
    color: var(--secondary);
}

body.dark-mode .subsection-title::after {
    background: var(--secondary);
}

/* Layout for vertical image alignment */
.vertical-image-layout {
    display: flex;
    gap: 40px;
    margin-bottom: 25px;
    align-items: flex-start;
}

.vertical-image-layout .text-content {
    flex: 2;
}

.vertical-image-layout .image-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Layout for horizontal image alignment */
.horizontal-image-layout .text-content {
    margin-bottom: 30px;
}

.horizontal-image-layout .image-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
}

/* New Valves and Connectors Layout */
.valves-layout, .connectors-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.large-image-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.large-image-container .image-item {
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
}

.large-image-container .image-item img {
    height: 400px;
    object-fit: contain;
}

/* Large image for insulation section */
.large-image {
    width: 100%;
}

.large-image img {
    height: 400px !important;
    object-fit: cover;
}

/* Common image styles */
.image-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    background: var(--card-light);
    position: relative;
}

body.dark-mode .image-item {
    background: var(--card-dark);
}

.vertical-image-layout .image-item {
    flex: 1;
}

.horizontal-image-layout .image-item {
    flex: 1;
    min-width: 200px;
}

.image-wrapper {
    position: relative;
    overflow: hidden;
}

.image-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-item:hover .image-overlay {
    opacity: 1;
}

.zoom-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.3s ease, background 0.3s ease;
}

.zoom-btn:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

.image-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.image-item:hover img {
    transform: scale(1.08);
}

.image-caption {
    padding: 15px;
    background: #f5f7fa;
    font-size: 0.95rem;
    color: #555;
    text-align: center;
    font-weight: 500;
}

body.dark-mode .image-caption {
    background: #2a2a2a;
    color: var(--text-dark);
}

.placeholder-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    height: 220px;
}

body.dark-mode .placeholder-image {
    background: linear-gradient(135deg, #2a2a2a 0%, #333 100%);
}

.placeholder-content {
    text-align: center;
    color: var(--primary);
}

.placeholder-content i {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.7;
}

.placeholder-content p {
    font-weight: 500;
}

body.dark-mode .placeholder-content {
    color: var(--secondary);
}

.features-list {
    margin: 20px 0;
    padding-left: 20px;
}

.feature-item {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    transform: translateX(-10px);
    animation: slideInRight 0.5s ease forwards;
}

.feature-item:nth-child(1) { animation-delay: 0.1s; }
.feature-item:nth-child(2) { animation-delay: 0.2s; }
.feature-item:nth-child(3) { animation-delay: 0.3s; }
.feature-item:nth-child(4) { animation-delay: 0.4s; }
.feature-item:nth-child(5) { animation-delay: 0.5s; }

.feature-item:hover {
    transform: translateX(5px);
}

.feature-icon {
    color: var(--primary);
    margin-right: 15px;
    flex-shrink: 0;
    margin-top: 3px;
    font-size: 1.1rem;
}

body.dark-mode .feature-icon {
    color: var(--secondary);
}

.feature-detail {
    margin-left: 25px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f9fafc;
    border-radius: 6px;
    border-left: 3px solid var(--primary);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    transform: translateX(-10px);
    animation: slideInRight 0.5s ease forwards;
}

.feature-detail:nth-child(1) { animation-delay: 0.2s; }
.feature-detail:nth-child(2) { animation-delay: 0.3s; }
.feature-detail:nth-child(3) { animation-delay: 0.4s; }
.feature-detail:nth-child(4) { animation-delay: 0.5s; }
.feature-detail:nth-child(5) { animation-delay: 0.6s; }

.feature-detail:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

body.dark-mode .feature-detail {
    background: #2a2a2a;
    border-left-color: var(--secondary);
}

.feature-detail strong {
    color: var(--primary);
    font-size: 1.05rem;
}

body.dark-mode .feature-detail strong {
    color: var(--secondary);
}

.table-container {
    overflow-x: auto;
    margin: 25px 0;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.valve-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
}

.valve-table th, .valve-table td {
    border: 1px solid var(--border-color);
    padding: 15px;
    text-align: center;
    transition: background 0.3s ease;
}

.valve-table th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 600;
    font-size: 1.05rem;
}

.valve-table td {
    background: white;
}

.valve-table tr:nth-child(even) td {
    background-color: #f9f9f9;
}

.valve-table tr:hover td {
    background-color: #f0f7ff;
}

body.dark-mode .valve-table th {
    background: linear-gradient(135deg, #00264d 0%, #001a33 100%);
}

body.dark-mode .valve-table td {
    background: var(--card-dark);
    color: var(--text-dark);
}

body.dark-mode .valve-table tr:nth-child(even) td {
    background-color: #2a2a2a;
}

body.dark-mode .valve-table tr:hover td {
    background-color: #333;
}

/* Contact Section Styles */
.contact-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 80px 0;
    color: white;
}

.contact-container {
    display: flex;
    gap: 40px;
    margin-top: 40px;
}

.contact-info {
    flex: 1;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
}

.contact-info h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 3px;
    background: white;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.contact-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.contact-item h4 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
}

.contact-item p {
    margin: 0;
    opacity: 0.9;
}

.brand-animation {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.animated-logo {
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.animated-logo img {
    width: 120px;
    height: auto;
}

.brand-text h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.brand-text p {
    opacity: 0.9;
    line-height: 1.6;
}

/* Modal Enhancements */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s ease;
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

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

.modal-body img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

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

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ===== IMPROVED RTL SUPPORT ===== */
body[dir="rtl"] .subsection-title::after {
    left: auto;
    right: 0;
}

/* Fix for feature items - more specific targeting */
body[dir="rtl"] .features-list {
    padding-left: 0;
    padding-right: 20px;
}

body[dir="rtl"] .features-list .feature-item {
    flex-direction: row-reverse;
    text-align: right;
    direction: rtl;
    transform: translateX(10px);
    animation: slideInLeft 0.5s ease forwards;
}

body[dir="rtl"] .features-list .feature-icon {
    margin-right: 0;
    margin-left: 15px;
    order: 2; /* Force icon to the right */
}

body[dir="rtl"] .features-list .feature-item span:not(.feature-icon) {
    order: 1; /* Force text to the left */
    text-align: right;
}

body[dir="rtl"] .feature-detail {
    margin-left: 0;
    margin-right: 25px;
    border-left: none;
    border-right: 3px solid var(--primary);
    text-align: right;
    direction: rtl;
    transform: translateX(10px);
    animation: slideInLeft 0.5s ease forwards;
}

body[dir="rtl"] .feature-detail:hover {
    transform: translateX(-5px);
}

body[dir="rtl"] .category-title {
    flex-direction: row-reverse;
    text-align: right;
}

body[dir="rtl"] .category-title::before {
    transform: translateX(100%);
}

body[dir="rtl"] .category-title:hover::before {
    transform: translateX(-100%);
}

body[dir="rtl"] .section-title::after {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

/* RTL text alignment fixes - more comprehensive */
body[dir="rtl"] .category-content,
body[dir="rtl"] .text-content,
body[dir="rtl"] .features-list,
body[dir="rtl"] .category-subsection {
    text-align: right;
    direction: rtl;
}

body[dir="rtl"] .vertical-image-layout,
body[dir="rtl"] .horizontal-image-layout {
    direction: rtl;
}

body[dir="rtl"] .valves-layout,
body[dir="rtl"] .connectors-layout {
    direction: rtl;
}

/* Keep tables centered in RTL */
body[dir="rtl"] .valve-table {
    direction: ltr;
}

body[dir="rtl"] .valve-table th,
body[dir="rtl"] .valve-table td {
    text-align: center;
}

/* Keep image captions centered */
body[dir="rtl"] .image-caption {
    text-align: center;
    direction: rtl;
}

/* Keep placeholder content centered */
body[dir="rtl"] .placeholder-content {
    text-align: center;
    direction: rtl;
}

/* RTL paragraph alignment */
body[dir="rtl"] .category-content p {
    text-align: right;
    direction: rtl;
}

/* RTL contact section */
body[dir="rtl"] .contact-info h3::after {
    left: auto;
    right: 0;
}

body[dir="rtl"] .contact-item {
    flex-direction: row-reverse;
    text-align: right;
}

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

/* ===== PRODUCTS PAGE RESPONSIVE ===== */
@media (max-width: 1200px) {
    .section-title {
        font-size: 2.5rem;
    }
    
    .category-title {
        font-size: 1.7rem;
        padding: 22px 25px;
    }
    
    .category-content {
        padding: 35px 25px;
    }
    
    .large-image-container .image-item {
        width: 90%;
    }
    
    .large-image-container .image-item img {
        height: 300px;
    }
    
    .large-image img {
        height: 350px !important;
    }
    
    .contact-container {
        gap: 30px;
    }
}

@media (max-width: 992px) {
    .vertical-image-layout {
        flex-direction: column;
    }
    
    .vertical-image-layout .image-content {
        width: 100%;
        flex-direction: row;
    }
    
    .section-title {
        font-size: 2.3rem;
    }
    
    .category-title {
        font-size: 1.6rem;
    }
    
    .large-image-container .image-item {
        width: 95%;
    }
    
    .large-image-container .image-item img {
        height: 250px;
    }
    
    .large-image img {
        height: 300px !important;
    }
    
    .contact-container {
        flex-direction: column;
        gap: 40px;
    }
    
    .contact-info, .brand-animation {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .products-page-section {
        padding: 90px 0 60px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1.1rem;
    }
    
    .category-title {
        font-size: 1.5rem;
        padding: 20px;
    }
    
    .category-content {
        padding: 25px 20px;
    }
    
    .horizontal-image-layout .image-content {
        flex-direction: column;
    }
    
    .valve-table {
        font-size: 0.9rem;
    }
    
    .valve-table th, .valve-table td {
        padding: 12px 8px;
    }
    
    .image-item img {
        height: 200px;
    }
    
    .placeholder-image {
        height: 200px;
    }
    
    .large-image-container .image-item {
        width: 100%;
    }
    
    .large-image-container .image-item img {
        height: 200px;
    }
    
    .large-image img {
        height: 250px !important;
    }
    
    .features-list {
        padding-left: 15px;
    }
    
    body[dir="rtl"] .features-list {
        padding-left: 0;
        padding-right: 15px;
    }
    
    .contact-section {
        padding: 60px 0;
    }
}

@media (max-width: 576px) {
    .products-page-section {
        padding: 80px 0 50px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .category-title {
        font-size: 1.4rem;
        padding: 18px 15px;
    }
    
    .category-content {
        padding: 20px 15px;
    }
    
    .subsection-title {
        font-size: 1.3rem;
    }
    
    .image-item img {
        height: 180px;
    }
    
    .placeholder-image {
        height: 180px;
    }
    
    .feature-detail {
        margin-left: 15px;
        padding: 12px;
    }
    
    body[dir="rtl"] .feature-detail {
        margin-left: 0;
        margin-right: 15px;
    }
    
    .large-image-container .image-item img {
        height: 180px;
    }
    
    .large-image img {
        height: 220px !important;
    }
    
    .features-list {
        padding-left: 10px;
    }
    
    body[dir="rtl"] .features-list {
        padding-left: 0;
        padding-right: 10px;
    }
    
    .contact-section {
        padding: 50px 0;
    }
    
    .contact-info h3 {
        font-size: 1.5rem;
    }
    
    .brand-text h3 {
        font-size: 1.5rem;
    }
    
    /* RTL mobile fixes */
    body[dir="rtl"] .feature-item {
        flex-direction: row-reverse;
        text-align: right;
    }
    
    body[dir="rtl"] .feature-icon {
        margin-right: 0;
        margin-left: 10px;
    }
}