/* ===================================================
   UrunlerSayfasi - Dlux Cafe Restaurant Menu
   Colors via theme.css variables
   Font: Karla / Playfair Display SC
   =================================================== */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Karla:wght@300;400;500;600;700;800&family=Playfair+Display+SC:wght@400;700&display=swap');

/* ---------- Local Tokens (non-color) ---------- */
:root {
    --menu-radius-sm: 12px;
    --menu-radius-md: 16px;
    --menu-radius-lg: 24px;
    --menu-font-display: 'Playfair Display SC', serif;
    --menu-font-body: 'Karla', sans-serif;
    --menu-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================================
   Page Wrapper — full viewport, no body scroll
   =================================================== */
.page-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--t-bg-deep);
}

/* ===================================================
   Category Banner — stays at top, never scrolls
   =================================================== */
.kategori-banner {
    flex-shrink: 0;
    width: 100%;
    height: 320px;
    overflow: hidden;
    position: relative;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.35) contrast(1.15) saturate(1.2);
    background: linear-gradient(135deg, var(--t-bg), var(--t-card-bg));
    animation: banner-breathe 8s ease-in-out infinite;
}

@keyframes banner-breathe {
    0%, 100% {
        transform: scale(1);
        filter: brightness(0.35) contrast(1.15) saturate(1.2);
    }
    50% {
        transform: scale(1.06);
        filter: brightness(0.4) contrast(1.2) saturate(1.3);
    }
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
    padding: 2rem;
    background: linear-gradient(
        to bottom,
        rgba(31, 31, 39, 0.2) 0%,
        rgba(31, 31, 39, 0.05) 40%,
        rgba(31, 31, 39, 0.75) 100%
    );
}

.banner-back-button {
    position: absolute;
    top: 50%;
    left: 1.5rem;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--menu-transition);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 20;
    color: white;
    text-decoration: none;
}

.banner-back-button:hover {
    background: rgba(255, 107, 53, 0.3);
    border-color: var(--t-orange);
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.banner-overlay h4 {
    font-family: var(--menu-font-display);
    font-size: clamp(1.5rem, 5vw, 2.8rem);
    font-weight: 700;
    margin: 0;
    letter-spacing: 3px;
    text-align: center;
    text-transform: uppercase;
    color: #ffffff;
}

/* ===================================================
   Product Container — overlaps fixed banner
   =================================================== */
.menu-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0 12px 100px;
    max-width: 900px;
    width: 100%;
    margin: -20px auto 0;
    background: var(--t-bg);
    border-top: 1px solid var(--t-border);
    border-radius: var(--menu-radius-lg) var(--menu-radius-lg) 0 0;
    box-shadow: var(--t-shadow-lg);
    position: relative;
    z-index: 2;
}

/* ---------- Product Count Header ---------- */
.product-count-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 4px 16px;
}

.product-count-text {
    font-family: var(--menu-font-body);
    font-size: 0.8rem;
    color: var(--t-text-muted);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.product-count-line {
    flex: 1;
    height: 1px;
    background: var(--t-border);
    margin-left: 14px;
}

/* ---------- Product Card ---------- */
.product-card {
    display: flex;
    align-items: stretch;
    background: var(--t-card-bg);
    border-radius: var(--menu-radius-md);
    overflow: hidden;
    margin-bottom: 14px;
    cursor: pointer;
    transition: all var(--menu-transition);
    border: 1px solid var(--t-border);
    box-shadow: var(--t-shadow-sm);
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--t-shadow-lg);
    border-color: var(--t-orange);
    background: var(--t-card-bg-hover);
}

.product-card:active {
    transform: translateY(-1px);
    box-shadow: var(--t-shadow-md);
    transition-duration: 80ms;
}

/* ---------- Product Image ---------- */
.product-card-image-wrapper {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    position: relative;
    overflow: hidden;
    background: var(--t-bg-elevated);
}

.product-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    background-color: #ffffff;
}

