/* Deamon Aktüel & Fırsatlar — theme-safe default UI (--dfl-* maps to site --color-t-*) */

.dfl {
    --dfl-accent: var(--color-t-primary, var(--theme-primary, #ca5d24));
    --dfl-text: var(--color-t-text, #1d1d1f);
    --dfl-muted: var(--color-t-muted, #6e6e73);
    --dfl-surface: var(--color-t-surface, #f5f5f7);
    --dfl-line: color-mix(in srgb, var(--dfl-text) 10%, transparent);
    --dfl-positive: #1f8a4c;
    --dfl-radius: 18px;
    --dfl-radius-sm: 12px;
    --dfl-ease: cubic-bezier(.23, 1, .32, 1);
    color: var(--dfl-text);
    padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(2.5rem, 6vw, 4.5rem);
}

.dfl *,
.dfl *::before,
.dfl *::after {
    box-sizing: border-box;
}

.dfl-block {
    padding-block: clamp(2rem, 5vw, 3.5rem);
}

/* Header */
.dfl-header {
    display: grid;
    gap: .75rem;
    margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.dfl-header__title,
.dfl-detail__title {
    margin: 0;
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    line-height: 1.05;
    letter-spacing: -.025em;
    font-weight: 700;
}

.dfl-header__lead,
.dfl-detail__summary {
    margin: 0;
    max-width: 62ch;
    font-size: 1.0625rem;
    line-height: 1.5;
    color: var(--dfl-muted);
}

/* Segmented control */
.dfl-segmented {
    display: inline-flex;
    justify-self: start;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: var(--dfl-surface);
}

.dfl-segmented__item {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    min-height: 36px;
    padding: 0 1rem;
    border-radius: 999px;
    font-size: .9375rem;
    font-weight: 500;
    color: var(--dfl-muted);
    text-decoration: none;
    transition: background-color .2s var(--dfl-ease), color .2s var(--dfl-ease);
}

.dfl-segmented__item.is-active {
    background: #fff;
    color: var(--dfl-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

.dfl-segmented__count {
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
    color: var(--dfl-muted);
}

/* Grid + card */
.dfl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: clamp(1rem, 2.5vw, 1.5rem);
}

.dfl-card__link {
    display: grid;
    gap: .875rem;
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.dfl-card__media {
    position: relative;
    margin: 0;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: var(--dfl-radius);
    background: var(--dfl-surface);
}

.dfl-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s var(--dfl-ease);
}

.dfl-card__placeholder {
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--dfl-muted);
}

.dfl-card__count {
    position: absolute;
    right: .75rem;
    bottom: .75rem;
    padding: .25rem .625rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
}

.dfl-card__body {
    display: grid;
    gap: .25rem;
}

.dfl-card__title {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.25;
    letter-spacing: -.01em;
    font-weight: 600;
}

.dfl-card__meta {
    margin: 0;
    font-size: .875rem;
    color: var(--dfl-muted);
}

.dfl-card--expired .dfl-card__media img {
    filter: saturate(.35);
    opacity: .8;
}

.dfl-card__link:active .dfl-card__media {
    transform: scale(.98);
    transition: transform .1s ease-out;
}

@media (hover: hover) and (pointer: fine) {
    .dfl-card__link:hover .dfl-card__media img {
        transform: scale(1.03);
    }
}

/* State chip */
.dfl-state {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    margin: 0;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--dfl-muted);
}

.dfl-state__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.dfl-state--active {
    color: var(--dfl-positive);
}

.dfl-state--upcoming {
    color: var(--dfl-accent);
}

/* Sections */
.dfl-section {
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.dfl-section__title {
    margin: 0 0 1rem;
    font-size: clamp(1.375rem, 2.5vw, 1.75rem);
    letter-spacing: -.02em;
    font-weight: 700;
}

.dfl-empty {
    padding: clamp(2rem, 5vw, 3rem);
    border-radius: var(--dfl-radius);
    background: var(--dfl-surface);
    text-align: center;
}

.dfl-empty__title {
    margin: 0 0 .25rem;
    font-weight: 600;
}

.dfl-empty__text {
    margin: 0;
    color: var(--dfl-muted);
}

/* Block header */
.dfl-block__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.dfl-block__badge {
    margin: 0 0 .25rem;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--dfl-accent);
}

.dfl-block__title {
    margin: 0;
    font-size: clamp(1.625rem, 3.5vw, 2.25rem);
    line-height: 1.1;
    letter-spacing: -.02em;
}

.dfl-block__description {
    margin: .5rem 0 0;
    color: var(--dfl-muted);
}

.dfl-block__more {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: .125rem;
    font-weight: 500;
    color: var(--dfl-accent);
    text-decoration: none;
}

/* Detail */
.dfl-back a {
    display: inline-flex;
    align-items: center;
    gap: .125rem;
    min-height: 44px;
    color: var(--dfl-accent);
    text-decoration: none;
    font-weight: 500;
}

.dfl-detail__header {
    display: grid;
    gap: .75rem;
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.dfl-detail__range {
    margin: 0;
    font-size: 1.0625rem;
    color: var(--dfl-muted);
}

.dfl-notice {
    margin: 0;
    padding: .75rem 1rem;
    border-radius: var(--dfl-radius-sm);
    background: var(--dfl-surface);
    font-size: .9375rem;
}

.dfl-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .25rem;
}

.dfl-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 44px;
    padding: 0 1.125rem;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: .9375rem;
    font-weight: 500;
    color: var(--dfl-text);
    background: var(--dfl-surface);
    text-decoration: none;
    cursor: pointer;
    transition: transform .1s ease-out, background-color .2s var(--dfl-ease);
}

.dfl-btn:active {
    transform: scale(.97);
}

.dfl-btn--primary {
    color: #fff;
    background: var(--dfl-accent);
}

/* Viewer */
.dfl-viewer {
    position: relative;
}

.dfl-viewer__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(100%, 560px);
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    border-radius: var(--dfl-radius);
}

.dfl-viewer__track::-webkit-scrollbar {
    display: none;
}

.dfl-viewer__track:focus-visible {
    outline: 2px solid var(--dfl-accent);
    outline-offset: 4px;
}

.dfl-viewer__slide {
    margin: 0;
    scroll-snap-align: start;
    border-radius: var(--dfl-radius);
    overflow: hidden;
    background: var(--dfl-surface);
}

.dfl-viewer__slide img {
    display: block;
    width: 100%;
    height: auto;
}

.dfl-viewer__zoom {
    display: block;
    cursor: zoom-in;
    -webkit-tap-highlight-color: transparent;
}

/* Tam boy görüntüleyici (JS ile açılır; orijinal görsel yalnız burada iner) */
.dfl-lightbox {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    color: #fff;
    background: rgba(0, 0, 0, .92);
}

.dfl-lightbox::backdrop {
    background: rgba(0, 0, 0, .6);
}

.dfl-lightbox__scroller {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
    touch-action: pinch-zoom pan-x pan-y;
}

.dfl-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: 100dvh;
    object-fit: contain;
    cursor: zoom-in;
}

.dfl-lightbox.is-zoomed .dfl-lightbox__scroller {
    place-items: start center;
}

.dfl-lightbox.is-zoomed .dfl-lightbox__img {
    max-width: none;
    max-height: none;
    cursor: zoom-out;
}

.dfl-lightbox__close {
    position: fixed;
    top: max(.75rem, env(safe-area-inset-top));
    right: max(.75rem, env(safe-area-inset-right));
    z-index: 1;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .16);
    cursor: pointer;
}

html.dfl-lightbox-open {
    overflow: hidden;
}

.dfl-viewer__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.dfl-viewer__nav {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    color: var(--dfl-text);
    background: var(--dfl-surface);
    cursor: pointer;
    transition: transform .1s ease-out, opacity .2s;
}

.dfl-viewer__nav:active {
    transform: scale(.94);
}

.dfl-viewer__nav[disabled] {
    opacity: .35;
    cursor: default;
}

.dfl-viewer__counter {
    min-width: 4.5rem;
    text-align: center;
    font-size: .9375rem;
    font-variant-numeric: tabular-nums;
    color: var(--dfl-muted);
}

/* Product list */
.dfl-products {
    margin: 0;
    padding: 0;
    list-style: none;
    border-radius: var(--dfl-radius);
    background: var(--dfl-surface);
}

.dfl-products__item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .875rem 1.125rem;
}

