/* BBI Search Cascading Dropdowns Widget Styles */

.bbis-dropdown-widget-wrapper {
    /* display: flex; /* This was causing the area and clear button to be side-by-side, not desired */
    /* flex-direction: column; */ /* Reverted this as well */
}

.bbis-dropdowns-area {
    display: flex;
    flex-wrap: wrap; /* Default to wrap for smaller screens */
    gap: 15px; /* Space between dropdown items */
    align-items: flex-end; /* Align items to the bottom, useful if labels make heights uneven */
    margin-bottom: 10px; /* Add some space before the clear button if it's below */
}

.bbis-dropdown-item {
    display: flex;
    flex-direction: column;
    flex-grow: 1;  /* Allow item to grow to fill available space */
    flex-shrink: 1; /* Allow item to shrink if needed */
    flex-basis: auto; /* Calculate initial size from content */
    min-width: 100px; /* Minimum width for the whole item (label + select). Adjust as needed. */
                      /* e.g., for "Model" or "Voltage" to not be too cramped initially. */
    /* max-width: 250px; */ /* Optional: prevent items from becoming too wide if only a few are present */
}

/* On larger screens, prevent wrapping and let them distribute space */
@media (min-width: 992px) { /* Adjust breakpoint as needed, e.g., 768px, 992px, 1200px */
    .bbis-dropdowns-area {
        flex-wrap: nowrap;
    }
}

.bbis-dropdown-item label {
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
    color: #083B56;
}

.bbis-dropdown-item select {
    padding: 10px 35px 10px 8px; /* Increased right padding for dropdown arrow */
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    width: auto; /* CRITICAL: Allow select's content to determine its natural width */
    min-width: 70px; /* Prevent select itself from becoming too small, e.g., for "12" */
    box-sizing: border-box;
    height: 45px; /* Consistent height */
    font-size: clamp(1.6rem, 1.55rem + 0.13vw, 1.8rem);
    -webkit-appearance: none; /* Remove default webkit styling */
    -moz-appearance: none; /* Remove default Firefox styling */
    appearance: none; /* Standard property */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center; /* Position arrow 10px from right edge */
    background-size: 20px;
    padding-right: 40px; /* Adjust padding to accommodate custom arrow */
}

/* Loading and Error States (Shared with previous styles) */
.bbis-dropdown-widget-wrapper .bbis-dropdown-loading,
.bbis-dropdown-widget-wrapper .bbis-dropdown-error {
    padding: 10px;
    margin-top: 5px;
    border-radius: 4px;
    font-size: 0.9em;
    width: 100%; /* Span full width of its container if placed inside one */
    box-sizing: border-box;
}

.bbis-dropdown-widget-wrapper .bbis-dropdown-loading {
    background-color: #eaf2fa;
    border: 1px solid #c1d9f0;
    color: #31708f;
}

.bbis-dropdown-widget-wrapper .bbis-dropdown-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.bbis-clear-button-wrapper {
    margin-top: 10px;
    text-align: right; /* Align clear button to the right */
}

.bbis-clear-all-dropdowns {
    color: #0073aa;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9em;
}

.bbis-clear-all-dropdowns:hover {
    color: #005075;
}

/* Make the old .dropdown-container display none, as we use .bbis-dropdowns-area now */
.bbis-dropdown-widget-wrapper .dropdown-container {
    display: none;
}

/* Quote Button Styles */
.bbis-quote-button-wrapper {
    margin-top: 30px;
    text-align: center;
}

.bbis-quote-button-large {
    background: #0073aa;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.bbis-quote-button-large:hover {
    background: #005a87;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Disclaimer Styles */
.bbis-disclaimer-wrapper {
    margin-top: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-left: 3px solid #999;
    font-size: 12px;
    line-height: 1.5;
    color: #666;
    border-radius: 0 4px 4px 0;
}

.bbis-disclaimer-wrapper p {
    margin: 0;
    font-style: italic;
}

/* Modal Styles */
body.bbi-modal-open div.bbi-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: block;
}

body.bbi-modal-open div.bbi-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999998;
}

body.bbi-modal-open div.bbi-modal div.bbi-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 999999;
}

