/* ============================================================
   products.css – Ürünler sayfası ek stilleri
   ============================================================ */

/* Body override */
body.products-page {
    background: var(--cream);
}

/* ---- Page Hero ---- */
.page-hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
    padding: 130px 24px 60px;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=1920&q=60&auto=format&fit=crop') center/cover;
    opacity: 0.12;
}

.page-hero-content {
    position: relative;
    z-index: 1;
}

.page-hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 12px;
}

.page-hero p {
    font-size: 1.05rem;
    opacity: 0.85;
}

.page-hero strong {
    color: var(--accent2);
}

/* ---- Main layout ---- */
.products-main {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
    padding-top: 44px;
    padding-bottom: 80px;
    align-items: start;
}

/* ---- Sidebar ---- */
.sidebar {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px 20px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 96px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.sidebar-header h3 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-header h3 i {
    color: var(--primary-light);
    font-size: 1rem;
}

.sidebar-close {
    display: none;
    color: var(--gray);
    font-size: 1.1rem;
    cursor: pointer;
}

.filter-block {
    margin-bottom: 28px;
}

.filter-block h4 {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 12px;
}

.search-wrap {
    position: relative;
}

.search-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 0.85rem;
}

.search-wrap input {
    width: 100%;
    padding: 10px 10px 10px 34px;
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--black);
    background: var(--cream);
    outline: none;
    transition: border-color 0.3s;
}

.search-wrap input:focus {
    border-color: var(--primary-light);
    background: var(--white);
}

.cat-filter-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cat-filter-btn {
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--gray);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cat-filter-btn span {
    background: var(--gray-light);
    color: var(--gray);
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.cat-filter-btn:hover {
    background: var(--blush);
    color: var(--primary);
}

.cat-filter-btn.active {
    background: var(--primary);
    color: var(--white);
}

.cat-filter-btn.active span {
    background: rgba(255, 255, 255, 0.25);
    color: var(--white);
}

/* Price range */
.price-range {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#priceRange {
    width: 100%;
    accent-color: var(--primary);
    height: 4px;
    cursor: pointer;
}

.price-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--gray);
}

#priceVal {
    color: var(--primary);
    font-weight: 600;
}

/* Sort select */
.sort-select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--black);
    background: var(--cream);
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s;
}

.sort-select:focus {
    border-color: var(--primary-light);
}

/* ---- Products Area ---- */
.products-area {
    min-width: 0;
}

.products-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.sidebar-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s;
}

.sidebar-toggle:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.results-count {
    font-size: 0.88rem;
    color: var(--gray);
    margin-left: auto;
}

.view-toggle {
    display: flex;
    gap: 4px;
}

.view-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-light);
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.88rem;
}

.view-btn.active,
.view-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* ---- Dynamic Products Grid ---- */
.products-grid-dynamic {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    transition: all 0.3s;
}

.products-grid-dynamic.list-view {
    grid-template-columns: 1fr;
}

/* Dynamic product card */
.dyn-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.35s, box-shadow 0.35s;
    cursor: pointer;
    position: relative;
    animation: cardIn 0.35s ease both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dyn-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.dyn-card-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--gray-light);
    transition: transform 0.5s;
}

.dyn-card:hover .dyn-card-img {
    transform: scale(1.05);
}

.dyn-card-img-wrap {
    overflow: hidden;
    position: relative;
}

.dyn-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    letter-spacing: 0.04em;
}

.dyn-card-fav {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--gray);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.3s, transform 0.3s, background 0.2s;
}

.dyn-card:hover .dyn-card-fav {
    opacity: 1;
    transform: translateY(0);
}

.dyn-card-fav:hover {
    background: #e74c3c;
    color: var(--white);
}

.dyn-card-fav.faved {
    opacity: 1;
    background: #e74c3c;
    color: var(--white);
}

.dyn-card-body {
    padding: 14px 16px 18px;
}

.dyn-card-cat {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-light);
    margin-bottom: 5px;
}

.dyn-card-name {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--primary-dark);
    line-height: 1.3;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dyn-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dyn-card-price {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

.dyn-card-price.no-price {
    color: var(--gray);
    font-size: 0.85rem;
    font-family: var(--font-body);
}

.dyn-card-order {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 0.8rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dyn-card-order:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 12px rgba(139, 94, 60, 0.35);
}

/* List view card */
.list-view .dyn-card {
    display: grid;
    grid-template-columns: 140px 1fr;
}

.list-view .dyn-card-img-wrap {
    height: 100%;
}

.list-view .dyn-card-img {
    aspect-ratio: auto;
    height: 100%;
    min-height: 120px;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 48px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-light);
    font-size: 0.88rem;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.page-btn:disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* ---- Lightbox ---- */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(26, 16, 8, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
    padding: 20px;
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
}

.lightbox-inner {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-width: 860px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.35s;
    max-height: 90vh;
}

.lightbox.open .lightbox-inner {
    transform: scale(1);
}

.lb-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    z-index: 1;
    border: none;
    transition: background 0.2s;
}

.lb-close:hover {
    background: var(--blush);
}

#lbImg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 340px;
}

.lb-info {
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    overflow-y: auto;
}

#lbCat {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-light);
}

#lbName {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    color: var(--primary-dark);
    line-height: 1.3;
}

.lb-price {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .products-main {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 500;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0;
        overflow-y: auto;
        padding-top: 20px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: flex;
    }

    .sidebar-toggle {
        display: flex;
    }
}

@media (max-width: 560px) {
    .lightbox-inner {
        grid-template-columns: 1fr;
    }

    #lbImg {
        min-height: 200px;
    }

    .lb-info {
        padding: 24px 20px;
    }
}

/* ---- Empty state ---- */
.empty-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 80px 20px;
    color: var(--gray);
}

.empty-state i {
    font-size: 3rem;
    color: var(--gray-light);
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 1rem;
}

/* active nav link */
.nav-link.active-link {
    color: var(--primary-light) !important;
}

.nav-link.active-link::after {
    transform: scaleX(1);
}

/* Sidebar overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 499;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}