/* ==========================================================
   FLASH SALE — Modern Component (fsx)
   Teknolojiler: @property, conic-gradient, container queries,
   color-mix(), :has(), prefers-reduced-motion
   Sadece style.css değişkenleri kullanılır.
   ========================================================== */

@property --fsx-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.fsx-wrap {
    container-type: inline-size;
    container-name: fsx;
    margin-bottom: 50px;
}

.fsx {
    --fsx-pink: var(--primary, #FF006A);
    --fsx-pink-d: var(--primary-hover, #D70059);
    position: relative;
    isolation: isolate;
    border-radius: 16px;
    padding: 2px; /* animasyonlu kenarlık kalınlığı */
    background: conic-gradient(from var(--fsx-angle),
            color-mix(in srgb, var(--fsx-pink) 15%, transparent) 0deg,
            var(--fsx-pink) 70deg,
            #FFB300 120deg,
            color-mix(in srgb, var(--fsx-pink) 15%, transparent) 190deg,
            color-mix(in srgb, var(--fsx-pink) 15%, transparent) 360deg);
    animation: fsxSpin 6s linear infinite;
    box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--fsx-pink) 45%, transparent);
}

@keyframes fsxSpin { to { --fsx-angle: 360deg; } }

.fsx-inner {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--fsx-pink) 10%, #fff) 0%, #fff 55%),
        #fff;
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 24px 20px;
    align-items: center;
    text-align: center;
}

/* ince nokta deseni */
.fsx-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(color-mix(in srgb, var(--fsx-pink) 18%, transparent) 1px, transparent 1px);
    background-size: 18px 18px;
    mask-image: linear-gradient(90deg, #000 0%, transparent 45%);
    -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 45%);
    pointer-events: none;
    z-index: -1;
}

/* ---------- Sol: başlık ---------- */
.fsx-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.fsx-badge-row { display: flex; align-items: center; gap: 14px; }

.fsx-percent {
    position: relative;
    flex-shrink: 0;
    width: 74px;
    height: 74px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--fsx-pink) 0%, var(--fsx-pink-d) 100%);
    box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--fsx-pink) 70%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, .35);
    line-height: 1;
}

.fsx-percent b { font-size: 26px; font-weight: 900; letter-spacing: -1px; }
.fsx-percent small { display: block; font-size: 9px; font-weight: 700; letter-spacing: 1px; opacity: .9; margin-top: 3px; }

.fsx-percent i {
    position: absolute;
    top: -9px;
    right: -9px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 15px;
    color: var(--fsx-pink);
    background: #FFF200;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
    animation: fsxBolt 1.8s ease-in-out infinite;
}

@keyframes fsxBolt {
    0%, 100% { transform: scale(1) rotate(0); }
    50% { transform: scale(1.15) rotate(-12deg); }
}

.fsx-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .8px;
    color: var(--fsx-pink);
    background: color-mix(in srgb, var(--fsx-pink) 10%, #fff);
    border: 1px solid color-mix(in srgb, var(--fsx-pink) 22%, transparent);
}

.fsx-chip .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--fsx-pink);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--fsx-pink) 60%, transparent);
    animation: fsxLive 1.6s infinite;
}

