.smrtsp-cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px;
    width: 100%;
}

.smrtsp-cert-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,.08);
    display: flex;
    flex-direction: column;
    transition: all .25s ease;
    height: 100%;
    position: relative;
}

.smrtsp-cert-card:hover {
    transform: translateY(-4px);
}

/* IMAGE AREA */
.smrtsp-cert-image {
    position: relative;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 450px; 
    overflow: hidden;
    min-height: 200px;
    padding-bottom: 30px; 
}

.smrtsp-cert-image img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* NEW RIBBON STYLE (Top Left Triangle) */
.smrtsp-new-ribbon {
    position: absolute;
    top: 0;
    left: 0;
    background: #ff4757; /* لون أحمر */
    color: #fff;
    width: 100px;
    height: 100px;
    /* قص الشكل ليصبح مثلثاً في الزاوية العلوية اليسرى */
    clip-path: polygon(0 0, 100% 0, 0 100%);
    z-index: 20; 
    /* محاذاة النص داخل المثلث */
    display: flex;
    align-items: center;
    justify-content: center;
    /* تدوير وموضع النص */
    transform: translate(-15px, -15px) rotate(-45deg);
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: -2px 2px 4px rgba(0,0,0,0.2); /* ظل خفيف */
}

/* CERTIFICATE TYPE (BADGE) */
.smrtsp-cert-type {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: #1f6f5c;
    color: #fff;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 5;
}

/* BODY */
.smrtsp-cert-body {
    padding: 25px 28px 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* TITLE */
.smrtsp-cert-title {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 12px;
    color: #1f3f3a;
    font-family: inherit;
}

/* ISSUER */
.smrtsp-cert-issuer {
    font-size: 16px;
    color: #666;
    margin-bottom: 18px;
    font-family: inherit;
}

/* BUTTON */
.smrtsp-btn {
    background: #1f6f5c;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
}

.smrtsp-lightbox {
    cursor: pointer;
}

/* =========================================
   LIGHTBOX GALLERY STYLES
   ========================================= */

.smrtsp-lb-top-controls { position: absolute; top: 20px; right: 20px; z-index: 10002; }
.smrtsp-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.1); backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,0.3); color: #fff; width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 24px; transition: all 0.3s ease; user-select: none; z-index: 10001; }
.smrtsp-nav-btn:hover { background: #fff; color: #000; transform: translateY(-50%) scale(1.1); }
.smrtsp-prev { left: 20px; }
.smrtsp-next { right: 20px; }
.smrtsp-close-btn { background: rgba(255, 255, 255, 0.2); backdrop-filter: blur(5px); border: 1px solid rgba(255, 255, 255, 0.5); color: #fff; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 24px; transition: all 0.3s ease; }
.smrtsp-close-btn:hover { background: #fff; color: #000; transform: rotate(90deg); }

/* Responsive */
@media (max-width: 900px) {
    .smrtsp-cert-grid { grid-template-columns: 1fr 1fr !important; gap: 20px; }
}

@media (max-width: 600px) {
    .smrtsp-cert-grid { grid-template-columns: 1fr !important; gap: 20px; padding: 0 10px; }
    .smrtsp-cert-body { padding: 20px 15px 20px; }
    .smrtsp-cert-image { max-height: 300px !important; padding: 15px; padding-bottom: 25px; min-height: 180px; }
    .smrtsp-cert-type { padding: 6px 12px; border-radius: 6px; font-size: 12px; }
    
    .smrtsp-new-ribbon { 
        width: 80px; 
        height: 80px; 
        font-size: 11px; 
        transform: translate(-12px, -12px) rotate(-45deg);
    }
    
    .smrtsp-cert-title { font-size: 18px; margin-bottom: 8px; }
    .smrtsp-cert-issuer { font-size: 14px; margin-bottom: 15px; }
    .smrtsp-btn { width: 100%; padding: 12px 0; }
}