/* Base styles for all cards */
.acme-service-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    margin: 0 -10px;
    padding: 20px 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

.acme-card {
    flex: 1 1 auto;
    min-width: 250px;
    max-width: 320px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    margin: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    display: flex;
    flex-direction: column;
}

.acme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}

.swiper,
.swiper-container {
    width: 100%;
    height: 180px;
    /* Slightly taller for better visual */
    position: relative;
}

.swiper-wrapper {
    display: flex;
}

.swiper-slide {
    width: 100%;
    height: 180px;
    flex-shrink: 0;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.acme-card h3 {
    padding: 15px 15px 5px;
    margin: 0;
    font-size: 1.25em;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.3;
}

.acme-card .info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.acme-card .meta {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.acme-card .toggle-details {
    color: #0073aa;
    cursor: pointer;
    display: inline-block;
    margin-top: auto;
    /* Push to bottom if needed */
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.acme-card .toggle-details:hover {
    color: #005177;
    text-decoration: underline;
}

.acme-card .details {
    display: none;
    font-size: 0.9em;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    color: #555;
}

.acme-card .details ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.acme-card .details ul li {
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

/* Updated Arrow Buttons */
.swiper-button-next,
.swiper-button-prev {
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 14px;
    font-weight: bold;
}

.spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 10;
}

.spinner img {
    width: 40px;
    height: 40px;
}

@media (max-width: 768px) {
    .acme-card {
        min-width: 180px;
        max-width: 100%;
    }

    .swiper,
    .swiper-container {
        height: 150px;
    }

    .swiper-slide {
        height: 150px;
    }

    .acme-card h3 {
        font-size: 1em;
    }

    .acme-card .info {
        padding: 8px;
    }
}

/* Style 1: Minimal */
.style-1 .acme-card {
    border: 1px solid #e0e0e0;
    box-shadow: none;
}

.style-1 .acme-card h3 {
    background: #f5f5f5;
    font-weight: 500;
    color: #333;
}

.style-1 .acme-card .info {
    background: #fafafa;
}

.style-1 .swiper-button-next,
.style-1 .swiper-button-prev {
    background: rgba(255, 255, 255, 0.5);
    color: #333;
}

/* Style 2: Modern */
.style-2 .acme-card {
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
}

.style-2 .acme-card h3 {
    background: #0073aa;
    color: #fff;
    font-weight: 600;
}

.style-2 .acme-card .info {
    background: transparent;
}

.style-2 .acme-card .meta {
    color: #444;
}

.style-2 .swiper-button-next,
.style-2 .swiper-button-prev {
    background: #0073aa;
    color: #fff;
}

/* Style 3: Classic */
.style-3 .acme-card {
    border: 2px solid #d4af37;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    background: #fff;
}

.style-3 .acme-card h3 {
    background: #d4af37;
    color: #fff;
    font-family: 'Georgia', serif;
    font-weight: bold;
}

.style-3 .acme-card .info {
    background: #fffde7;
    border-top: 1px solid #d4af37;
}

.style-3 .acme-card .meta {
    color: #666;
    font-style: italic;
}

.style-3 .swiper-button-next,
.style-3 .swiper-button-prev {
    background: #d4af37;
    color: #fff;
}

/* Popup Styles */
.acme-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.acme-popup-overlay.active {
    display: flex;
    /* Flex handles centering */
    opacity: 1;
}

.acme-popup-content {
    background: #fff;
    padding: 5px;
    border-radius: 3px;
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.acme-popup-overlay.active .acme-popup-content {
    transform: translateY(0);
}

.acme-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    line-height: 1;
    transition: color 0.2s;
}

.acme-popup-close:hover {
    color: #333;
}

.acme-enquire-btn,
.acme-enquire-preview-btn {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    margin-top: 15px;
    width: 100%;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.acme-enquire-btn:hover,
.acme-enquire-preview-btn:hover {
    background-color: #005177;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.4);
}

/* Loader CSS */
.acme-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    border-radius: 10px;
}

.acme-loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: acme-spin 1s linear infinite;
}

@keyframes acme-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.acme-slider-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Slider View Logic */
.acme-service-grid.acme-view-slider,
.acme-slider-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 30px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    cursor: grab;
    scroll-behavior: smooth;
    gap: 20px;
    align-items: flex-start;
    box-sizing: border-box;
    max-width: 100%;
}

.acme-service-grid.acme-view-slider.active,
.acme-slider-container.active {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
}

.acme-service-grid.acme-view-slider::-webkit-scrollbar,
.acme-slider-container::-webkit-scrollbar {
    display: none;
}

.acme-service-grid.acme-view-slider .acme-card-wrapper,
.acme-slider-container .acme-card-wrapper {
    flex: 0 0 300px !important;
    width: 300px !important;
    max-width: 300px !important;
    margin-right: 0;
    scroll-snap-align: center;
    box-sizing: border-box;
    display: block !important;
}

.acme-service-grid.acme-view-slider .acme-card,
.acme-slider-container .acme-card {
    width: 100%;
    margin: 0 !important;
    max-width: none !important;
    height: auto !important;
}

/* Glassmorphism Nav Buttons */
.acme-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #333;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.acme-nav-btn:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.acme-nav-prev {
    left: 10px;
}

.acme-nav-next {
    right: 10px;
}

/* Load More Button */
.acme-load-more-container {
    text-align: center;
    margin-top: 30px;
    width: 100%;
    clear: both;
}

#acme-load-more-btn {
    padding: 12px 28px;
    cursor: pointer;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#acme-load-more-btn:hover {
    background: #005177;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Hide disabled swiper navigation buttons */
