/* assets/css/pages/kds_style.css - UI for Digitalni Jedilnik (KDS) Frontend */

:root {
    --kds-primary: #10b981; /* Food.si green */
    --kds-primary-dark: #059669;
    --kds-bg: #f9fafb;
    --kds-card-bg: #ffffff;
    --kds-text: #111827;
    --kds-text-muted: #6b7280;
    --kds-border: #e5e7eb;
    --kds-danger: #ef4444;
    --kds-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --kds-radius: 12px;
}

html, body {
    scroll-behavior: smooth;
    overflow-y: auto !important;
    height: auto !important;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}

body.kds-body {
    background-color: var(--kds-bg);
    color: var(--kds-text);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    padding-bottom: 120px; /* Space for sticky cart */
    -webkit-font-smoothing: antialiased;
}

/* Theme Toggle Button */
.kds-theme-toggle {
    background: none;
    border: none;
    color: var(--kds-text);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--kds-bg);
    transition: all 0.2s;
}
.kds-theme-toggle:hover {
    background-color: var(--kds-border);
}

/* Dark Mode Support */
body.dark-theme {
    --kds-bg: #111827;
    --kds-card-bg: #1f2937;
    --kds-text: #f9fafb;
    --kds-text-muted: #9ca3af;
    --kds-border: #374151;
    --kds-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}
body.dark-theme .kds-btn-round {
    background: var(--kds-bg);
}
body.dark-theme .kds-btn-round.add {
    background: var(--kds-primary);
}
body.dark-theme .kds-input {
    background: var(--kds-bg);
    color: var(--kds-text);
    border-color: var(--kds-border);
}
body.dark-theme .kds-input::placeholder {
    color: var(--kds-text-muted);
}
body.dark-theme .kds-status-banner {
    background: #7f1d1d;
    color: #fca5a5;
}

/* Header */
.kds-header {
    background: var(--kds-card-bg);
    padding: 15px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    text-align: center;
}
.kds-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}
.kds-header p {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: var(--kds-text-muted);
}

/* Status Banner */
.kds-status-banner {
    background: #fee2e2;
    color: #b91c1c;
    padding: 12px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

/* Categories Navigation */
.kds-nav {
    display: flex;
    overflow-x: auto;
    padding: 15px 20px;
    gap: 10px;
    background: var(--kds-bg);
    scrollbar-width: none; /* Firefox */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain; /* Prepreči "bounce" in pomaga pri desktop scrollu */
}
.kds-nav::-webkit-scrollbar {
    display: none; /* Chrome */
}
/* Desktop hover drsenje za .kds-nav (CSS only) */
@media (pointer: fine) {
    .kds-nav {
        /* Omogoči klasičen miški prijazen scrollbar na desktopu, a ga naredi zelo tankega in diskretnega */
        scrollbar-width: thin;
        scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
    }
    .kds-nav::-webkit-scrollbar {
        display: block;
        height: 4px;
    }
    .kds-nav::-webkit-scrollbar-track {
        background: transparent;
    }
    .kds-nav::-webkit-scrollbar-thumb {
        background-color: rgba(156, 163, 175, 0.5);
        border-radius: 4px;
    }
}
.kds-nav-link {
    background: var(--kds-card-bg);
    border: 1px solid var(--kds-border);
    padding: 8px 16px;
    border-radius: 20px;
    white-space: nowrap;
    text-decoration: none;
    color: var(--kds-text);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}
.kds-nav-link.active {
    background: var(--kds-primary);
    color: white;
    border-color: var(--kds-primary);
}

/* Menu Items */
.kds-container {
    padding: 0 20px;
    max-width: 600px;
    margin: 0 auto;
}
.kds-category-title {
    font-size: 22px;
    font-weight: 700;
    margin: 25px 0 15px 0;
    padding-top: 10px;
}

/* Hide scrollbar for image swiper */
.kds-category-images {
    scrollbar-width: none; /* Firefox */
}
.kds-category-images::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.kds-item-card {
    background: var(--kds-card-bg);
    border-radius: var(--kds-radius);
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: var(--kds-shadow);
    display: flex;
    flex-direction: column; /* Stack vertically on mobile */
    gap: 15px;
}

.kds-item-main-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
}