.product-card:hover .product-card-image {
    transform: scale(1.08);
}

/* ---------- Product Content ---------- */
.product-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    min-width: 0;
    justify-content: space-between;
}

.product-card-name {
    font-family: var(--menu-font-body);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--t-text-primary);
    margin: 0 0 2px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.2px;
}

.product-card-subtitle {
    font-family: var(--menu-font-body);
    font-size: 0.75rem;
    color: var(--t-orange);
    margin: 0 0 6px 0;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.product-card-description {
    font-family: var(--menu-font-body);
    font-size: 0.78rem;
    color: var(--t-text-secondary);
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* ---------- Product Footer ---------- */
.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    gap: 8px;
}

.product-card-price {
    font-family: var(--menu-font-body);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--t-gold);
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.product-card-calorie {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--menu-font-body);
    font-size: 0.65rem;
    color: var(--t-text-muted);
    background: var(--t-muted);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

/* ---------- Loading & Empty States ---------- */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-state p {
    font-family: var(--menu-font-body);
    color: var(--t-text-muted);
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 4px;
}

.empty-state h4 {
    font-family: var(--menu-font-display);
    font-size: 1.2rem;
    color: var(--t-text-primary);
    margin: 0;
    font-weight: 700;
    letter-spacing: 1px;
}

.empty-state p {
    font-family: var(--menu-font-body);
    color: var(--t-text-muted);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

/* ---------- Skeleton Loading ---------- */
.skeleton-card {
    display: flex;
    align-items: stretch;
    background: var(--t-card-bg);
    border-radius: var(--menu-radius-md);
    overflow: hidden;
    margin-bottom: 14px;
    border: 1px solid var(--t-border);
}

.skeleton-image {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--t-border), var(--t-bg-elevated));
    flex-shrink: 0;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-content {
    flex: 1;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--t-border) 25%, var(--t-bg-elevated) 50%, var(--t-border) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-line-short { width: 40%; }
.skeleton-line-medium { width: 70%; }
.skeleton-line-long { width: 90%; }

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* ===================================================
   Bottom Sheet - Mobile Product Detail
   =================================================== */

.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.bottom-sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--t-sheet-bg);
    border-radius: var(--menu-radius-lg) var(--menu-radius-lg) 0 0;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
    -webkit-overflow-scrolling: touch;
}

.bottom-sheet.open {
    transform: translateY(0);
}

.bottom-sheet-handle {
    display: flex;
    justify-content: center;
    padding: 12px 0 6px;
    cursor: grab;
    position: sticky;
    top: 0;
    background: var(--t-sheet-bg);
    z-index: 2;
}

.bottom-sheet-handle-bar {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--t-sheet-handle);
    transition: width 0.2s ease;
}

.bottom-sheet-handle:active .bottom-sheet-handle-bar {
    width: 48px;
    background: var(--t-orange);
}

.bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 20px 16px;
    position: sticky;
    top: 28px;
    background: var(--t-sheet-bg);
    z-index: 2;
}

.bottom-sheet-title {
    font-family: var(--menu-font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--t-text-primary);
    margin: 0;
    letter-spacing: 1px;
}

.bottom-sheet-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--t-sheet-close-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--menu-transition);
    flex-shrink: 0;
}

.bottom-sheet-close:hover {
    background: var(--t-border);
    transform: scale(1.05);
}

.bottom-sheet-content {
    padding: 0 20px 40px;
}

.sheet-product-image {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: var(--menu-radius-md);
    background: #ffffff;
    padding: 12px;
}

.sheet-price-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, var(--t-gold-dark), var(--t-gold));
    color: #ffffff;
    padding: 10px 24px;
    border-radius: 50px;
    font-family: var(--menu-font-body);
    font-weight: 800;
    font-size: 1.3rem;
    margin: 16px 0;
    box-shadow: 0 4px 20px rgba(255, 183, 3, 0.3);
    letter-spacing: -0.3px;
}

