/* =========================================================
   EKBATAN SANAT — SINGLE PRODUCT
   Mobile-First / Responsive
   ========================================================= */


/* =========================================================
   BASE
   ========================================================= */

.ek-single-product {
    --ek-red: #d71920;
    --ek-red-dark: #b81016;
    --ek-text: #17202a;
    --ek-muted: #667085;
    --ek-line: #e5e7eb;
    --ek-soft: #f7f8fa;
    --ek-white: #ffffff;
    --ek-radius: 16px;

    direction: rtl;
    width: 100%;
    max-width: 100%;
    color: var(--ek-text);
    font-size: 15px;
    line-height: 1.85;

    /* جلوگیری از بیرون‌زدگی عناصر */
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.ek-single-product *,
.ek-single-product *::before,
.ek-single-product *::after {
    box-sizing: border-box;
}

.ek-single-product a {
    text-decoration: none;
}

.ek-single-product img {
    display: block;
    max-width: 100%;
    height: auto;
}

.ek-single-product button,
.ek-single-product input,
.ek-single-product textarea,
.ek-single-product select {
    font: inherit;
}


/* =========================================================
   MAIN WRAPPER
   ========================================================= */

.ek-single-product__wrap {
    width: calc(100% - 20px);
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 0 50px;
}


/* =========================================================
   BREADCRUMB
   ========================================================= */

.ek-single-product__breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
    margin: 0 0 16px;
    color: var(--ek-muted);
    font-size: 12px;
    line-height: 1.8;
}

.ek-single-product__breadcrumb a {
    color: var(--ek-muted);
}

.ek-single-product__breadcrumb span {
    margin: 0 2px;
}


/* =========================================================
   MAIN PRODUCT
   موبایل = یک ستون
   ========================================================= */

.ek-single-product__main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    width: 100%;
    min-width: 0;
}


/* =========================================================
   MEDIA / GALLERY
   ========================================================= */

.ek-single-product__media {
    width: 100%;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--ek-line);
    border-radius: 14px;
    background: var(--ek-white);
}

.ek-single-product__image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 10px;
    background: var(--ek-soft);
}

.ek-single-product__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ek-single-product__video-label {
    position: absolute;
    right: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(23, 32, 42, .90);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
}


/* =========================================================
   THUMBNAILS
   ========================================================= */

.ek-single-product__thumbs {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 9px 1px 3px;

    /* اسکرول نرم موبایل */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.ek-single-product__thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 52px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--ek-line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.ek-single-product__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ek-single-product__thumb.is-active {
    border-color: var(--ek-red);
    box-shadow: 0 0 0 2px rgba(215, 25, 32, .10);
}


/* =========================================================
   VIDEO
   ========================================================= */

.ek-single-product__video {
    width: 100%;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
}

.ek-single-product__video video {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 500px;
}


/* =========================================================
   PRODUCT INFO
   ========================================================= */

.ek-single-product__info {
    width: 100%;
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--ek-line);
    border-radius: 14px;
    background: var(--ek-white);
}

.ek-single-product__category {
    margin: 0 0 5px;
    color: var(--ek-red);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.7;
}

.ek-single-product__title {
    margin: 0 0 10px;
    color: var(--ek-text);
    font-size: 23px;
    font-weight: 800;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.ek-single-product__rating {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 13px;
    color: var(--ek-muted);
    font-size: 13px;
}

.ek-single-product__stars {
    color: #f59e0b;
    font-size: 17px;
    letter-spacing: 1px;
    white-space: nowrap;
}

.ek-single-product__short {
    margin-bottom: 15px;
    color: #475467;
    font-size: 14px;
    line-height: 1.9;
}

.ek-single-product__short p:last-child {
    margin-bottom: 0;
}


/* =========================================================
   PRICE
   ========================================================= */

.ek-single-product__price {
    margin: 13px 0;
    color: #111827;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.ek-single-product__price del {
    color: #98a2b3;
    font-size: .65em;
}

.ek-single-product__price ins {
    text-decoration: none;
}


/* =========================================================
   BUTTONS
   موبایل = یک ستون
   ========================================================= */

.ek-single-product__actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    width: 100%;
    margin-top: 17px;
}

.ek-single-product__button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--ek-line);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
    text-align: center;
    transition:
        transform .18s ease,
        background-color .18s ease,
        border-color .18s ease;
}

.ek-single-product__button:hover {
    transform: translateY(-1px);
}

.ek-single-product__button--primary {
    border-color: var(--ek-red);
    background: var(--ek-red);
    color: #fff !important;
}

.ek-single-product__button--primary:hover {
    background: var(--ek-red-dark);
}

.ek-single-product__button--secondary {
    background: #fff;
    color: var(--ek-text) !important;
}


/* =========================================================
   META
   ========================================================= */

