.dcpc {
    --dcpc-desktop-visible: 4;
    --dcpc-tablet-visible: 3;
    --dcpc-mobile-visible: 2;
    --dcpc-visible: var(--dcpc-desktop-visible);
    --dcpc-gap: 22px;
    --dcpc-transition: 850ms;
    position: relative;
    width: 100%;
    max-width: 100%;
    direction: rtl;
}

.dcpc,
.dcpc * {
    box-sizing: border-box;
}

.dcpc-row {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.dcpc-row + .dcpc-row {
    margin-top: 30px;
}

.dcpc-row-shell {
    position: relative;
    width: 100%;
    max-width: 100%;
}

/*
 * Keep the scrolling geometry LTR even on an Arabic page. This avoids the
 * browser-specific RTL scrollLeft behaviour that previously pushed cards
 * outside the visible area in Elementor.
 */
.dcpc-viewport {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 3px 11px;
    direction: ltr;
    outline: none;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-inline: contain;
}

.dcpc-viewport::-webkit-scrollbar {
    display: none;
}

.dcpc-viewport:active,
.dcpc-viewport.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    scroll-snap-type: none;
}

.dcpc-viewport:focus-visible {
    border-radius: 16px;
    box-shadow: 0 0 0 3px rgba(232, 117, 0, .18);
}

/*
 * The track stays anchored to the left in a predictable LTR coordinate
 * system. JavaScript calculates an exact card width from the viewport.
 */
.dcpc-track {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: var(--dcpc-gap);
    width: 100%;
    min-width: 100%;
    margin: 0;
    padding: 0;
    direction: ltr;
}

.dcpc-card {
    direction: rtl;
    flex: 0 0 var(--dcpc-card-width, calc((100% - 66px) / 4));
    min-width: 0;
    width: var(--dcpc-card-width, calc((100% - 66px) / 4));
    max-width: var(--dcpc-card-width, calc((100% - 66px) / 4));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #ece7e1;
    border-radius: 16px;
    box-shadow: 0 8px 26px rgba(17, 24, 39, .055);
    scroll-snap-align: start;
    transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}

.dcpc-card:hover {
    transform: translateY(-4px);
    border-color: #e4d9cd;
    box-shadow: 0 14px 34px rgba(17, 24, 39, .095);
}

.dcpc-image-link {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #f7f5f2;
}

.dcpc-image-link img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: contain;
    object-position: center;
    transition: transform .45s ease;
    pointer-events: none;
}

.dcpc-card:hover .dcpc-image-link img {
    transform: scale(1.025);
}

.dcpc-sale {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    padding: 6px 11px;
    color: #ffffff;
    background: #e87500;
    border-radius: 999px;
    box-shadow: 0 5px 14px rgba(232, 117, 0, .22);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.dcpc-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 15px 16px 16px;
    text-align: center;
}