.dfl-products__item + .dfl-products__item {
    border-top: 1px solid var(--dfl-line);
}

/* Bülten ürünleri: satır afişteki sayfayı açar */
.dfl-products--bulletin .dfl-products__item {
    padding: 0;
}

.dfl-products__link {
    display: flex;
    flex: 1;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: .875rem 1.125rem;
    color: inherit;
    text-decoration: none;
    border-radius: inherit;
    transition: background-color .2s var(--dfl-ease);
}

.dfl-products--bulletin .dfl-products__item:first-child .dfl-products__link {
    border-radius: var(--dfl-radius) var(--dfl-radius) 0 0;
}

.dfl-products--bulletin .dfl-products__item:last-child .dfl-products__link {
    border-radius: 0 0 var(--dfl-radius) var(--dfl-radius);
}

@media (hover: hover) {
    .dfl-products__link:hover {
        background: color-mix(in srgb, var(--dfl-text) 4%, transparent);
    }
}

.dfl-products__link:focus-visible {
    outline: 2px solid var(--dfl-accent);
    outline-offset: -2px;
}

.dfl-products--bulletin .dfl-products__item > .dfl-products__name {
    padding: .875rem 0 .875rem 1.125rem;
}

.dfl-products--bulletin .dfl-products__item > .dfl-price {
    padding: .875rem 1.125rem .875rem 0;
}

