/**
 * Nivaro Cameldrink Service Boxes Widget Styles
 * Inherits styling patterns from Leatherback widget
 */

/* Main Grid Container */
.cameldrink-widget {
    width: 100%;
}

.cameldrink-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}

/* Service Box */
.cameldrink-service-box {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cameldrink-service-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* Service Image - Updated with frame container support */
.service-image-frame-container,
.cameldrink-service-image {
    width: 100%;
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-image-frame-container img,
.cameldrink-service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Special handling for icon images (usually smaller) */
.service-image-frame-container.using-icon img {
    object-fit: contain;
    padding: 15px;
}

/* Image Subframe Container */
.image-subframe-container {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background: transparent;
    border-radius: 4px;
}

.image-subframe-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cameldrink-service-box:hover .service-image-frame-container img,
.cameldrink-service-box:hover .cameldrink-service-image img,
.cameldrink-service-box:hover .image-subframe-container img {
    transform: scale(1.05);
}

/* Service Content */
.cameldrink-service-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Service Title */
.cameldrink-service-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #333;
    line-height: 1.4;
}

/* Service Title Link */
.cameldrink-title-link {
    color: inherit;
    text-decoration: none;
    display: block;
    transition: color 0.3s ease;
}

.cameldrink-title-link:hover {
    color: #007cba;
    text-decoration: none;
}

.cameldrink-title-link:visited {
    color: inherit;
}

/* Service Short Description */
.cameldrink-service-short-description {
    font-size: 15px;
    line-height: 1.5;
    color: #555;
    margin: 0 0 12px 0;
    font-weight: 500;
}

/* Service Description */
.cameldrink-service-description {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin: 0 0 20px 0;
    flex: 1;
}

/* Service Button Container */
.cameldrink-service-button {
    margin-top: auto;
    padding-top: 15px;
}

/* Service Button */
.cameldrink-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #007cba;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.cameldrink-btn:hover {
    background: #005a87;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 186, 0.3);
}

/* No Services Message */
.cameldrink-no-services {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 8px;
    color: #666;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .cameldrink-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .cameldrink-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* Note: Height is now controlled by widget settings, not CSS */
    
    .cameldrink-service-content {
        padding: 15px;
    }
    
    .cameldrink-service-title {
        font-size: 16px;
    }
    
    .cameldrink-service-description {
        font-size: 13px;
    }
}

/* Force 1 column on mobile devices */
@media (max-width: 767px) {
    .cameldrink-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .cameldrink-service-box {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .cameldrink-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cameldrink-service-box {
        max-width: 100%;
    }
}

/* Editor Preview Styles */
.elementor-editor-active .cameldrink-widget {
    min-height: 200px;
}

/* Loading State */
.cameldrink-widget.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Filter Indicators (for debugging) */
.cameldrink-widget[data-active-filter="yes"] .cameldrink-service-box:not([data-active="1"]) {
    display: none;
}

.cameldrink-widget[data-pinned-filter="yes"] .cameldrink-service-box:not([data-pinned="1"]) {
    display: none;
}

/* Pinned Badge (optional enhancement) */
.cameldrink-service-box[data-pinned="1"] .cameldrink-service-image::after {
    content: "📌";
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Active/Inactive Visual Indicators (optional) */
.cameldrink-service-box[data-active="0"] {
    opacity: 0.7;
}

.cameldrink-service-box[data-active="0"] .cameldrink-service-image::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    z-index: 1;
}