/* --- General Styles & Page Title --- */
.page-title-container {
    text-align: center;
    margin-bottom: 30px;
    color: #3C6E71;
}

.page-title-container h1 {
    font-size: 2em;
    border-bottom: 2px solid #3C6E71;
    display: inline-block;
    padding-bottom: 10px;
}

/* --- Card Gallery Layout --- */
.valve-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 25px;
}

/* --- Main Card Structure --- */
.valve-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #C9C9C9;
}

.valve-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.valve-image-container {
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    position: relative;
    background-color: #f0f0f0;
    overflow: hidden;
}

.valve-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* --- Card Content --- */
.valve-info {
    padding: 20px 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.valve-name {
    font-size: 1.3em;
    color: #3C6E71;
    margin-top: 0;
    margin-bottom: 5px;
    line-height: 1.4;
}

.valve-code {
    font-size: 0.8em;
    color: #555;
    font-weight: normal;
    margin-bottom: 15px;
}

.valve-description {
    font-size: 0.9em;
    line-height: 1.6;
    color: #333;
    margin-bottom: 18px;
}

/* --- Interactive Section --- */
.valve-sizes-section {
    margin-top: auto;
}

.valve-sizes-section h4 {
    font-size: 1.05em;
    color: #3C6E71;
    margin-bottom: 10px;
    border-bottom: 1px solid #C9C9C9;
    padding-bottom: 8px;
}

.valve-size-select {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 15px;
    border: 1px solid #C9C9C9;
    border-radius: 6px;
    background-color: #fff;
    font-size: 0.95em;
    color: #333;
    cursor: pointer;
}

.valve-size-select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
}

/* --- Content Panes (Tabs) --- */
.content-pane {
    display: none; /* Hide all panes by default */
    padding: 10px;
    border-top: 1px solid #C9C9C9;
    background-color: #f9f9f9;
    border-radius: 4px;
    animation: fadeIn 0.4s ease-in-out;
}

.content-pane.is-active {
    display: block; /* Show only the active pane */
}

.content-pane ul {
    list-style-type: disc;
    padding-right: 20px;
    margin: 0;
    font-size: 0.88em;
    color: #333;
}

.content-pane ul li {
    margin-bottom: 7px;
    line-height: 1.5;
}

.content-pane ul a {
    text-decoration: none;
    color: #3C6E71;
}

.content-pane ul a:hover {
    text-decoration: underline;
}

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

/* --- Media Queries --- */
@media (max-width: 480px) {
    .valve-gallery {
        grid-template-columns: 1fr;
    }
	.content-pane ul {
		padding-right: 0px; }
		.content-pane li {
		padding-bottom 2px;
	}
}

/* --- Floating Action Button --- */

/* Main container for positioning */
.fab-container {
    position: fixed;
    bottom: 25px;
    right: 25px; /* Change to 'left' for left side */
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
}

/* The main button style */
.fab-main {
    background-color: #3C6E71; /* Our Primary Color */
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.fab-main:hover {
    background-color: #2B4E50; /* Darker shade */
    transform: scale(1.05);
}

/* Icon rotation when menu is open */
.fab-container.is-open .fab-main i {
    transform: rotate(135deg); /* Rotates the '+' or phone icon */
}
.fab-container .fab-main i {
     transition: transform 0.3s ease;
}


/* The menu container */
.fab-menu {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
    /* Initially hidden */
    visibility: hidden;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.3s ease;
}

/* Show menu when container has .is-open class */
.fab-container.is-open .fab-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* Individual menu items */
.fab-item {
    display: flex;
    align-items: center;
    text-decoration: none;
    background-color: white;
    color: #3C6E71;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap; /* Prevents text from wrapping */
}

.fab-item:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.fab-item i {
    font-size: 20px;
    margin-left: 10px; /* RTL margin */
}

.fab-item span {
    font-size: 14px;
    font-weight: 500;
}

.fab-item small {
    font-size: 11px;
    color: #CC2936; /* Our Accent Color */
    margin-right: 5px;
}


/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .fab-item {
        width: 48px;
        height: 48px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
        position: relative; /* For tooltip */
    }

    .fab-item span {
        display: none; /* Hide text on small screens */
    }
    
    .fab-item i {
        margin: 0;
        font-size: 22px;
    }
    
    /* Show tooltip on hover */
    .fab-item::before {
        content: attr(data-tooltip);
        position: absolute;
        right: 60px; /* Position tooltip to the left of the icon */
        top: 50%;
        transform: translateY(-50%);
        background-color: #333;
        color: white;
        padding: 5px 10px;
        border-radius: 4px;
        font-size: 12px;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease;
    }

    .fab-item:hover::before {
        opacity: 1;
        visibility: visible;
    }
}
/* --- Final Hybrid Smart Contact Button CSS --- */

.contact-button-container {
    position: relative;
    margin-top: auto;
    padding-top: 20px;
}

/* --- Helper Classes for Responsiveness --- */
.mobile-only { display: none !important; }
.desktop-only { display: block !important; }

/* On mobile screens, swap visibility */
@media (max-width: 768px) {
    .mobile-only { display: block !important; }
    .desktop-only { display: none !important; }
}

/* --- 1. Desktop Styles (Same as before) --- */
.contact-main-btn {
    width: 100%;
    background-color: #3B6D70;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease, border-radius 0.3s ease;
}
.contact-main-btn:hover { background-color: #2a4d50; }
.contact-main-btn .arrow-icon { transition: transform 0.3s ease-in-out; }

.contact-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    z-index: 20;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.contact-item {
    display: flex; align-items: center; gap: 15px; padding: 12px 15px;
    text-decoration: none; color: #333; font-size: 0.9em;
    border-bottom: 1px solid #f0f0f0; transition: background-color 0.2s ease;
}
.contact-item:last-child { border-bottom: none; }
.contact-item:hover { background-color: #f7f7f7; color: #3B6D70; }
.contact-item i { font-size: 18px; width: 20px; text-align: center; color: #3B6D70; }

.contact-button-container.is-open .contact-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.contact-button-container.is-open .contact-main-btn { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.contact-button-container.is-open .arrow-icon { transform: rotate(180deg); }


/* --- 2. Mobile Styles --- */
.mobile-select-wrapper {
    position: relative;
}

.contact-select-mobile {
    width: 100%;
    background-color: #3B6D70;
    color: white;
    padding: 12px 45px 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    -webkit-appearance: none; /* Removes default OS styling */
    -moz-appearance: none;
    appearance: none;
}
/* Style for options inside the native menu */
.contact-select-mobile option {
    color: #000; /* Or whatever color you prefer for the dropdown items */
    background: #fff;
}

.mobile-select-wrapper .select-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    pointer-events: none; /* Allows clicks to pass through to the select */
    font-size: 16px;
}