.dfl-products__size {
    color: var(--dfl-muted);
}

/* /firsatlar ürün listesi: ürünün hangi kampanyada olduğu adın altında küçük satır */
.dfl-products__campaign {
    display: block;
    margin-top: .125rem;
    font-size: .8125rem;
    font-weight: 400;
    color: var(--dfl-muted);
}

.dfl-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.dfl-section__more {
    flex-shrink: 0;
    font-size: .9375rem;
    color: var(--dfl-accent);
    text-decoration: none;
}

.dfl-section__more:hover {
    text-decoration: underline;
}

.dfl-products__link .dfl-price {
    flex-shrink: 0;
    justify-content: flex-end;
}

/* Ürünün afişteki yeri: satıra tıklanınca kısa süre çerçevelenir */
.dfl-viewer__zoom {
    position: relative;
}

.dfl-focus {
    position: absolute;
    border: 3px solid var(--dfl-accent);
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .28);
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s var(--dfl-ease);
}

.dfl-focus.is-visible {
    opacity: 1;
}

.dfl-products__price {
    flex-shrink: 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.dfl-terms {
    margin: 1.5rem 0 0;
    font-size: .8125rem;
    line-height: 1.5;
    color: var(--dfl-muted);
}

/* Pagination */
.dfl-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.dfl-pagination__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 1rem;
    border-radius: 999px;
    background: var(--dfl-surface);
    color: var(--dfl-text);
    text-decoration: none;
}

.dfl-pagination__link.is-disabled {
    opacity: .4;
}

.dfl-pagination__status {
    font-variant-numeric: tabular-nums;
    color: var(--dfl-muted);
}

@media (max-width: 640px) {
    .dfl-viewer__track {
        grid-auto-columns: 88%;
        gap: .75rem;
    }

    .dfl-block__header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dfl *,
    .dfl *::before,
    .dfl *::after {
        transition-duration: .01ms !important;
    }

    .dfl-viewer__track {
        scroll-behavior: auto;
    }
}

/* Screen-reader only text */
.dfl-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Price: new price emphasized, old price struck through, discount small */
.dfl-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem .5rem;
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.dfl-price__new {
    font-weight: 600;
    color: var(--dfl-text);
}

.dfl-price__old {
    font-size: .875em;
    color: var(--dfl-muted);
    text-decoration-thickness: 1px;
}

.dfl-price__discount {
    padding: .0625rem .4375rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--dfl-accent);
    background: color-mix(in srgb, var(--dfl-accent) 10%, transparent);
}

.dfl-products__item .dfl-price {
    flex-shrink: 0;
    justify-content: flex-end;
}

/* List: catalogs large, single-product deals dense */
.dfl-grid--catalogs {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.dfl-grid--deals {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 168px), 1fr));
    gap: clamp(.875rem, 2vw, 1.25rem);
}

.dfl-section--first {
    margin-top: 0;
}

.dfl-card--deal .dfl-card__media {
    aspect-ratio: 1;
    border-radius: var(--dfl-radius-sm);
}

.dfl-card--deal .dfl-card__link {
    gap: .625rem;
}

.dfl-card--deal .dfl-card__title {
    font-size: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dfl-card--deal .dfl-card__meta {
    font-size: .8125rem;
}

/* Detail: product card grid */
.dfl-deals {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
    gap: clamp(1rem, 2.5vw, 1.5rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.dfl-deals--single {
    grid-template-columns: minmax(0, 420px);
}

.dfl-deal {
    display: grid;
    gap: .625rem;
    align-content: start;
}

.dfl-deal__media {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--dfl-radius-sm);
    background: var(--dfl-surface);
    cursor: zoom-in;
    -webkit-tap-highlight-color: transparent;
    transition: transform .1s ease-out;
}

.dfl-deals--single .dfl-deal__media {
    aspect-ratio: 4 / 5;
    border-radius: var(--dfl-radius);
}

.dfl-deal__media:active {
    transform: scale(.98);
}

.dfl-deal__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dfl-deal__body {
    display: grid;
    gap: .25rem;
}

.dfl-deal__name {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -.01em;
}

@media (max-width: 640px) {
    .dfl-grid--deals,
    .dfl-deals:not(.dfl-deals--single) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
