﻿/* =========================
   ROOT + BASE
   ========================= */
:root {
    --bg: #f7f7f8;
    --card: #ffffff;
    --text: #171717;
    --muted: #6b7280;
    --brand: #b8946a;
    --brand-dark: #111827;
    --accent: #c41e3a;
    --shadow-sm: 0 6px 18px rgba(0,0,0,.08);
    --shadow: 0 16px 44px rgba(0,0,0,.14);
    --font-sans: "Inter","Segoe UI",system-ui,-apple-system,Arial,sans-serif;
    --font-display: "Playfair Display",Georgia,serif;
}

body {
    background: var(--bg);
    font-family: var(--font-sans);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* =========================
   PAGE HEAD
   ========================= */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin: 22px 0 14px;
}

.page-title {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: .01em;
    margin: 0;
    font-size: clamp(1.55rem, 2.2vw, 2.05rem);
    color: var(--brand-dark);
    line-height: 1.05;
}

.page-sub {
    margin: 6px 0 0;
    color: rgba(17,24,39,.66);
    font-weight: 560;
    font-size: clamp(.92rem, 1.2vw, 1rem);
}

.back-link {
    text-decoration: none;
    color: var(--brand-dark);
    font-weight: 800;
    letter-spacing: .02em;
    opacity: .72;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
}

    .back-link:hover {
        opacity: 1;
        text-decoration: underline;
    }

/* =========================
   GRID (RESPONSIVE)
   ========================= */
.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 14px;
    margin: 14px 0 26px;
}

/* =========================
   CARD
   ========================= */
.p-card {
    background: var(--card);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: .25s ease;
    position: relative;
    border: 1px solid rgba(17,24,39,.06);
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    border-radius: 0;
}

    .p-card:hover {
        transform: translateY(-6px);
        box-shadow: var(--shadow);
    }

.p-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* resim yüksekliği: akıllı */
.p-img-wrapper {
    position: relative;
    height: clamp(180px, 22vw, 220px);
    overflow: hidden;
    background: #f3f4f6;
    flex: 0 0 auto;
}

.p-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .55s ease;
    display: block;
    will-change: transform;
    transform: scale(1.01);
}

.p-card:hover .p-img {
    transform: scale(1.06);
}

/* badges */
.discount-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 6;
    background: #dc2626;
    color: #fff;
    font-weight: 900;
    font-size: .74rem;
    letter-spacing: .12em;
    padding: 8px 10px;
    box-shadow: 0 10px 22px rgba(220,38,38,.25);
    text-transform: uppercase;
    border-radius: 0;
}

.favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: rgba(255,255,255,.96);
    display: grid;
    place-items: center;
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
    cursor: pointer;
    transition: .2s ease;
    border: none;
    z-index: 7;
}

    .favorite-btn:hover {
        transform: scale(1.06);
    }

    .favorite-btn i {
        font-size: 1.15rem;
    }

    .favorite-btn.favorited i {
        color: #dc2626;
    }

.stock-note {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 2px;
    user-select: none;
    pointer-events: none;
    text-shadow: 0 8px 20px rgba(0,0,0,.35);
}

    .stock-note .main {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-weight: 900;
        font-size: .82rem;
        letter-spacing: .04em;
        color: #dc2626;
    }

    .stock-note .sub {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-weight: 700;
        font-size: .70rem;
        letter-spacing: .03em;
        color: rgba(255,255,255,.92);
    }

/* body */
.p-body {
    padding: 10px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-height: 0;
}

.p-name {
    font-size: clamp(.92rem, 1.2vw, .96rem);
    font-weight: 650;
    color: #0f172a;
    margin: 0;
    line-height: 1.25;
    letter-spacing: .01em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.p-desc {
    margin: 0;
    padding-top: 1px;
    font-size: clamp(.82rem, 1.05vw, .84rem);
    font-weight: 500;
    color: rgba(15,23,42,.62);
    line-height: 1.22;
    letter-spacing: .01em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

    .p-desc:empty {
        display: none;
    }

/* bottom */
.p-bottom {
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(15,23,42,.06);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    column-gap: 10px;
    min-height: 58px;
}

.p-price {
    display: flex;
    flex-direction: column;
    gap: 4px;
    white-space: nowrap;
    justify-content: flex-end;
}

.p-old {
    font-size: .82rem;
    color: rgba(15,23,42,.52);
    text-decoration: line-through;
    font-weight: 600;
    letter-spacing: .01em;
    line-height: 1;
}

.p-new {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    line-height: 1;
}

    .p-new .val {
        font-size: 1.08rem;
        font-weight: 700;
        color: #0f172a;
        letter-spacing: .01em;
        font-variant-numeric: tabular-nums;
    }

    .p-new .cur {
        font-size: .9rem;
        font-weight: 600;
        opacity: .68;
        letter-spacing: .02em;
    }

.p-price .ask {
    font-size: .9rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: .01em;
    line-height: 1.2;
}

.cart-mini-form {
    margin: 0;
    display: inline-flex;
    justify-self: end;
}

.p-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 0;
    border: 1px solid rgba(15,23,42,.12);
    background: #fff;
    color: #0f172a;
    font-weight: 700;
    font-size: .86rem;
    letter-spacing: .02em;
    transition: .18s ease;
    white-space: nowrap;
    user-select: none;
    line-height: 1;
    height: 34px;
    min-width: 118px;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15,23,42,.08);
}

.p-card:hover .p-cart-btn {
    border-color: rgba(196,30,58,.22);
    color: var(--accent);
}

.p-cart-btn.disabled,
.p-cart-btn:disabled {
    cursor: not-allowed !important;
    opacity: .80;
    border-color: rgba(15,23,42,.10) !important;
    color: rgba(15,23,42,.70) !important;
    background: #fff !important;
    box-shadow: none;
}

/* =========================
   RESPONSIVE BREAKPOINTS
   ========================= */
@media (max-width: 1199.98px) {
    .grid {
        grid-template-columns: repeat(3, minmax(0,1fr));
    }
}

@media (max-width: 991.98px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .p-img-wrapper {
        height: clamp(170px, 34vw, 220px);
    }
}

/* ✅ büyük telefonlarda 2 kolon daha iyi */
@media (max-width: 767.98px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}

/* ✅ küçük telefonlarda tek kolon */
@media (max-width: 575.98px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .p-img-wrapper {
        height: 210px;
    }
}

/* ✅ çok küçük cihaz: alt bar tek kolon olsun (taşma fix) */
@media (max-width: 480px) {
    .p-bottom {
        grid-template-columns: 1fr;
        row-gap: 10px;
        align-items: start;
    }

    .cart-mini-form {
        justify-self: start;
    }

    .p-cart-btn {
        min-width: 140px;
    }
}