.swiper-button-disabled {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

#acme-load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Load More Card Specifics */
.acme-load-more-card {
    background: #fdfdfd !important;
    border: 2px dashed #e0e0e0 !important;
    box-shadow: none !important;
    transition: background 0.3s ease;
}

.acme-load-more-card:hover {
    background: #f0f0f0 !important;
    border-color: #ccc !important;
}

/* --- Modal Styles --- */
.acme-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 100000;
    /* Ensure it is above WP Admin Bar (which is 99999) */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.acme-modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    animation: acmeSlideUp 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes acmeSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.acme-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    z-index: 10;
    transition: color 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.acme-modal-close:hover {
    color: #000;
    background: #f0f0f0;
}

.acme-modal-body {
    padding: 30px;
}

/* CF7 styling overrides for modal */
.acme-modal-body form {
    margin: 0;
}

.acme-modal-body input[type="text"],
.acme-modal-body input[type="email"],
.acme-modal-body input[type="tel"],
.acme-modal-body textarea,
.acme-modal-body select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
}

.acme-modal-body input[type="submit"] {
    background: #333;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: background 0.3s;
    width: 100%;
}

.acme-modal-body input[type="submit"]:hover {
    background: #000;
}

@media (max-width: 600px) {
    .acme-modal-content {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }

    .acme-modal-close {
        top: 10px;
        right: 10px;
    }
}

/* Hide slider navigation when only 1 card exists */
.acme-service-grid.acme-view-slider .acme-card-wrapper:first-child:last-child~.swiper-button-prev {
    display: none !important;
}

/* Single Page Overrides */
.acme-single-card-container .acme-gallery-section .swiper-container,
.acme-single-card-container .acme-gallery-section .swiper-slide {
    height: auto !important;
    min-height: 250px;
}

.acme-single-card-container .acme-gallery-section .swiper-slide img {
    height: auto !important;
    max-height: 600px;
    /* Prevent overly tall images */
    object-fit: contain;
    background: #f0f0f0;
}



/* Single Page Responsive Stacking */
@media (max-width: 768px) {
    .acme-hero-section {
        flex-direction: column;
    }

    .acme-gallery-section,
    .acme-specs-section {
        flex: 1 1 100% !important;
        min-width: 100% !important;
    }

    .acme-description-section {
        padding: 0 10px;
    }

    .acme-sticky-title {
        font-size: 0.9rem;
    }
}


/* Archive Pagination */
.acme-pagination {
    margin-top: 50px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.acme-pagination .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.2s ease;
}

.acme-pagination .page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.acme-pagination .page-numbers:hover:not(.current) {
    background: #f0f0f0;
    border-color: #ccc;
}

/* Modern Sticky Specs Box */
.acme-specs-box {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    /* Soft diffuse shadow */
    position: sticky;
    position: -webkit-sticky;
    top: 100px;
    /* Space from top */
    z-index: 100;
    overflow: hidden;
    /* Clips children to rounded corners */
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    max-height: calc(100vh - 120px);
    /* Viewport constraint */
    display: flex;
    flex-direction: column;
}

.acme-specs-box:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.12);
    /* Lift effect */
    transform: translateY(-2px);
}

.acme-specs-image {
    width: 100%;
    height: 220px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.acme-specs-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.acme-specs-box:hover .acme-specs-image img {
    transform: scale(1.08);
    /* Subtle zoom */
}

.acme-specs-content {
    padding: 5px 10px;
    /* Compact padding */
    overflow-y: auto;
    /* Internal scrolling */
    flex-grow: 1;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.acme-specs-content::-webkit-scrollbar {
    width: 6px;
}

.acme-specs-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.acme-specs-content::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.acme-specs-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 15px;
    letter-spacing: -0.02em;
}

.acme-specs-content ul {
    gap: 0;
    /* Row Gap, Col Gap */
    display: flex;
    flex-wrap: wrap;
    /* Strict 2 Cols */
    width: 100%;
}

.acme-specs-content li {
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
    /* Lighter solid border */
    display: flex;
    flex-direction: row;
    /* Horizontal: Label : Value */
    justify-content: space-between;
    align-items: center;
    /* Align text baseline */
    gap: 10px;
    min-width: 0;
    /* Prevent Flex/Grid blowout */
    width: 100%;
    /* Force 1 Column */
    box-sizing: border-box;
    /* Include padding/border in width */
}

/* Values: Ensure wrapping */
.acme-specs-content li span {
    color: #0f172a;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.3;
    word-wrap: break-word;
    flex: 1;
    /* Take remaining space */
    text-align: right;
    /* Align value to right */
    font-size: 1.1rem;
}

/* Remove border from last item only */
.acme-specs-content li:last-of-type {
    border-bottom: none;
}

/* Price row is separate (last-child) */
.acme-specs-content li:last-child {
    border-bottom: none;
    grid-column: 1 / -1;
    /* Keeps it safe if grid is re-enabled */
    width: 100%;
    /* Force full width in Flex */
    flex-direction: row;
    justify-content: center;
    /* Centered */
    align-items: center;
    gap: 15px;
    /* Spacing between label and price */
    border-top: 2px solid #f1f5f9;
    padding-top: 15px;
    margin-top: 5px;
}

/* Price Highlight */
.acme-specs-content .price-display {
    color: #0073aa;
    font-weight: 800 !important;
    font-size: 1.5rem;
}

/* Enquire Button Modernization */
.acme-view-more-btn {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: #fff;
    border: none;
    padding: 16px;
    font-size: 1.3rem;
    cursor: pointer;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 115, 170, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 100%;
    margin-top: 10px;
}

.acme-view-more-btn:hover {
    background: linear-gradient(135deg, #005177 0%, #003650 100%);
    box-shadow: 0 8px 15px rgba(0, 115, 170, 0.3);
    transform: translateY(-2px);
}

.acme-view-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
}