/* ===========================
   CERTIFICATE DETAIL PAGE
   White + Red Premium Theme
   Professional Extended Version
=========================== */

:root {
    --certificate-red: #c1121f;
    --certificate-red-dark: #9b0d18;
    --certificate-red-deep: #7f0a13;
    --certificate-red-light: #e63946;
    --certificate-red-soft: rgba(193, 18, 31, 0.08);
    --certificate-red-soft-2: rgba(193, 18, 31, 0.04);

    --certificate-text: #1f2937;
    --certificate-text-soft: #4b5563;
    --certificate-text-muted: #6b7280;
    --certificate-heading: #111827;

    --certificate-bg: #ffffff;
    --certificate-bg-soft: #fff8f8;
    --certificate-bg-alt: #fcfcfd;

    --certificate-border: rgba(193, 18, 31, 0.12);
    --certificate-border-strong: rgba(193, 18, 31, 0.18);
    --certificate-border-neutral: rgba(17, 24, 39, 0.08);

    --certificate-shadow: 0 20px 50px rgba(17, 24, 39, 0.08);
    --certificate-shadow-soft: 0 14px 38px rgba(17, 24, 39, 0.05);
    --certificate-shadow-hover: 0 28px 70px rgba(193, 18, 31, 0.12);
    --certificate-shadow-card: 0 20px 40px rgba(0, 0, 0, 0.03);
    --certificate-shadow-strong: 0 30px 80px rgba(17, 24, 39, 0.10);

    --certificate-radius: 28px;
    --certificate-radius-lg: 32px;
    --certificate-radius-xl: 40px;
    --certificate-radius-pill: 999px;

    --certificate-transition: all 0.35s ease;
    --certificate-transition-slow: all 0.5s ease;
    --certificate-transition-smooth: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);

    --certificate-container: 1180px;
    --certificate-container-wide: 1240px;

    --certificate-space-2xs: 6px;
    --certificate-space-xs: 10px;
    --certificate-space-sm: 14px;
    --certificate-space-md: 18px;
    --certificate-space-lg: 24px;
    --certificate-space-xl: 32px;
    --certificate-space-2xl: 48px;
    --certificate-space-3xl: 64px;
    --certificate-space-4xl: 88px;

    --certificate-font-base: "Inter", "Segoe UI", Tahoma, sans-serif;
}

/* ===========================
   Base / Reset
=========================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body,
.certificate-page-body {
    margin: 0;
    padding: 0;
    font-family: var(--certificate-font-base);
    background:
        radial-gradient(circle at top left, rgba(193, 18, 31, 0.05), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #fff8f8 100%);
    color: var(--certificate-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

::selection {
    background: rgba(193, 18, 31, 0.16);
    color: var(--certificate-heading);
}

/* ===========================
   Shared Utility / Structural Helpers
=========================== */

.certificate-page {
    width: 100%;
    position: relative;
    isolation: isolate;
}

.certificate-page::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -120px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(193, 18, 31, 0.08), transparent 70%);
    filter: blur(10px);
    z-index: -1;
}

.certificate-page::after {
    content: "";
    position: absolute;
    bottom: 5%;
    left: -120px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(193, 18, 31, 0.06), transparent 72%);
    filter: blur(8px);
    z-index: -1;
}

.certificate-container,
.cert-container {
    width: 100%;
    max-width: var(--certificate-container);
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.certificate-container-wide {
    width: 100%;
    max-width: var(--certificate-container-wide);
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* ===========================
   Loader
=========================== */

.page-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.96);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    backdrop-filter: blur(4px);
}

.page-loader.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-ring {
    width: 62px;
    height: 62px;
    border: 4px solid rgba(193, 18, 31, 0.15);
    border-top: 4px solid var(--certificate-red);
    border-radius: 50%;
    animation: certificateSpin 0.9s linear infinite;
    margin-bottom: 16px;
    box-shadow: 0 0 0 8px rgba(193, 18, 31, 0.03);
}

.page-loader p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--certificate-red);
    letter-spacing: 0.04em;
}