.ek-single-product__meta {
    display: grid;
    gap: 7px;
    width: 100%;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--ek-line);
    color: var(--ek-muted);
    font-size: 12px;
    line-height: 1.8;
}

.ek-single-product__meta strong {
    color: var(--ek-text);
}


/* =========================================================
   DETAILS / ACCORDIONS
   ========================================================= */

.ek-single-product__details {
    display: grid;
    gap: 9px;
    width: 100%;
    margin-top: 20px;
}

.ek-single-product__accordion {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--ek-line);
    border-radius: 13px;
    background: #fff;
}

.ek-single-product__accordion summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    padding: 13px 15px;
    cursor: pointer;
    list-style: none;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.6;
}

.ek-single-product__accordion summary::-webkit-details-marker {
    display: none;
}

.ek-single-product__accordion summary::after {
    flex: 0 0 auto;
    content: '+';
    color: var(--ek-red);
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
}

.ek-single-product__accordion[open] summary::after {
    content: '−';
}

.ek-single-product__accordion-content {
    width: 100%;
    min-width: 0;
    padding: 0 15px 17px;
    color: #344054;
    font-size: 14px;
    line-height: 1.9;
}


/* =========================================================
   SPECIFICATIONS TABLE
   موبایل: جدول قابل اسکرول
   ========================================================= */

.ek-single-product__specs {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.7;
}

.ek-single-product__specs th,
.ek-single-product__specs td {
    padding: 9px 7px;
    border-bottom: 1px solid var(--ek-line);
    text-align: right;
    vertical-align: top;
}

.ek-single-product__specs th {
    width: 38%;
    color: #475467;
    font-weight: 700;
}


/*
   اگر جدول داخل یک wrapper قرار دارد،
   اسکرول افقی فقط روی جدول باشد نه کل صفحه.
*/
.ek-single-product__accordion-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}


/* =========================================================
   CONTENT
   ========================================================= */

.ek-single-product__content {
    width: 100%;
    min-width: 0;
    color: #344054;
    font-size: 14px;
    line-height: 2;
}

.ek-single-product__content p:last-child {
    margin-bottom: 0;
}

.ek-single-product__content img {
    max-width: 100%;
    height: auto;
}

.ek-single-product__content iframe,
.ek-single-product__content video {
    display: block;
    width: 100%;
    max-width: 100%;
}

.ek-single-product__content table {
    max-width: 100%;
}


/* =========================================================
   CONSULTATION
   ========================================================= */

.ek-single-product__lead {
    width: 100%;
    margin-top: 20px;
    padding: 17px;
    border: 1px solid var(--ek-line);
    border-radius: 14px;
    background: #fafbfc;
}

.ek-single-product__lead-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
    align-items: center;
}

.ek-single-product__lead h2 {
    margin: 0 0 6px;
    font-size: 20px;
    line-height: 1.6;
}

.ek-single-product__lead p {
    margin: 0;
    color: var(--ek-muted);
    font-size: 14px;
    line-height: 1.9;
}

.ek-single-product__lead-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    width: 100%;
}


/* =========================================================
   GENERAL SECTIONS
   ========================================================= */

.ek-single-product__section {
    width: 100%;
    min-width: 0;
    margin-top: 24px;
    padding: 17px;
    border: 1px solid var(--ek-line);
    border-radius: 14px;
    background: #fff;
}

.ek-single-product__section h2 {
    margin: 0 0 14px;
    font-size: 20px;
    line-height: 1.6;
}


/* =========================================================
   RELATED PRODUCTS
   موبایل = دو ستون
   ========================================================= */

.ek-single-product__products {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    width: 100%;
    min-width: 0;
}

.ek-single-product__card {
    display: block;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--ek-line);
    border-radius: 11px;
    background: #fff;
    transition:
        transform .18s ease,
        box-shadow .18s ease;
}

.ek-single-product__card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(16, 24, 40, .07);
}

.ek-single-product__card-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / .8;
    overflow: hidden;
    background: var(--ek-soft);
}

.ek-single-product__card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ek-single-product__card-body {
    display: block;
    min-width: 0;
    padding: 9px;
}

.ek-single-product__card-title {
    display: block;
    margin-bottom: 5px;
    color: var(--ek-text);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.7;

    /* جلوگیری از به‌هم‌ریختگی کارت */
    overflow-wrap: anywhere;
}

.ek-single-product__card-price {
    display: block;
    color: #475467;
    font-size: 11px;
    line-height: 1.6;
}


/* =========================================================
   SMALL MOBILE
   320px - 359px
   ========================================================= */

@media (max-width: 359px) {

    .ek-single-product__wrap {
        width: calc(100% - 16px);
        padding-top: 10px;
        padding-bottom: 40px;
    }

    .ek-single-product__info {
        padding: 14px;
    }

    .ek-single-product__title {
        font-size: 21px;
    }

    .ek-single-product__price {
        font-size: 22px;
    }

    .ek-single-product__section,
    .ek-single-product__lead {
        padding: 14px;
    }

    .ek-single-product__products {
        gap: 7px;
    }

    .ek-single-product__card-body {
        padding: 8px;
    }

    .ek-single-product__card-title {
        font-size: 11px;
    }
}