body.bbi-modal-open div.bbi-modal div.bbi-modal-content button.bbi-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

body.bbi-modal-open div.bbi-modal div.bbi-modal-content button.bbi-modal-close:hover {
    color: #333;
}

body.bbi-modal-open div.bbi-modal div.bbi-modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

/* --- Star UI Designer Battery Details Area Styles --- */
.bbis-battery-details-area {
    background-color: #ffffff;
    border: 1px solid #e3e6ea; /* Lighter border */
    border-radius: 8px; /* Softer corners */
    padding: 20px;
    margin-top: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Softer, more modern shadow */
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.bbis-battery-details-area:empty {
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
}

.bbis-battery-details-area.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Unified Loader and Error Styling */
.bbis-details-loader,
.bbis-details-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    color: #555;
}

.bbis-details-loader p,
.bbis-details-error p {
    margin-top: 10px;
    font-size: 1em;
}

.bbis-details-error p strong {
    color: #c0392b; /* A more modern red */
}

/* Basic Spinner for Loader */
.bbis-spinner {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid #0073aa; /* WordPress Blue */
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: bbis-spin 1s linear infinite;
}

@keyframes bbis-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Content Card Styling */
.bbis-battery-card-content { /* This is the new main wrapper from JS */
    display: flex;
    flex-direction: column; /* Mobile first: image stacks above text */
    gap: 20px;
}

.bbis-battery-image-container {
    flex: 0 0 auto; /* Don't grow, don't shrink, base size on content */
    text-align: center; /* Center image in mobile view */
    background-color: #f8f9fa; /* Light bg for image area */
    padding: 15px;
    border-radius: 6px;
    align-self: center; /* Center the container itself in mobile */
    width: auto;
    max-width: 250px; /* Control max size of image area */
}

.bbis-battery-image-actual {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block; /* Removes extra space below image */
}

.bbis-battery-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px; /* Or match your expected image size */
    height: 180px;
    background-color: #e9ecef;
    color: #6c757d;
    border-radius: 4px;
    font-size: 0.9em;
}

.bbis-battery-text-content {
    flex: 1 1 auto; /* Allow text content to take available space */
    display: flex;
    flex-direction: column;
}

.bbis-battery-description {
    font-size: 1.4em; /* Larger, more impactful description */
    font-weight: 600; /* Slightly less heavy than bold */
    color: #2c3e50; /* Darker, more modern blue/grey */
    margin-top: 0;
    margin-bottom: 15px;
    line-height: 1.4;
}

.bbis-battery-specifications {
    font-size: 0.95em; /* Slightly larger base for specs */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Responsive columns for specs */
    gap: 10px 20px; /* Row and column gap */
    margin: 0;
    padding: 0;
}

.bbis-spec-item {
    /* background-color: #f8f9fa; */ /* Removed background panel */
    padding: 8px 0; /* Adjust padding - more vertical, less horizontal if no bg */
    /* border-radius: 4px; */ /* No longer needed if no background */
    /* border-left: 3px solid #0073aa; */ /* Removed left accent border */
    border-bottom: 1px solid #e9ecef; /* Subtle separator line */
}

.bbis-battery-specifications .bbis-spec-item:last-child {
    border-bottom: none; /* Remove border from the very last item in the grid */
}

.bbis-spec-item dt {
    font-weight: 600; /* Make term bold */
    color: #34495e; /* Darker spec name */
    margin-bottom: 4px;
    font-size: 0.9em;
    text-transform: uppercase;
}

.bbis-spec-item dd {
    margin: 0;
    color: #555;
}

/* Desktop layout for the card content */
@media (min-width: 768px) { /* Tablet and up */
    .bbis-battery-card-content {
        flex-direction: row; /* Image left, text right */
        align-items: flex-start;
    }

    .bbis-battery-image-container {
        flex-basis: 220px; /* Give image a fixed base width */
        flex-shrink: 0;
        align-self: flex-start; /* Align to top */
         max-width: 220px; /* Control max size of image area */
    }

    .bbis-battery-text-content {
        padding-left: 20px; /* Add some space between image and text */
    }
} 