.kds-item-info {
    flex: 1;
}

.kds-item-footer {
    display: flex;
    justify-content: flex-end; /* Align controls to the right */
    width: 100%;
    padding-top: 10px;
    border-top: 1px dashed var(--kds-border);
}

.kds-item-title {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}
.kds-item-desc {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: var(--kds-text-muted);
    line-height: 1.4;
}
.kds-item-price {
    font-weight: 800;
    color: var(--kds-primary);
    font-size: 18px;
}

.kds-item-image {
    width: 80px; 
    height: 80px; 
    border-radius: 8px; 
    overflow: hidden; 
    flex-shrink: 0; 
    box-shadow: var(--kds-shadow);
}

.kds-item-image img {
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block;
}

@media (min-width: 600px) {
    .kds-item-card {
        flex-direction: row; /* Side by side on desktop */
        align-items: center;
        padding-right: 20px;
    }
    
    .kds-item-main-content {
        flex: 1;
        border-right: 1px dashed var(--kds-border);
        padding-right: 20px;
    }

    .kds-item-footer {
        width: auto;
        padding-top: 0;
        border-top: none;
        padding-left: 5px;
    }
    
    .kds-item-image {
        width: 90px;
        height: 90px;
    }
}

/* Add to cart buttons */
.kds-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--kds-bg);
    border-radius: 20px;
    padding: 4px;
}
.kds-btn-round {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--kds-card-bg);
    color: var(--kds-text);
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.kds-btn-round.add {
    background: var(--kds-primary);
    color: white;
}
.kds-btn-round:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.kds-qty {
    font-weight: 600;
    font-size: 15px;
    min-width: 20px;
    text-align: center;
}

/* Sticky Cart Bottom Bar */
.kds-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--kds-card-bg);
    padding: 15px 20px;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.kds-cart-bar.visible {
    transform: translateY(0);
}
.kds-cart-info {
    display: flex;
    flex-direction: column;
}
.kds-cart-total {
    font-weight: 700;
    font-size: 18px;
}
.kds-cart-items-count {
    font-size: 12px;
    color: var(--kds-text-muted);
}
.kds-btn-checkout {
    background: var(--kds-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

/* Modal (Checkout) */
.kds-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: none;
    align-items: flex-end;
}
.kds-modal-overlay.active {
    display: flex;
}
.kds-modal {
    background: var(--kds-card-bg);
    width: 100%;
    max-height: 85vh; /* Malo zmanjšano, da pušča prostor zgoraj */
    display: flex;
    flex-direction: column;
    border-radius: 20px 20px 0 0;
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.kds-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 10px;
    flex-shrink: 0;
}
.kds-modal-content-scrollable {
    overflow-y: auto;
    padding: 0 20px 40px;
    -webkit-overflow-scrolling: touch;
}
.kds-modal-title {
    margin: 0;
    font-size: 20px;
}
.kds-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--kds-text-muted);
    cursor: pointer;
}
.kds-form-group {
    margin-bottom: 15px;
}
.kds-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
}
.kds-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--kds-border);
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    font-family: inherit;
}
.kds-btn-block {
    width: 100%;
    background: var(--kds-primary);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}
.kds-privacy-notice {
    font-size: 11px;
    color: var(--kds-text-muted);
    text-align: center;
    margin-top: 15px;
}

/* Category Images Swiper Arrows */
.kds-nav-arrow {
    position: absolute;
    top: calc(50% - 5px); /* Adjusted for padding-bottom in wrapper */
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--kds-border);
    border-radius: 50%;
    display: none; /* Hidden on mobile */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    color: var(--kds-text);
    z-index: 10;
    transition: all 0.2s ease;
}

.kds-nav-arrow:hover {
    background: #fff;
    color: var(--kds-primary);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.kds-nav-arrow.prev {
    left: -15px;
}

.kds-nav-arrow.next {
    right: -15px;
}

@media (min-width: 768px) {
    .kds-nav-arrow {
        display: flex;
    }
}

body.dark-theme .kds-nav-arrow {
    background: rgba(31, 41, 55, 0.9);
    color: var(--kds-text);
    border-color: var(--kds-border);
}

body.dark-theme .kds-nav-arrow:hover {
    background: var(--kds-card-bg);
}