/* =============================================
   style.css – Restoran Gradina
   ============================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --green:      #2a6b35;
    --green-dark: #1e4f28;
    --green-light:#e8f4ea;
    --gold:       #c89820;
    --white:      #ffffff;
    --bg:         #f7f5f0;
    --card-bg:    #ffffff;
    --text:       #2c2c2c;
    --text-light: #666;
    --border:     #e0dbd0;
    --shadow:     0 2px 12px rgba(0,0,0,0.08);
    --radius:     14px;
    --nav-h:      56px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    max-width: 620px;
    margin: 0 auto;
    padding-bottom: 120px;
}

/* ---- HEADER ---- */
.header {
    background: var(--white);
    padding: 24px 20px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.logo {
    max-width: 180px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ---- BROJ STOLA ---- */
#table-input {
    background: linear-gradient(135deg, #2a6b35 0%, #1a4323 100%);
    color: #fff;
    padding: 22px 20px;
    text-align: center;
}

#table-input label {
    display: block;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    text-transform: uppercase;
    opacity: 0.9;
}

#table-input input {
    width: 110px;
    padding: 10px;
    font-size: 22px;
    text-align: center;
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 10px;
    background: rgba(255,255,255,0.92);
    color: #222;
    font-weight: 700;
    margin: 0 auto;
    display: block;
}

#table-input input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255,215,0,0.3);
}

#table-error {
    color: #ffcccc;
    font-size: 13px;
    margin-top: 8px;
    min-height: 18px;
}

.table-hint {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 6px;
}

/* ---- STICKY NAVIGACIJA ---- */
.category-nav {
    position: sticky;
    top: 0;
    z-index: 900;
    background: var(--white);
    border-bottom: 2px solid var(--green);
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    flex: 0 0 auto;
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    letter-spacing: 0.3px;
}

.nav-btn:hover {
    color: var(--green);
}

.nav-btn.active {
    color: var(--green-dark);
    border-bottom-color: var(--green);
    font-weight: 700;
}

/* ---- SADRŽAJ MENIJA ---- */
.menu-content {
    padding: 0 14px;
}

/* ---- SEKCIJA ---- */
.menu-section {
    padding-top: 28px;
}

.section-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--green-dark);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 10px 0 10px 4px;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--green-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title span {
    font-size: 22px;
}

/* ---- KARTICA JELA ---- */
.item {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.18s, box-shadow 0.18s;
    animation: fadeUp 0.4s ease-out both;
}

.item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}

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

.item-info {
    padding: 14px 16px 16px;
}

.item-info h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.ingredients {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 14px;
}

.item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* ---- CIJENA ---- */
.price {
    font-size: 20px;
    font-weight: 800;
    color: var(--gold);
    flex-shrink: 0;
}

/* ---- KOLIČINA + DODAJ ---- */
.qty-add {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-control {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.qty-btn {
    width: 34px;
    height: 34px;
    background: transparent;
    border: none;
    font-size: 18px;
    font-weight: 700;
    color: var(--green-dark);
    cursor: pointer;
    padding: 0;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--green-light);
}

.qty-control input[type="number"] {
    width: 40px;
    height: 34px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    -moz-appearance: textfield;
}

.qty-control input[type="number"]::-webkit-outer-spin-button,
.qty-control input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.add-btn {
    padding: 8px 18px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: background 0.18s, transform 0.1s;
    height: 34px;
    white-space: nowrap;
}

.add-btn:hover {
    background: var(--green-dark);
}

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

/* ---- PIĆE ROW ---- */
.drink {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    animation: fadeUp 0.4s ease-out both;
}

.drink-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.drink-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---- PLUTAJUĆE DUGME KORPE ---- */
.cart-fab {
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(42,107,53,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 800;
    transition: background 0.18s, transform 0.15s;
}

.cart-fab:hover {
    background: var(--green-dark);
    transform: scale(1.07);
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e53935;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #fff;
    line-height: 1;
}

/* ---- OVERLAY ---- */
.cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.25s;
}

.cart-overlay.visible {
    display: block;
    opacity: 1;
}

/* ---- PANEL KORPE ---- */
.cart-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 620px;
    background: var(--white);
    border-radius: 20px 20px 0 0;
    z-index: 1100;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.18);
    transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.cart-panel.open {
    transform: translateX(-50%) translateY(0);
}

.cart-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
}

.cart-panel-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--green-dark);
}

.close-cart {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.close-cart:hover {
    background: var(--bg);
}

.cart-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 20px;
    -webkit-overflow-scrolling: touch;
}

.cart-empty-msg {
    text-align: center;
    color: var(--text-light);
    font-size: 15px;
    margin-top: 20px;
}

.cart-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 8px;
}

.cart-item-row:last-child {
    border-bottom: none;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.cart-item-price {
    font-size: 13px;
    color: var(--gold);
    font-weight: 700;
}

.remove-btn {
    background: #fee;
    border: 1px solid #fcc;
    color: #c0392b;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.15s;
    flex-shrink: 0;
}

.remove-btn:hover {
    background: #fcc;
}

.cart-panel-footer {
    padding: 14px 20px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.cart-total-line {
    font-size: 18px;
    font-weight: 800;
    color: var(--green-dark);
    margin-bottom: 12px;
    text-align: right;
}

.send-order-btn {
    width: 100%;
    padding: 14px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.18s, transform 0.1s;
    text-transform: uppercase;
}

.send-order-btn:hover {
    background: var(--green-dark);
}

.send-order-btn:active {
    transform: scale(0.98);
}

/* ---- PORUKE ---- */
#message-container {
    position: fixed;
    bottom: 96px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}

#message-container .success-message,
#message-container .error-message {
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    white-space: nowrap;
}

#message-container .success-message {
    background: var(--green);
    color: #fff;
}

#message-container .error-message {
    background: #c0392b;
    color: #fff;
}

/* ---- ANIMACIJA ---- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- RAZDJELNIK PIĆE U NAVIGACIJI ---- */
.nav-btn.nav-divider {
    border-left: 2px solid var(--border);
    margin-left: 4px;
    padding-left: 20px;
}

/* ---- NASLOV SEKCIJE PIĆA ---- */
.section-drinks-header {
    padding-top: 36px;
}

.section-title--drinks {
    font-size: 20px;
    color: #1a3f6b;
    border-bottom-color: #c8e0f7;
    background: linear-gradient(135deg, #eef4fc 0%, #f7f5f0 100%);
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 0;
}

/* ---- MOBILNI ---- */
@media (max-width: 480px) {
    .item img {
        height: 160px;
    }
    .price {
        font-size: 18px;
    }
    .nav-btn {
        padding: 13px 14px;
        font-size: 12px;
    }
    .add-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    .drink {
        flex-direction: column;
        align-items: flex-start;
    }
}