.sheet-info-section {
    margin: 8px 0;
}

.sheet-info-label {
    font-family: var(--menu-font-body);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--t-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.sheet-info-text {
    font-family: var(--menu-font-body);
    color: var(--t-text-secondary);
    line-height: 1.6;
    font-size: 0.92rem;
    margin: 0;
}

.sheet-divider {
    height: 1px;
    background: var(--t-border);
    margin: 14px 0;
}

.sheet-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--t-sheet-meta-bg);
    border-radius: var(--menu-radius-sm);
    margin-bottom: 10px;
}

.sheet-meta-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sheet-meta-label {
    font-family: var(--menu-font-body);
    font-size: 0.8rem;
    color: var(--t-text-secondary);
    font-weight: 600;
}

.sheet-meta-value {
    font-family: var(--menu-font-body);
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: auto;
}

.sheet-meta-value.calorie { color: #4ADE80; }
.sheet-meta-value.allergen { color: var(--t-orange); }

.sheet-alergen-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    background: var(--t-sheet-alergen-bg);
    border-radius: var(--menu-radius-sm);
    border-left: 3px solid var(--t-orange);
    margin-top: 10px;
}

.sheet-alergen-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.sheet-alergen-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sheet-alergen-title {
    font-family: var(--menu-font-body);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--t-orange);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sheet-alergen-text {
    font-family: var(--menu-font-body);
    font-size: 0.82rem;
    color: var(--t-orange-light);
    line-height: 1.5;
    margin: 0;
}

/* ===================================================
   Reduced Motion
   =================================================== */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .banner-image,
    .product-card-image,
    .bottom-sheet,
    .bottom-sheet-overlay,
    .bottom-sheet-handle-bar,
    .bottom-sheet-close,
    .skeleton-card,
    .skeleton-line {
        transition: none !important;
        animation: none !important;
    }

    .product-card:hover,
    .banner-back-button:hover {
        transform: none !important;
    }
}

/* ===================================================
   Responsive
   =================================================== */

@media (min-width: 481px) and (max-width: 768px) {
    .kategori-banner { height: 240px; }
    .banner-overlay { padding: 1.5rem; }
    .banner-back-button { width: 40px; height: 40px; left: 1rem; }
    .menu-container { padding: 0 16px 100px; }
    .product-card-image-wrapper { width: 110px; height: 110px; }
}

@media (max-width: 480px) {
    .kategori-banner { height: 160px; }
    .banner-back-button { width: 36px; height: 36px; left: 0.8rem; }
    .banner-overlay { padding: 0.5rem; }
    .banner-overlay h4 { font-size: clamp(1rem, 4vw, 1.5rem); font-weight: 700; letter-spacing: 2px; }
    .menu-container { padding: 0 10px 90px; }
    .product-card { margin-bottom: 10px; border-radius: var(--menu-radius-sm); }
    .product-card-image-wrapper { width: 100px; height: 100px; }
    .product-card-content { padding: 10px 12px; }
    .product-card-name { font-size: 0.88rem; }
    .product-card-subtitle { font-size: 0.7rem; }
    .product-card-description { font-size: 0.72rem; }
    .product-card-price { font-size: 0.95rem; }
    .product-card-calorie { font-size: 0.6rem; padding: 2px 6px; }
    .bottom-sheet { max-height: 92vh; }
    .sheet-product-image { max-height: 220px; }
    .sheet-price-badge { font-size: 1.1rem; padding: 8px 18px; margin: 12px 0; }
}

@media (min-width: 769px) {
    .menu-container { padding: 0 24px 100px; }
    .product-card { margin-bottom: 16px; }
    .product-card-image-wrapper { width: 140px; height: 140px; }
    .product-card-content { padding: 18px 20px; }
    .product-card-name { font-size: 1rem; }
    .product-card-description { font-size: 0.82rem; }
    .product-card-price { font-size: 1.1rem; }
}
