/**
 * ITLife CDEK — Plugin Catalog Archive Styles
 *
 * Design tokens:
 *   Font:       Nunito Sans
 *   Primary:    #032d60
 *   Accent:     #2e844a
 *   Danger:     #e53e3e
 *   Orange:     #dd6b20
 *   Background: #f8fafc
 *   Card BG:    #ffffff
 *   Radius:     16px (cards), 10px (buttons)
 *   Container:  1200px centered
 */

/* =============================================
   HERO SECTION
   ============================================= */

.catalog-hero {
    background: linear-gradient(135deg, #032d60 0%, #064a9a 100%);
    color: #ffffff;
    text-align: center;
    padding: 64px 24px;
}

.catalog-hero__title {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 36px;
    font-weight: 800;
    margin: 0 0 16px;
    line-height: 1.2;
}

.catalog-hero__subtitle {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 18px;
    font-weight: 400;
    margin: 0;
    opacity: 0.85;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* =============================================
   CATALOG GRID
   ============================================= */

.catalog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

/* =============================================
   PLUGIN CARD
   ============================================= */

.plugin-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
    border: 1px solid #e8ecf0;
    border-top: 4px solid #2e844a;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.plugin-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.plugin-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Card — Image / Logo */
.plugin-card__image {
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: #ffffff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.plugin-card__image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.plugin-card:hover .plugin-card__image img {
    transform: scale(1.05);
}

/* Icon placeholder (when no featured image) */
.plugin-card__icon-placeholder {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}

.plugin-card__icon-placeholder .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: rgba(255, 255, 255, 0.9);
}

/* Card — Body */
.plugin-card__body {
    padding: 20px 20px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Card — Title */
.plugin-card__title {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 10px;
    line-height: 1.3;
}

/* Card — Badges row (version + status) */
.plugin-card__meta,
.plugin-card__badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

/* Card — Version badge */
.plugin-card__version {
    display: inline-block;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    background: #f0f4f8;
    color: #64748b;
    padding: 2px 10px;
    border-radius: 20px;
    line-height: 1.6;
}

/* Card — Status badges */
.plugin-card__status {
    display: inline-block;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    line-height: 1.6;
    letter-spacing: 0.2px;
}

.plugin-card__status.badge-green {
    background: #dcfce7;
    color: #15803d;
}

.plugin-card__status.badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.plugin-card__status.badge-orange {
    background: #fff7ed;
    color: #c2410c;
}

.plugin-card__status.badge-grey {
    background: #f1f5f9;
    color: #94a3b8;
}

/* Card — Excerpt */
.plugin-card__excerpt {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Card — Rating */
.plugin-card__rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.plugin-card__rating .star {
    color: #f59e0b;
    font-size: 15px;
    line-height: 1;
}

.plugin-card__rating .star--empty {
    color: #e2e8f0;
}

.plugin-card__rating .rating-count,
.plugin-card__rating-count,
.plugin-card__rating-text {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 12px;
    color: #94a3b8;
    margin-left: 4px;
}

/* Price — free variant */
.plugin-card__price .price-free {
    color: #2e844a;
    font-weight: 700;
}

/* Card — Footer (price + action) */
.plugin-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding: 14px 20px 18px;
    border-top: 1px solid #f1f5f9;
    gap: 8px;
}

/* Card — Price */
.plugin-card__price {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    white-space: nowrap;
}

/* Card — Action button */
.plugin-card__action,
.plugin-card__btn,
.plugin-card a.plugin-card__action {
    display: inline-flex;
    align-items: center;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff !important;
    background: linear-gradient(135deg, #38a05a 0%, #2e844a 100%);
    border: none;
    border-radius: 10px;
    padding: 9px 18px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(46, 132, 74, 0.25);
    flex-direction: row;
    height: auto;
}

.plugin-card__action:hover,
.plugin-card__btn:hover,
.plugin-card a.plugin-card__action:hover {
    background: linear-gradient(135deg, #2e844a 0%, #22723d 100%);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 132, 74, 0.35);
}

.plugin-card__action:active,
.plugin-card__btn:active {
    transform: translateY(0);
}

/* =============================================
   COMING SOON MODIFIER
   ============================================= */

.plugin-card--coming-soon {
    position: relative;
    border-top-color: #cbd5e1;
    border-color: #e2e8f0;
}

.plugin-card--coming-soon .plugin-card__image {
    opacity: 0.35;
    filter: grayscale(100%);
}

.plugin-card--coming-soon .plugin-card__body {
    opacity: 0.4;
}

.plugin-card--coming-soon .plugin-card__footer {
    opacity: 0;
}

.plugin-card--coming-soon::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.7) 50%, rgba(255,255,255,0.95) 100%);
    pointer-events: none;
    z-index: 1;
}

.plugin-card--coming-soon::before {
    content: "Скоро";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Nunito Sans', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    padding: 10px 32px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    pointer-events: none;
    z-index: 3;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    text-transform: uppercase;
}

.plugin-card--coming-soon:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
}

/* =============================================
   COLOR-STRIP VARIANTS
   ============================================= */

.plugin-card--green  { border-top-color: #2e844a; }
.plugin-card--blue   { border-top-color: #032d60; }
.plugin-card--orange { border-top-color: #dd6b20; }
.plugin-card--red    { border-top-color: #e53e3e; }

/* =============================================
   RESPONSIVE — TABLET (max 900px)
   ============================================= */

@media (max-width: 900px) {
    .catalog-hero {
        padding: 48px 20px;
    }

    .catalog-hero__title {
        font-size: 28px;
    }

    .catalog-hero__subtitle {
        font-size: 16px;
    }

    .catalog-container {
        padding: 32px 20px;
    }

    .catalog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* =============================================
   RESPONSIVE — MOBILE (max 480px)
   ============================================= */

@media (max-width: 480px) {
    .catalog-hero {
        padding: 36px 16px;
    }

    .catalog-hero__title {
        font-size: 24px;
    }

    .catalog-hero__subtitle {
        font-size: 15px;
    }

    .catalog-container {
        padding: 24px 16px;
    }

    .catalog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .plugin-card__image {
        height: 160px;
    }

    .plugin-card__body {
        padding: 20px;
    }

    .plugin-card__footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        text-align: center;
    }

    .plugin-card__action {
        justify-content: center;
    }
}
