.kkdd-wrapper {
    padding: 16px;
    border-radius: 12px;
    margin: 20px 0;
    box-sizing: border-box;
}

.kkdd-header,
.kkdd-archive-day-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.kkdd-header {
    margin-bottom: 12px;
}

.kkdd-header-left,
.kkdd-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.kkdd-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: inherit;
}

.kkdd-category-label {
    font-size: .9rem;
    opacity: .8;
}

.kkdd-preview-badge {
    padding: 3px 10px;
    border-radius: 999px;
    background: #fff3cd;
    color: #594500;
    font-size: .8rem;
}

.kkdd-view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 5px 13px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 999px;
    background-color: #111;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    transition: filter .18s ease, transform .18s ease;
}

.kkdd-view-all:hover {
    color: #fff;
    filter: brightness(.94);
    transform: translateY(-1px);
}

.kkdd-timer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
}

.kkdd-timer-countdown {
    min-width: 66px;
    direction: ltr;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.kkdd-carousel {
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding-bottom: 4px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}

.kkdd-carousel::-webkit-scrollbar {
    height: 4px;
}

.kkdd-carousel::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(0, 0, 0, .2);
}

.kkdd-item {
    position: relative;
    display: flex;
    height: auto;
    padding: 8px;
    border-radius: 10px;
    box-sizing: border-box;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    scroll-snap-align: start;
    text-align: center;
}

.kkdd-link,
.kkdd-archive-link {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    text-align: center;
}

.kkdd-thumb,
.kkdd-archive-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f4f4f4;
}

.kkdd-thumb {
    border-radius: 14px;
}

.kkdd-archive-thumb {
    margin-bottom: 7px;
    border-radius: 10px;
}

.kkdd-thumb img,
.kkdd-archive-thumb img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
}

.kkdd-product-title,
.kkdd-archive-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-height: 1.65;
}

.kkdd-product-title {
    min-height: 4.95em;
    margin: 7px 0 5px;
    font-size: 12px;
    font-weight: 600;
}

.kkdd-price,
.kkdd-archive-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    min-height: 48px;
    margin-top: auto;
    font-size: .86rem;
    text-align: center;
}

.kkdd-regular {
    opacity: .68;
    text-decoration: line-through;
}

.kkdd-current-price,
.kkdd-sale {
    font-weight: 700;
}

.kkdd-outofstock-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .76);
    color: #fff;
    font-size: .72rem;
}

.kkdd-item-outofstock {
    order: 2;
}

.kkdd-discount-badge {
    position: absolute;
    z-index: 2;
    padding: 2px 8px;
    border-radius: 5px;
    font-weight: 700;
    line-height: 1.55;
}

.kkdd-discount-top-right { top: 8px; right: 8px; }
.kkdd-discount-top-left { top: 8px; left: 8px; }
.kkdd-discount-bottom-right { right: 8px; bottom: 8px; }
.kkdd-discount-bottom-left { bottom: 8px; left: 8px; }

/* دسکتاپ: پنج کارت کامل و نصف کارت ششم، با پنج فاصله ۱۲ پیکسلی. */
@media (min-width: 992px) {
    .kkdd-item {
        flex: 0 0 calc((100% - 60px) / 5.5);
        min-width: 0;
    }
}

/* تبلت: چهار کارت کامل. */
@media (min-width: 768px) and (max-width: 991px) {
    .kkdd-item {
        flex: 0 0 calc((100% - 36px) / 4);
        min-width: 0;
    }
}

@media (max-width: 767px) {
    .kkdd-item {
        flex: 0 0 40%;
        min-width: 40%;
    }

    .kkdd-header {
        flex-wrap: nowrap;
    }

    .kkdd-header-left,
    .kkdd-header-right {
        flex: 1 1 0;
        min-width: 0;
    }

    .kkdd-header-left { justify-content: flex-start; }
    .kkdd-header-right { justify-content: flex-end; }

    .kkdd-timer-label {
        display: none;
    }
}

.kkdd-no-items {
    margin: 0 0 10px;
}

/* برگه همه پیشنهادها */
.kkdd-archive-wrapper {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.kkdd-archive-day {
    padding: 13px 14px 16px;
    border-radius: 16px;
    background: #f7f7f7;
}

.kkdd-archive-day-heading {
    margin-bottom: 11px;
}

.kkdd-archive-day-header {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 4px 13px;
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.kkdd-archive-timer {
    margin-inline-start: auto;
}

.kkdd-archive-day-items {
    display: grid;
    align-items: stretch;
    gap: 12px;
}

.kkdd-archive-item {
    display: flex;
    min-width: 0;
    height: 100%;
    padding: 8px;
    border-radius: 12px;
    box-sizing: border-box;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
    text-align: center;
}

.kkdd-archive-item-inactive {
    opacity: var(--kkdd-future-opacity, .72);
}

.kkdd-archive-title {
    min-height: 4.95em;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 600;
}

.kkdd-archive-price {
    min-height: 48px;
}

.kkdd-archive-date {
    min-height: 22px;
    margin-top: 5px;
    color: #777;
    font-size: 11px;
}

.kkdd-archive-item-hidden {
    display: none;
}

.kkdd-archive-load-more {
    margin-top: 11px;
    padding: 7px 17px;
    border: 0;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

@media (min-width: 768px) {
    .kkdd-archive-day-items {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .kkdd-archive-day-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kkdd-archive-day-heading {
        align-items: center;
        flex-wrap: nowrap;
    }

    .kkdd-archive-timer .kkdd-timer-label {
        display: none;
    }
}