@keyframes certificateSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ===========================
   Primary Hero Layout
=========================== */

/* اصلاح لایه‌بندی برای نمایش قطعی عکس */
.certificate-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 80px 0;
    position: relative;
    z-index: 1; /* ایجاد یک context جدید */
}

.certificate-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    /* این لایه را به عقب می‌بریم تا روی محتوا نباشد */
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.7));
    pointer-events: none;
    z-index: -1; 
}

.certificate-container {
    position: relative;
    z-index: 2; /* محتوا باید بالاتر از background باشد */
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 56px;
    align-items: center;
}

/* اطمینان از ابعاد درست باکس عکس */
.visual-box, .certificate-image-wrap {
    width: 100%;
    height: auto;
    min-height: 450px; /* حداقل ارتفاع برای نمایش */
    background-color: #f0f0f0; /* رنگ رزرو برای وقتی که عکس هنوز لود نشده */
    display: block;
    z-index: 3;
}

.cert-image, .certificate-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* کشیده نشدن عکس */
    display: block;
}

.certificate-image-wrap::before,
.visual-box::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.00) 0%,
            rgba(193, 18, 31, 0.04) 100%
        );
    z-index: 1;
    pointer-events: none;
}

.certificate-image-wrap::after,
.visual-box::after {
    content: "";
    position: absolute;
    inset: auto auto 0 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(193, 18, 31, 0.10), transparent 70%);
    z-index: 1;
    pointer-events: none;
}

.certificate-image-wrap:hover,
.visual-box:hover {
    transform: translateY(-10px);
    box-shadow: var(--certificate-shadow-hover);
    border-color: var(--certificate-border-strong);
}

.certificate-image {
    width: 100%;
    height: 100%;
    min-height: 420px;
    max-height: 680px;
    object-fit: cover;
    display: block;
    transition: transform 0.7s ease;
    position: relative;
    z-index: 0;
}

.certificate-image-wrap:hover .certificate-image,
.visual-box:hover .certificate-image,
.visual-box:hover img {
    transform: scale(1.045);
}

.visual-box img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* ===========================
   Content Block
=========================== */

.certificate-content,
.cert-content-wrap,
.cert-content-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.certificate-badge,
.cert-badge,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    background: var(--certificate-red-soft);
    color: var(--certificate-red);
    padding: 10px 16px;
    border-radius: var(--certificate-radius-pill);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 18px;
    border: 1px solid rgba(193, 18, 31, 0.14);
    box-shadow: 0 8px 20px rgba(193, 18, 31, 0.04);
    backdrop-filter: blur(6px);
}

.certificate-badge::before,
.cert-badge::before,
.badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--certificate-red);
    box-shadow: 0 0 0 6px rgba(193, 18, 31, 0.10);
}

.certificate-title,
.main-title,
.cert-content-wrap h1 {
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    line-height: 1.02;
    margin: 0 0 18px;
    font-weight: 900;
    color: var(--certificate-red);
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.certificate-short-description,
.short-desc,
.cert-content-wrap p {
    font-size: 1.08rem;
    line-height: 2;
    color: var(--certificate-text-soft);
    margin: 0 0 26px;
    max-width: 720px;
}

.certificate-short-description strong,
.short-desc strong {
    color: var(--certificate-heading);
    font-weight: 800;
}

/* ===========================
   Long Description Card
=========================== */

.certificate-long-description,
.long-desc-card {
    background: #ffffff;
    border: 1px solid var(--certificate-border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--certificate-shadow-soft);
    transition: var(--certificate-transition-smooth);
    position: relative;
    overflow: hidden;
}

.certificate-long-description::before,
.long-desc-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--certificate-red),
        #d62839,
        rgba(214, 40, 57, 0.4)
    );
}

.certificate-long-description:hover,
.long-desc-card:hover {
    border-color: rgba(193, 18, 31, 0.22);
    box-shadow: 0 18px 46px rgba(193, 18, 31, 0.08);
    transform: translateY(-4px);
}