.dcpc-title {
    display: -webkit-box;
    overflow: hidden;
    min-height: 50px;
    margin: 0 0 9px;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.55;
    text-decoration: none !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.dcpc-title:hover {
    color: #e87500;
}

.dcpc-price {
    min-height: 31px;
    margin: auto 0 13px;
    color: #111827;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.6;
}

.dcpc-price del {
    margin-inline-start: 6px;
    color: #909399;
    font-weight: 500;
    opacity: .75;
}

.dcpc-price ins {
    color: #111827;
    text-decoration: none;
}

.dcpc-actions {
    display: flex;
    align-items: stretch;
    gap: 9px;
    width: 100%;
    margin-top: auto;
}

.dcpc-native-button,
.dcpc-details-button {
    flex: 1 1 0;
    min-width: 0;
}

.dcpc-native-button .button,
.dcpc-details-button,
.dcpc-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 45px;
    margin: 0 !important;
    padding: 10px 15px !important;
    color: #111827 !important;
    background: #e87500 !important;
    border: 1px solid #e87500 !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    white-space: nowrap;
    line-height: 1.25 !important;
    text-align: center;
    text-decoration: none !important;
    transition: background-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.dcpc-native-button .button:hover,
.dcpc-native-button .button:focus,
.dcpc-button:hover,
.dcpc-button:focus {
    color: #ffffff !important;
    background: #d96d00 !important;
    border-color: #d96d00 !important;
    transform: translateY(-1px);
    box-shadow: 0 7px 17px rgba(232, 117, 0, .18) !important;
}

.dcpc-details-button {
    color: #e87500 !important;
    background: #F4F1EB !important;
    border-color: rgba(232, 117, 0, .72) !important;
}

.dcpc-details-button:hover,
.dcpc-details-button:focus {
    color: #ffffff !important;
    background: #e87500 !important;
    border-color: #e87500 !important;
    transform: translateY(-1px);
    box-shadow: 0 7px 17px rgba(232, 117, 0, .14) !important;
}

.dcpc-card .added_to_cart {
    display: block;
    width: 100%;
    margin-top: 9px;
    color: #e87500;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.dcpc-arrow {
    position: absolute;
    z-index: 8;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    color: #e87500;
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(232, 117, 0, .22);
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(17, 24, 39, .13);
    cursor: pointer;
    transform: translateY(-50%);
    transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease, opacity .2s ease;
}

.dcpc-arrow:hover,
.dcpc-arrow:focus-visible {
    color: #ffffff;
    background: #e87500;
    border-color: #e87500;
    transform: translateY(-50%) scale(1.05);
    outline: none;
}

.dcpc-arrow-left { left: 8px; }
.dcpc-arrow-right { right: 8px; }

.dcpc-arrow[disabled] {
    opacity: .24;
    pointer-events: none;
}

.dcpc-arrow-icon {
    display: block;
    width: 22px;
    height: 22px;
}

.dcpc-message {
    padding: 18px 20px;
    color: #374151;
    background: #fff7ed;
    border-right: 4px solid #e87500;
    border-radius: 9px;
}

@media (max-width: 1024px) {
    .dcpc {
        --dcpc-visible: var(--dcpc-tablet-visible);
        --dcpc-gap: 16px;
    }

    .dcpc-card {
        flex-basis: var(--dcpc-card-width, calc((100% - 32px) / 3));
        width: var(--dcpc-card-width, calc((100% - 32px) / 3));
        max-width: var(--dcpc-card-width, calc((100% - 32px) / 3));
    }

    .dcpc-row + .dcpc-row { margin-top: 24px; }
    .dcpc-arrow-left { left: 6px; }
    .dcpc-arrow-right { right: 6px; }
}

@media (max-width: 767px) {
    .dcpc {
        --dcpc-visible: var(--dcpc-mobile-visible);
        --dcpc-gap: 12px;
    }

    .dcpc-row + .dcpc-row { margin-top: 20px; }
    .dcpc-viewport { padding: 3px 1px 7px; }
    .dcpc-card {
        flex-basis: var(--dcpc-card-width, calc((100% - 12px) / 2));
        width: var(--dcpc-card-width, calc((100% - 12px) / 2));
        max-width: var(--dcpc-card-width, calc((100% - 12px) / 2));
        border-radius: 12px;
    }
    .dcpc-card-body { padding: 11px; }

    .dcpc-title {
        min-height: 44px;
        margin-bottom: 7px;
        font-size: 14px;
        line-height: 1.5;
    }

    .dcpc-price {
        min-height: 27px;
        margin-bottom: 9px;
        font-size: 14px;
    }

    .dcpc-actions {
        flex-direction: column;
        gap: 7px;
    }

    .dcpc-native-button .button,
    .dcpc-details-button,
    .dcpc-button {
        min-height: 40px;
        padding: 8px 7px !important;
        font-size: 13px !important;
    }

    .dcpc-sale {
        top: 8px;
        right: 8px;
        padding: 5px 8px;
        font-size: 10px;
    }

    .dcpc-arrow { width: 36px; height: 36px; }
    .dcpc-arrow-left { left: 3px; }
    .dcpc-arrow-right { right: 3px; }
    .dcpc-arrow-icon { width: 19px; height: 19px; }
}

@media (prefers-reduced-motion: reduce) {
    .dcpc-viewport { scroll-behavior: auto; }
    .dcpc-card,
    .dcpc-image-link img,
    .dcpc-native-button .button,
    .dcpc-details-button,
    .dcpc-button,
    .dcpc-arrow {
        transition-duration: .01ms !important;
    }
}

/* ========================================================================
 * Decatia Products Carousel 2.0.5
 * Square, uncropped product imagery + two buttons on one mobile row.
 * These rules intentionally come last to override theme/WooCommerce styles.
 * ======================================================================== */

/* Always reserve a true square image area and show the complete product image. */
.dcpc .dcpc-image-link {
    aspect-ratio: 1 / 1 !important;
    background: #ffffff;
}

.dcpc .dcpc-image-link img,
.dcpc .dcpc-image-link img.attachment-woocommerce_single,
.dcpc .dcpc-image-link img.wp-post-image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    transform: none !important;
}

/* Do not zoom an image beyond its square frame; this guarantees no edge loss. */
.dcpc .dcpc-card:hover .dcpc-image-link img {
    transform: none !important;
}

@media (max-width: 767px) {
    /* Keep both calls to action side by side on phones. */
    .dcpc .dcpc-actions {
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
        gap: 5px !important;
        width: 100% !important;
    }

    .dcpc .dcpc-native-button,
    .dcpc .dcpc-details-button {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        width: auto !important;
    }

    .dcpc .dcpc-native-button .button,
    .dcpc .dcpc-details-button,
    .dcpc .dcpc-button {
        min-width: 0 !important;
        min-height: 38px !important;
        padding: 7px 3px !important;
        font-size: clamp(8.5px, 2.45vw, 11px) !important;
        line-height: 1.1 !important;
        letter-spacing: -0.15px;
        white-space: nowrap !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
    }

    /* Recover useful width for the two compact buttons without crowding the card. */
    .dcpc .dcpc-card-body {
        padding-right: 9px;
        padding-left: 9px;
    }
}