@keyframes fsxLive {
    70% { box-shadow: 0 0 0 7px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.fsx-title {
    font-size: 19px;
    font-weight: 900;
    color: var(--black, #212121);
    letter-spacing: -.4px;
    line-height: 1.25;
    margin: 0;
    text-wrap: balance;
}

.fsx-title em {
    font-style: normal;
    background: linear-gradient(90deg, var(--fsx-pink), #FF7A00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.fsx-sub {
    font-size: 13.5px;
    color: var(--grey-text, #666);
    font-weight: 500;
    margin: 4px 0 0;
}

/* stok barı */
.fsx-stock { width: 100%; max-width: 360px; }

.fsx-stock-top {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--grey-text, #666);
    margin-bottom: 6px;
}

.fsx-stock-top strong { color: var(--fsx-pink); }

.fsx-bar {
    height: 7px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--fsx-pink) 10%, #f1f1f1);
    overflow: hidden;
}

.fsx-bar span {
    display: block;
    height: 100%;
    width: var(--fsx-stock, 78%);
    border-radius: inherit;
    background: linear-gradient(90deg, #FF7A00, var(--fsx-pink));
    background-size: 200% 100%;
    animation: fsxFill 1.4s cubic-bezier(.23, 1, .32, 1) both .3s, fsxFlow 2.5s linear infinite;
    transform-origin: left;
}

@keyframes fsxFill { from { transform: scaleX(0); } }
@keyframes fsxFlow { to { background-position: -200% 0; } }

/* ---------- Sağ: sayaç + CTA ---------- */
.fsx-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.fsx-ends {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--light-grey, #999);
    display: flex;
    align-items: center;
    gap: 6px;
}

.fsx-timer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-variant-numeric: tabular-nums;
}

.fsx-unit { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fsx-digits { display: flex; gap: 4px; }

.fsx-d {
    position: relative;
    width: 34px;
    height: 46px;
    border-radius: 9px;
    background: var(--black, #212121);
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    display: grid;
    place-items: center;
    overflow: hidden;
    box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
    perspective: 200px;
}

/* ortadaki kesik çizgi (flip clock hissi) */
.fsx-d::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(0, 0, 0, .45);
}

.fsx-d span { display: block; }
.fsx-d.flip span { animation: fsxFlip .45s cubic-bezier(.23, 1, .32, 1); }

@keyframes fsxFlip {
    0% { transform: rotateX(90deg); opacity: 0; }
    100% { transform: rotateX(0); opacity: 1; }
}

.fsx-unit small {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .8px;
    color: var(--grey-text, #666);
}

.fsx-colon {
    font-size: 22px;
    font-weight: 900;
    color: var(--fsx-pink);
    line-height: 46px;
    animation: fsxBlink 1s steps(1) infinite;
}

@keyframes fsxBlink { 50% { opacity: .25; } }

.fsx-cta {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 280px;
    padding: 13px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .3px;
    color: #fff !important;
    background: linear-gradient(135deg, var(--fsx-pink) 0%, var(--fsx-pink-d) 100%);
    box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--fsx-pink) 80%, transparent);
    transition: transform .25s, box-shadow .25s;
}

.fsx-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
    transform: translateX(-120%);
    animation: fsxShine 3.2s ease-in-out infinite 1s;
}

@keyframes fsxShine { 40%, 100% { transform: translateX(120%); } }

.fsx-cta i { transition: transform .25s; }
.fsx-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -12px color-mix(in srgb, var(--fsx-pink) 85%, transparent); }
.fsx-cta:hover i { transform: translateX(4px); }
.fsx-cta:focus-visible { outline: 3px solid color-mix(in srgb, var(--fsx-pink) 40%, transparent); outline-offset: 3px; }

/* son 1 saat: aciliyet vurgusu */
.fsx:has(.fsx-timer.is-urgent) .fsx-d { background: var(--fsx-pink); }

/* ---------- Container Queries (bileşen genişliğine göre) ---------- */
@container fsx (min-width: 640px) {
    .fsx-inner { padding: 26px 30px; }
    .fsx-title { font-size: 21px; }
    .fsx-d { width: 38px; height: 50px; font-size: 26px; }
    .fsx-colon { line-height: 50px; }
}

@container fsx (min-width: 900px) {
    .fsx-inner {
        grid-template-columns: 1fr auto;
        text-align: left;
        gap: 40px;
        padding: 28px 36px;
    }
    .fsx-head { flex-direction: row; align-items: center; gap: 22px; }
    .fsx-badge-row { gap: 22px; }
    .fsx-percent { width: 86px; height: 86px; border-radius: 20px; }
    .fsx-percent b { font-size: 30px; }
    .fsx-text-block { display: flex; flex-direction: column; gap: 12px; }
    .fsx-head .fsx-chip { align-self: flex-start; }
    .fsx-title { font-size: 24px; }
    .fsx-side { flex-direction: row; gap: 26px; }
    .fsx-side-timer { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
    .fsx-cta { width: auto; }
}

/* Container query desteklemeyen eski tarayıcılar için güvenli geri dönüş */
@supports not (container-type: inline-size) {
    @media (min-width: 992px) {
        .fsx-inner { grid-template-columns: 1fr auto; text-align: left; }
        .fsx-head, .fsx-side { flex-direction: row; }
    }
}

@media (max-width: 991px) {
    .fsx-wrap { margin-bottom: 30px; }
}

@media (max-width: 380px) {
    .fsx-d { width: 29px; height: 40px; font-size: 20px; }
    .fsx-colon { line-height: 40px; }
    .fsx-timer { gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
    .fsx, .fsx *, .fsx *::before { animation: none !important; transition: none !important; }
}