.certificate-long-description p,
.text-content p {
    margin: 0 0 18px;
    color: var(--certificate-text);
    line-height: 2;
    font-size: 1rem;
}

.certificate-long-description p:last-child,
.text-content p:last-child {
    margin-bottom: 0;
}

.section-sub-title {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 900;
    margin-bottom: 22px;
    color: var(--certificate-red);
    letter-spacing: -0.02em;
}

.text-content {
    line-height: 2;
    font-size: 1.06rem;
    color: var(--certificate-text-soft);
}

/* ===========================
   Actions / Buttons
=========================== */

.certificate-actions,
.cta-wrapper {
    margin-top: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.certificate-btn,
.cert-btn,
.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 240px;
    min-height: 58px;
    padding: 0 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--certificate-red), #d62839);
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.98rem;
    letter-spacing: 0.02em;
    box-shadow: 0 14px 30px rgba(193, 18, 31, 0.22);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        background 0.3s ease,
        border-color 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.certificate-btn::before,
.cert-btn::before,
.primary-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 120%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.25),
        transparent
    );
    transition: left 0.6s ease;
}

.certificate-btn:hover,
.cert-btn:hover,
.primary-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 38px rgba(193, 18, 31, 0.28);
    background: linear-gradient(135deg, var(--certificate-red-dark), var(--certificate-red));
}

.certificate-btn:hover::before,
.cert-btn:hover::before,
.primary-btn:hover::before {
    left: 120%;
}

.certificate-btn:active,
.cert-btn:active,
.primary-btn:active {
    transform: translateY(-1px);
}

.certificate-btn:focus-visible,
.cert-btn:focus-visible,
.primary-btn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 4px rgba(193, 18, 31, 0.14),
        0 14px 30px rgba(193, 18, 31, 0.22);
}

/* ===========================
   Alternate Structural Layer
   Secondary professional skeleton
=========================== */

.cert-hero {
    padding: 80px 0;
    position: relative;
}

.cert-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.cert-visual-wrap,
.cert-visual-col {
    position: relative;
}

.cert-details {
    padding: 60px 0 100px;
    position: relative;
}

.long-desc-card {
    padding: 60px;
    border-radius: 40px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: var(--certificate-shadow-card);
    background:
        linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(255,251,251,1) 100%);
}

.long-desc-card .section-sub-title {
    margin-bottom: 28px;
}

.long-desc-card .text-content p {
    font-size: 1.05rem;
    color: var(--certificate-text-soft);
}

/* ===========================
   Optional Premium Enhancers
=========================== */

.certificate-content > *:last-child,
.cert-content-wrap > *:last-child,
.cert-content-col > *:last-child {
    margin-bottom: 0;
}

.certificate-image-wrap,
.certificate-long-description,
.long-desc-card,
.certificate-btn,
.cert-btn,
.primary-btn,
.certificate-badge,
.cert-badge,
.badge {
    will-change: transform;
}

.certificate-long-description ul,
.long-desc-card ul {
    margin: 18px 0 18px 20px;
    padding: 0;
}

.certificate-long-description li,
.long-desc-card li {
    margin-bottom: 10px;
    line-height: 1.9;
    color: var(--certificate-text);
}

.certificate-long-description h3,
.long-desc-card h3 {
    margin: 24px 0 12px;
    font-size: 1.15rem;
    color: var(--certificate-heading);
    font-weight: 800;
}

/* ===========================
   Reveal animation
=========================== */

.reveal-up {
    opacity: 0;
    transform: translateY(28px);
    animation: revealUp 0.9s ease forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }
.delay-5 { animation-delay: 0.75s; }
.delay-6 { animation-delay: 0.9s; }
.delay-7 { animation-delay: 1.05s; }

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   Subtle floating / decorative motion
=========================== */

@keyframes softFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

.visual-box,
.certificate-image-wrap {
    animation: softFloat 6s ease-in-out infinite;
}

.visual-box:hover,
.certificate-image-wrap:hover {
    animation-play-state: paused;
}

/* ===========================
   Responsive
=========================== */

