/* ========================================
   CATEGORY PAGE - APPLE INSPIRED DESIGN
   Mobile-First Product Grid
======================================== */

/* Masaüstünde geri ok gizli; header dengesi için sol boşluk korunur */
.header-leading-spacer {
    display: none;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .menu-icon--category-back {
        display: none !important;
    }

    .header-leading-spacer {
        display: block;
    }
}

/* Import Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ========================================
   PAGE TITLE (GLASSMORPHISM)
======================================== */
.page-title {
    position: relative; /* Sticky'den relative'e çevrildi */
    margin: 24px auto 32px;
    max-width: fit-content;
    font-size: 18px;
    font-weight: 700;
    color: #1D1D1F;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding: 9px 20px;
    border-radius: 100px;
    box-shadow: 0 4px 24px rgba(28, 77, 141, 0.08);
    z-index: 90;
    letter-spacing: -0.6px;
    text-align: center;
    border: 1px solid rgba(28, 77, 141, 0.1);
}

@media (max-width: 767px) {
    .page-title {
        font-size: 16px;
        padding: 8px 18px;
        margin: 16px auto 24px;
    }
}

@media (min-width: 1024px) {
    .page-title {
        font-size: 28px; /* Küçültüldü */
        padding: 12px 32px;
        margin: 32px auto 48px; /* Margin küçültüldü */
        letter-spacing: -0.8px;
    }
}

/* ========================================
   PRODUCT GRID (BENTO STYLE)
======================================== */
.menu-items {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 0 20px 76px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative; /* Z-index sorunu için */
    z-index: 1;
}

@media (min-width: 640px) {
    .menu-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        padding: 0 30px 92px;
    }
}

@media (min-width: 1024px) {
    .menu-items {
        grid-template-columns: repeat(3, 1fr);
        gap: 22px;
        padding: 0 44px 112px;
        max-width: 1060px;
    }
}

/* ========================================
   PRODUCT CARDS (PREMIUM)
======================================== */
.menu-item {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.028);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.menu-item:active {
    transform: scale(0.97);
}

@media (hover: hover) {
    .menu-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 14px 40px rgba(28, 77, 141, 0.11);
    }
}

.menu-item img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 1024px) {
    .menu-item img {
        aspect-ratio: 16/10; /* Desktop: biraz daha geniş, daha az yüksek */
    }
}

.menu-item:hover img {
    transform: scale(1.03);
}

.menu-item-content {
    padding: 15px;
}

@media (min-width: 1024px) {
    .menu-item-content {
        padding: 17px;
    }
}

.menu-item-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #1D1D1F;
    letter-spacing: -0.35px;
    line-height: 1.28;
}

.menu-item-description {
    font-size: 12.5px;
    color: #86868B;
    margin-bottom: 10px;
    line-height: 1.48;
    font-weight: 400;
}

.menu-item-price {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #5B9BD5 0%, #1C4D8D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
}

.menu-item-price-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.menu-item-price-old {
    font-size: 12px;
    color: #9ca3af;
    text-decoration: line-through;
    font-weight: 600;
}

.menu-item-discount {
    font-size: 11px;
    font-weight: 700;
    color: #b91c1c;
    background: #fee2e2;
    border-radius: 999px;
    padding: 2px 8px;
}

/* Desktop: Optimize */
@media (min-width: 1024px) {
    .menu-item-title {
        font-size: 17px;
        margin-bottom: 7px;
    }

    .menu-item-description {
        font-size: 13px;
        margin-bottom: 12px;
        line-height: 1.48;
    }

    .menu-item-price {
        font-size: 19px;
    }
}

/* ========================================
   EMPTY & ERROR STATES
======================================== */
.error-message,
.no-products-message {
    text-align: center;
    padding: 80px 32px;
    color: #86868B;
    max-width: 480px;
    margin: 0 auto;
}

.error-message i,
.no-products-message i {
    font-size: 48px;
    color: #D1D1D6;
    margin-bottom: 24px;
    display: block;
}

.error-message p,
.no-products-message p {
    margin: 12px 0;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.5;
}

.btn-back {
    display: inline-block;
    margin-top: 24px;
    padding: 12px 32px;
    background: linear-gradient(135deg, #5B9BD5 0%, #1C4D8D 100%);
    color: white;
    text-decoration: none;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(28, 77, 141, 0.2);
}

.btn-back:hover {
    background: linear-gradient(135deg, #4A8AC4 0%, #15437C 100%);
    box-shadow: 0 6px 16px rgba(28, 77, 141, 0.3);
}

.btn-back:active {
    transform: scale(0.96);
}

/* ========================================
   MODAL (PRODUCT DETAIL)
======================================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content {
    background: white;
    border-radius: 28px;
    max-width: 640px;
    width: 100%;
    overflow: hidden;
    position: relative;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-image {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
}

.modal-details {
    padding: 32px;
}

.modal-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1D1D1F;
    letter-spacing: -0.7px;
    line-height: 1.2;
}

.modal-description {
    font-size: 16px;
    color: #86868B;
    margin-bottom: 24px;
    line-height: 1.7;
    font-weight: 400;
}

.modal-price {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #5B9BD5 0%, #1C4D8D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.8px;
}

.modal-old-price {
    font-size: 20px;
    color: #9ca3af;
    text-decoration: line-through;
    font-weight: 600;
    margin-right: 8px;
}

.modal-discount {
    font-size: 16px;
    color: #b91c1c;
    background: #fee2e2;
    border-radius: 999px;
    padding: 4px 10px;
    margin-left: 8px;
    vertical-align: middle;
}

/* ========================================
   BACK LINK (yalnızca geniş ekran; mobil/tablette header’da ok zaten var)
======================================== */
.back-link {
    display: none;
    align-items: center;
    gap: 8px;
    color: #1D1D1F;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 100px;
    background: white;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    margin: 20px;
    transition: all 0.2s ease;
    position: fixed;
    top: 64px;
    left: 0;
    z-index: 95;
}

@media (min-width: 1024px) {
    .back-link {
        display: inline-flex;
    }
}

.back-link:hover {
    background: #F5F5F7;
    color: #1C4D8D;
}

.back-link:active {
    transform: scale(0.96);
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   SKELETON LOADING
======================================== */
.skeleton {
    background: linear-gradient(
        90deg,
        #F5F5F7 0%,
        #E5E5EA 50%,
        #F5F5F7 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 24px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-item {
    aspect-ratio: 4/3;
    border-radius: 20px;
    margin-bottom: 22px;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
======================================== */
@media (max-width: 768px) {
    .menu-items {
        gap: 18px;
        padding: 0 16px 60px;
    }

    .menu-item-content {
        padding: 16px;
    }

    .modal {
        padding: 16px;
    }

    .modal-content {
        border-radius: 24px;
    }

    .modal-details {
        padding: 24px;
    }

    .modal-title {
        font-size: 24px;
    }

    .modal-description {
        font-size: 15px;
    }

    .modal-price {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .menu-items {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* ========================================
   SAFE AREA (iPhone Notch)
======================================== */
@supports (padding: env(safe-area-inset-left)) {
    @media (min-width: 1024px) {
        .back-link {
            left: max(20px, env(safe-area-inset-left));
        }
    }

    .menu-items {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
}

/* ========================================
   SMOOTH SCROLLING (iOS OPTIMIZATION)
======================================== */
* {
    -webkit-overflow-scrolling: touch;
}
