/**
 * "Why Shop from Ratna Gems?" Trust Section
 *
 * Full-width section rendered before the footer via astra_footer_before.
 * 4-card grid with icons, hover effects, and responsive layout.
 *
 * @package Ratna_Gems
 * @since   3.6.0
 */

/* ==========================================================================
   Section Wrapper (full-width background)
   ========================================================================== */

.rg-why-us {
    background: #f4f8fd;
    padding: clamp(3rem, 6vw, 5rem) 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* Inner container (content max-width) */
.rg-why-us-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================================================
   Header
   ========================================================================== */

.rg-why-us-header {
    text-align: center;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
    padding-bottom: 1.25rem;
    position: relative;
}

.rg-why-us-header h2 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.6rem, 1.2rem + 1vw, 2.25rem);
    color: var(--ast-global-color-0, #004e81);
    font-weight: 700;
    line-height: 1.2;
    text-wrap: balance;
}

.rg-why-us-header p {
    margin: 0 auto;
    max-width: 650px;
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.15rem);
    color: #4a5568;
    line-height: 1.6;
}

/* Decorative gold accent line */
.rg-why-us-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: #d4af37;
    border-radius: 2px;
}

/* ==========================================================================
   Grid
   ========================================================================== */

.rg-why-us-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(1rem, 2vw, 2rem);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.rg-why-us-card {
    background: #fff;
    padding: 2rem 1.5rem;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07),
                0 2px 4px -1px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Top accent bar — animates in on hover */
.rg-why-us-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--ast-global-color-0, #004e81);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.rg-why-us-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    color: #1a202c;
    font-weight: 600;
}

.rg-why-us-card p {
    margin: 0;
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.65;
    flex-grow: 1;
}

/* ==========================================================================
   Icon Circle
   ========================================================================== */

.rg-why-us-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1.25rem;
    background: #f4f8fd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.rg-why-us-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ==========================================================================
   Hover Effects (motion-safe only)
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
    .rg-why-us-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 10px 15px -3px rgba(0, 78, 129, 0.1),
                    0 4px 6px -2px rgba(0, 78, 129, 0.05);
    }

    .rg-why-us-card:hover::before {
        transform: scaleX(1);
    }

    .rg-why-us-card:hover .rg-why-us-icon {
        transform: scale(1.08);
        background-color: #e0f0ff;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .rg-why-us-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .rg-why-us {
        padding: 2rem 0.75rem;
    }

    .rg-why-us-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }

    .rg-why-us-header p {
        font-size: 0.92rem;
    }

    .rg-why-us-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .rg-why-us-card {
        padding: 0.85rem 0.65rem 0.75rem;
        border-radius: 0.75rem;
    }

    /* Top accent bar always visible on mobile — trust signal */
    .rg-why-us-card::before {
        transform: scaleX(1);
        background: linear-gradient(90deg, var(--ast-global-color-0, #004e81), #d4af37);
    }

    .rg-why-us-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 0.5rem;
        padding: 8px;
    }

    .rg-why-us-card h3 {
        font-size: 0.82rem;
        margin-bottom: 0.2rem;
        line-height: 1.25;
    }

    .rg-why-us-card p {
        font-size: 0.78rem;
        line-height: 1.45;
    }
}
