/* Main Container */
.ral-catalog-container {
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    font-family: inherit;
    /* Resets to theme font */
}

/* Sticky Header Wrapper */
.ral-sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    padding: 10px 0 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    /* Subtle separator */
}

/* Search Bar - Apple Style */
.ral-search-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.ral-search-input {
    width: 100%;
    padding: 12px 20px 12px 50px;
    /* Increased padding to prevent overlap with icon */
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    background-color: #f9f9f9;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

.ral-search-input:focus {
    background-color: #fff;
    border-color: #007aff;
    /* Apple Blue or Theme Color */
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.ral-search-icon {
    position: absolute;
    left: 18px;
    /* Adjusted position */
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    display: flex;
    /* Ensure SVG centering */
    align-items: center;
}

@media (max-width: 767px) {
    .ral-search-input {
        padding: 10px 15px 10px 45px;
        font-size: 14px;
    }

    .ral-search-icon {
        left: 15px;
    }

    .ral-search-icon svg {
        width: 16px;
        height: 16px;
    }
}

/* Filter Bar */
.ral-filter-wrapper {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
    margin-bottom: 15px;
    /* Add spacing below filter */
}

.ral-filter-wrapper::-webkit-scrollbar {
    display: none;
}

.ral-filter-bar {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    padding: 2px 5px;
    /* Little padding safe area */
}

.ral-filter-btn {
    cursor: pointer;
    border: 1px solid #eee;
    background: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    /* Pill shape */
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.2s ease;
}

.ral-filter-btn:hover {
    background: #f5f5f5;
    transform: translateY(-1px);
}

.ral-filter-btn.active {
    background-color: #333;
    /* Default active, overridden by Elementor */
    color: #fff;
    border-color: #333;
}

/* Grid - Robust CSS Grid */
.ral-grid {
    display: grid;
    /* Columns set via Elementor (repeat(4, 1fr)) */
    /* Gap set via Elementor */
    width: 100%;
}

/* Card */
.ral-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    /* Intended for whole card click */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    background: #fff;
    /* Border, Radius, Shadow set via Elementor */
}

/* Hover Effect for Card */
.ral-card:hover {
    transform: translateY(-5px);
}

.ral-color-preview {
    height: 160px;
    width: 100%;
    position: relative;
    /* Background color set inline */
}

/* Copy Overlay */
.ral-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.15);
    /* Slight dark overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ral-card:hover .ral-overlay {
    opacity: 1;
}

.ral-copy-btn {
    cursor: pointer;
    border: none;
    background: #fff;
    color: #333;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.ral-card:hover .ral-copy-btn {
    transform: translateY(0);
}

.ral-copy-btn:hover {
    background: #f0f0f0;
}

.ral-copy-btn.copied {
    background: #4cd964;
    /* Success Green */
    color: #fff;
}

.ral-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ral-code {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.ral-name {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

.ral-desc {
    font-size: 0.9rem;
    color: #888;
    line-height: 1.4;
    margin-top: 5px;
}

/* Socials */
.ral-socials {
    margin-top: auto;
    padding-top: 15px;
    display: flex;
    gap: 12px;
}

.ral-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #999;
    /* Default gray */
    transition: all 0.2s;
    text-decoration: none !important;
}

.ral-social-link svg {
    display: block;
    /* Removes extra vertical space */
}

/* Specific Colors on Hover if not overridden by Elementor */
.ral-social-link.ral-whatsapp:hover {
    color: #25D366;
}

.ral-social-link.ral-facebook:hover {
    color: #1877F2;
}

.ral-social-link.ral-mail:hover {
    color: #555;
}

/* Utility */
.ral-hidden {
    display: none !important;
}