/* =========================================================
   TABLET / LARGE MOBILE
   600px+
   ========================================================= */

@media (min-width: 600px) {

    .ek-single-product__wrap {
        width: calc(100% - 32px);
        padding-top: 20px;
        padding-bottom: 60px;
    }

    .ek-single-product__media {
        padding: 12px;
        border-radius: 15px;
    }

    .ek-single-product__info {
        padding: 21px;
        border-radius: 15px;
    }

    .ek-single-product__title {
        font-size: 27px;
    }

    .ek-single-product__price {
        font-size: 27px;
    }

    .ek-single-product__actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ek-single-product__lead {
        padding: 20px;
    }

    .ek-single-product__lead-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ek-single-product__section {
        padding: 20px;
    }

    .ek-single-product__products {
        gap: 12px;
    }

    .ek-single-product__card-title {
        font-size: 13px;
    }

    .ek-single-product__card-price {
        font-size: 12px;
    }
}


/* =========================================================
   DESKTOP
   900px+
   ========================================================= */

@media (min-width: 900px) {

    .ek-single-product__wrap {
        width: min(1180px, calc(100% - 40px));
        padding-top: 25px;
        padding-bottom: 70px;
    }

    /*
       RTL:
       عنصر اول (media) در سمت راست قرار می‌گیرد.
       عنصر دوم (info) در سمت چپ قرار می‌گیرد.
    */
    .ek-single-product__main {
        grid-template-columns:
            minmax(0, 1.08fr)
            minmax(320px, .92fr);
        gap: 28px;
    }

    .ek-single-product__media {
        padding: 14px;
        border-radius: var(--ek-radius);
    }

    .ek-single-product__image {
        border-radius: 12px;
    }

    .ek-single-product__info {
        padding: 24px;
        border-radius: var(--ek-radius);
    }

    .ek-single-product__title {
        font-size: clamp(28px, 3vw, 37px);
    }

    .ek-single-product__price {
        font-size: clamp(24px, 3vw, 31px);
    }

    .ek-single-product__details {
        gap: 12px;
        margin-top: 28px;
    }

    .ek-single-product__lead {
        margin-top: 28px;
        padding: 22px;
        border-radius: var(--ek-radius);
    }

    .ek-single-product__lead-grid {
        grid-template-columns: 1.2fr .8fr;
        gap: 18px;
    }

    .ek-single-product__section {
        margin-top: 34px;
        padding: 22px;
        border-radius: var(--ek-radius);
    }

    .ek-single-product__section h2 {
        font-size: 22px;
    }

    .ek-single-product__products {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 14px;
    }

    .ek-single-product__card-body {
        padding: 12px;
    }

    .ek-single-product__card-title {
        font-size: 14px;
    }

    .ek-single-product__card-price {
        font-size: 13px;
    }
}


/* =========================================================
   LARGE DESKTOP
   1200px+
   ========================================================= */

@media (min-width: 1200px) {

    .ek-single-product__main {
        gap: 32px;
    }
}


/* =========================================================
   ACCESSIBILITY / REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .ek-single-product *,
    .ek-single-product *::before,
    .ek-single-product *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* =========================================================
   WORDPRESS PRODUCT CONTENT GALLERY
   Responsive override for gallery-columns-4
   ========================================================= */

/* پایه: موبایل */
.ek-single-product__content .gallery {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 20px 0 !important;
    padding: 0 !important;
}


/* آیتم‌های گالری */
.ek-single-product__content .gallery .gallery-item {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* کانتینر تصویر */
.ek-single-product__content .gallery .gallery-icon {
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    border-radius: 10px;
}


/* لینک تصویر */
.ek-single-product__content .gallery .gallery-icon a {
    display: block;
    width: 100%;
}


/* خود تصویر */
.ek-single-product__content .gallery .gallery-icon img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    object-fit: cover;
}


/* کپشن */
.ek-single-product__content .gallery .gallery-caption {
    width: 100%;
    max-width: 100%;
    margin: 5px 0 0 !important;
    padding: 0 2px;
    font-size: 12px;
    line-height: 1.7;
    text-align: center;
    overflow-wrap: anywhere;
}


/* =========================================================
   VERY SMALL MOBILE
   320px - 359px
   ========================================================= */

@media (max-width: 359px) {

    .ek-single-product__content .gallery {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

}


/* =========================================================
   TABLET
   600px+
   ========================================================= */

@media (min-width: 600px) {

    .ek-single-product__content .gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

}


/* =========================================================
   DESKTOP
   900px+
   ========================================================= */

@media (min-width: 900px) {

    .ek-single-product__content .gallery {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }

}