@media (max-width: 1200px) {
    .certificate-container,
    .cert-container {
        max-width: 1100px;
    }

    .certificate-container {
        gap: 42px;
    }

    .cert-grid {
        gap: 56px;
    }

    .long-desc-card {
        padding: 48px;
    }
}

@media (max-width: 992px) {
    .certificate-hero {
        min-height: auto;
        padding: 56px 0;
    }

    .certificate-container {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .cert-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .certificate-image {
        min-height: 320px;
        max-height: 500px;
    }

    .certificate-content,
    .cert-content-wrap,
    .cert-content-col {
        text-align: center;
        align-items: center;
    }

    .certificate-short-description,
    .short-desc,
    .cert-content-wrap p {
        max-width: 100%;
    }

    .certificate-long-description,
    .long-desc-card {
        text-align: left;
        width: 100%;
    }

    .cert-container,
    .certificate-container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .long-desc-card {
        padding: 34px;
    }

    .certificate-actions,
    .cta-wrapper {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .certificate-hero {
        padding: 40px 0;
        min-height: auto;
    }

    .cert-hero {
        padding: 52px 0;
    }

    .certificate-title,
    .main-title,
    .cert-content-wrap h1 {
        font-size: 2.2rem;
        line-height: 1.08;
    }

    .certificate-short-description,
    .short-desc,
    .cert-content-wrap p {
        font-size: 1rem;
        line-height: 1.9;
    }

    .certificate-long-description {
        padding: 22px 18px;
        border-radius: 20px;
    }

    .certificate-long-description p,
    .text-content p {
        font-size: 0.97rem;
        line-height: 1.9;
    }

    .certificate-btn,
    .cert-btn,
    .primary-btn {
        width: 100%;
        max-width: 320px;
    }

    .section-sub-title {
        font-size: 1.55rem;
    }

    .long-desc-card {
        padding: 28px 22px;
        border-radius: 28px;
    }

    .certificate-image-wrap,
    .visual-box {
        border-radius: 24px;
    }
}

@media (max-width: 480px) {
    .certificate-title,
    .main-title,
    .cert-content-wrap h1 {
        font-size: 1.9rem;
    }

    .certificate-badge,
    .cert-badge,
    .badge {
        font-size: 0.75rem;
        padding: 9px 14px;
    }

    .certificate-image {
        min-height: 260px;
    }

    .certificate-long-description {
        padding: 18px 16px;
    }

    .long-desc-card {
        padding: 22px 18px;
    }

    .certificate-container,
    .cert-container,
    .certificate-container-wide {
        padding-left: 16px;
        padding-right: 16px;
    }

    .certificate-actions,
    .cta-wrapper {
        margin-top: 22px;
    }
}

/* ===========================
   Reduced Motion Accessibility
=========================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal-up {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .visual-box,
    .certificate-image-wrap {
        animation: none;
    }
}
/* =========================================================
   IMAGE VISIBILITY HARD FIX
   (Non-destructive patch – does not remove any existing rule)
========================================================= */

/* ایجاد context صحیح برای باکس تصویر */
.visual-box,
.certificate-image-wrap,
.cert-visual-wrap,
.cert-visual-col {
    position: relative !important;
    display: block !important;
    overflow: hidden !important;
    z-index: 5 !important;
}

/* اطمینان از اینکه pseudo element ها روی تصویر نیفتند */
.visual-box::before,
.visual-box::after,
.certificate-image-wrap::before,
.certificate-image-wrap::after {
    z-index: 1 !important;
}

/* تصویر همیشه بالاتر از لایه‌ها */
.visual-box img,
.cert-image,
.certificate-image {
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 420px !important;
    object-fit: cover !important;
    display: block !important;
}

/* جلوگیری از collapse شدن container */
.visual-box,
.certificate-image-wrap {
    min-height: 420px !important;
}

/* اگر reveal animation باعث مخفی شدن شود */
.reveal-up img,
.reveal-up .certificate-image,
.reveal-up .cert-image {
    opacity: 1 !important;
    transform: none !important;
}

/* اگر grid به هر دلیل ارتفاع را صفر کند */
.certificate-container,
.cert-grid {
    align-items: stretch !important;
}

/* موبایل */
@media (max-width: 992px) {

    .certificate-container {
        display: flex !important;
        flex-direction: column-reverse !important;
    }

    .cert-grid {
        display: flex !important;
        flex-direction: column !important;
    }

    .cert-visual-col,
    .cert-visual-wrap {
        width: 100% !important;
    }

}
/* =========================================================
   FINAL ISO 14001 IMAGE FIX
   Non-destructive override patch
========================================================= */

/* Hero layout stabilization */
.certificate-hero,
.cert-hero {
    position: relative !important;
    z-index: 1 !important;
}

/* Parent container should not compress the visual column */
.certificate-container,
.cert-grid {
    align-items: center !important;
}

/* Visual column: create a proper stacking context */
.cert-visual-col,
.cert-visual-wrap,
.visual-box,
.certificate-image-wrap {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    overflow: hidden !important;
    isolation: isolate !important;
    z-index: 2 !important;
    border-radius: 28px !important;
    background: #f8fafc !important;
    box-shadow: var(--certificate-shadow-soft) !important;
}

/* Ensure pseudo layers stay behind the image */
.cert-visual-col::before,
.cert-visual-col::after,
.cert-visual-wrap::before,
.cert-visual-wrap::after,
.visual-box::before,
.visual-box::after,
.certificate-image-wrap::before,
.certificate-image-wrap::after {
    z-index: 0 !important;
    pointer-events: none !important;
}

/* Force the actual image to be visible */
img.cert-image,
img.certificate-image {
    position: relative !important;
    z-index: 2 !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 420px !important;
    max-height: 680px !important;
    object-fit: cover !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    background: transparent !important;
}

/* If wrapper height is collapsing, this guarantees a visible frame */
.visual-box,
.certificate-image-wrap,
.cert-visual-wrap {
    min-height: 420px !important;
}

/* Reveal animation must not hide the image */
.reveal-up {
    opacity: 1 !important;
}

.reveal-up img.cert-image,
.reveal-up img.certificate-image {
    opacity: 1 !important;
    transform: none !important;
}

/* Loader must not remain on top after load */
.page-loader {
    z-index: 9999 !important;
}

.page-loader.hide {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Mobile stacking */
@media (max-width: 992px) {
    .certificate-container {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }

    .cert-grid {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }

    .cert-visual-col,
    .cert-visual-wrap,
    .visual-box,
    .certificate-image-wrap {
        min-height: 320px !important;
    }

    img.cert-image,
    img.certificate-image {
        min-height: 320px !important;
        max-height: 520px !important;
    }
}

@media (max-width: 768px) {
    .cert-visual-col,
    .cert-visual-wrap,
    .visual-box,
    .certificate-image-wrap {
        min-height: 280px !important;
        border-radius: 24px !important;
    }

    img.cert-image,
    img.certificate-image {
        min-height: 280px !important;
        max-height: 420px !important;
    }
}
/* =========================================================
   IMAGE MARGIN & SPACING ADJUSTMENTS
========================================================= */

/* فاصله دادن به باکس تصویر از پایین در همه حالت‌ها */
.cert-visual-col, 
.visual-box, 
.certificate-image-wrap {
    margin-bottom: 30px !important; /* مقدار مارجین که می‌خواستی */
}

/* اصلاح چیدمان در موبایل برای نمایش بهتر مارجین */
@media (max-width: 992px) {
    .cert-visual-col, 
    .visual-box, 
    .certificate-image-wrap {
        margin-bottom: 40px !important; /* فاصله بیشتر در حالت ستونی موبایل */
    }
    
    /* اگر از Grid استفاده می‌کنی، فاصله بین ردیف‌ها را هم تنظیم می‌کنیم */
    .certificate-container, 
    .cert-grid {
        row-gap: 40px !important;
    }
}

/* ظریف‌کاری برای Shadow زیر عکس که با مارجین تداخل نکند */
.visual-box {
    display: block;
    position: relative;
    z-index: 5;
}
