/**
 * Reassurance Module - Frontend styles
 * 
 * @author    Woohoo.pl
 * @copyright 2025 Woohoo.pl
 * @license   https://opensource.org/licenses/AFL-3.0
 */

/* =============================================
   Base reassurance block container
   ============================================= */
.wh-reassurance {
    box-sizing: border-box;
    padding: 15px 0;
}

/* =============================================
   List container - flexbox layout
   ============================================= */
.wh-reassurance__list {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 15px;
}

/* =============================================
   Layout variants
   ============================================= */

/* Row: all items in one line (default) */
.wh-reassurance--row .wh-reassurance__list {
    flex-direction: row;
    justify-content: center;
}

.wh-reassurance--row .wh-reassurance__item {
    flex: 1 1 0;
    min-width: 0;
}

/* Column: items stacked vertically */
.wh-reassurance--column .wh-reassurance__list {
    flex-direction: column;
}

.wh-reassurance--column .wh-reassurance__item {
    flex: 0 0 auto;
}

/* Grid 2 columns */
.wh-reassurance--grid-2 .wh-reassurance__item {
    flex: 0 0 calc(50% - 8px);
}

/* Grid 3 columns */
.wh-reassurance--grid-3 .wh-reassurance__item {
    flex: 0 0 calc(33.333% - 10px);
}

/* Grid 4 columns */
.wh-reassurance--grid-4 .wh-reassurance__item {
    flex: 0 0 calc(25% - 12px);
}

/* =============================================
   Item card
   ============================================= */
.wh-reassurance__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    box-sizing: border-box;
    text-align: left;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

/* Link variant - whole tile */
a.wh-reassurance__item--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.wh-reassurance__item--link:hover {
    background-color: rgba(0, 0, 0, 0.03);
    text-decoration: none;
    color: inherit;
}

/* Link variant - text only */
.wh-reassurance__text-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wh-reassurance__text-link:hover {
    text-decoration: underline;
    color: inherit;
}

/* =============================================
   Icon
   ============================================= */
.wh-reassurance__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    font-size: 24px;
    line-height: 1;
    color: #333;
}

.wh-reassurance__icon i {
    font-size: 24px;
    line-height: 1;
}

.wh-reassurance__icon img.wh-reassurance-icon-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* =============================================
   Text area
   ============================================= */
.wh-reassurance__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.wh-reassurance__title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
}

.wh-reassurance__subtitle {
    display: block;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
    color: #777;
}

/* =============================================
   Responsive visibility
   ============================================= */
.wh-desktop-only {
    display: flex;
}

.wh-mobile-only {
    display: none;
}

/* =============================================
   Tablet (769px - 1024px)
   ============================================= */
@media (min-width: 769px) and (max-width: 1024px) {
    .wh-reassurance--grid-4 .wh-reassurance__item {
        flex: 0 0 calc(50% - 8px);
    }

    .wh-desktop-only {
        display: flex;
    }

    .wh-mobile-only {
        display: none;
    }
}

/* =============================================
   Mobile (max-width: 768px)
   ============================================= */
@media (max-width: 768px) {
    .wh-desktop-only {
        display: none !important;
    }

    .wh-mobile-only {
        display: flex !important;
    }

    /* On mobile, all layouts become 2-column grid */
    .wh-reassurance--row .wh-reassurance__list,
    .wh-reassurance--grid-3 .wh-reassurance__list,
    .wh-reassurance--grid-4 .wh-reassurance__list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .wh-reassurance--row .wh-reassurance__item,
    .wh-reassurance--grid-3 .wh-reassurance__item,
    .wh-reassurance--grid-4 .wh-reassurance__item {
        flex: 0 0 calc(50% - 8px);
    }

    .wh-reassurance--grid-2 .wh-reassurance__item {
        flex: 0 0 calc(50% - 8px);
    }

    /* Column layout stays as column on mobile */
    .wh-reassurance--column .wh-reassurance__list {
        flex-direction: column;
    }

    .wh-reassurance--column .wh-reassurance__item {
        flex: 0 0 auto;
    }

    /* Slightly smaller on mobile */
    .wh-reassurance__item {
        padding: 10px 12px;
        gap: 8px;
    }

    .wh-reassurance__icon {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }

    .wh-reassurance__icon i {
        font-size: 20px;
    }

    .wh-reassurance__title {
        font-size: 13px;
    }

    .wh-reassurance__subtitle {
        font-size: 11px;
    }
}

/* =============================================
   Very small mobile (max-width: 480px)
   ============================================= */
@media (max-width: 480px) {
    .wh-reassurance__item {
        flex-direction: column;
        text-align: center;
        padding: 10px 8px;
        gap: 6px;
    }

    .wh-reassurance__text {
        align-items: center;
    }
}
