body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    background: #f7f8fa;
    color: #1f2933;
}

.site-header {
    background: #1f2933;
    color: #fff;
    padding: 1rem 1.5rem;
}

.site-header h1 {
    margin: 0;
    font-size: 1.4rem;
}

.site-header h1 a {
    color: #fff;
    text-decoration: none;
}

.site-header p {
    margin: 0.2rem 0 0;
    color: #9aa5b1;
    font-size: 0.9rem;
}

.site-footer {
    background: #1f2933;
    color: #cbd2d9;
    margin-top: 3rem;
    padding: 2rem 1.5rem 1rem;
}

.site-footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.site-footer-inner a {
    display: block;
    color: #cbd2d9;
    text-decoration: none;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.site-footer-inner a:hover {
    color: #fff;
}

.site-footer-inner p {
    margin: 0.2rem 0;
    font-size: 0.9rem;
    color: #9aa5b1;
}

.site-footer-copy {
    max-width: 1000px;
    margin: 1.5rem auto 0;
    padding-top: 1rem;
    border-top: 1px solid #3e4c59;
    font-size: 0.8rem;
    color: #7b8794;
    text-align: center;
}

#scroll-top-btn {
    display: none;
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #1f2933;
    color: #fff;
    font-size: 1.3rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    z-index: 500;
}

#scroll-top-btn:hover {
    background: #323f4b;
}

@media (max-width: 640px) {
    #scroll-top-btn {
        right: 1rem;
        bottom: 1rem;
    }
}

.site-nav {
    display: flex;
    gap: 1.2rem;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid #3e4c59;
}

.site-nav a {
    color: #cbd2d9;
    text-decoration: none;
    font-size: 0.9rem;
}

.site-nav a:hover {
    color: #fff;
}

.site-ticker {
    flex: 1 1 200px;
    min-width: 0;
    overflow: hidden;
    align-self: center;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
}

.site-ticker-track {
    display: flex;
    width: max-content;
    animation: site-ticker-scroll 22s linear infinite;
}

.site-ticker-track span {
    padding-right: 3rem;
    white-space: nowrap;
    color: #ffd166;
    font-size: 0.85rem;
    font-weight: 600;
}

@keyframes site-ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .site-ticker-track {
        animation: none;
    }
    .site-ticker-track span:nth-child(2) {
        display: none;
    }
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.brand-logo {
    height: 36px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    flex-shrink: 0;
}

.nav-toggle-checkbox {
    display: none;
}

.nav-toggle-label {
    display: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.2rem 0.4rem;
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form input {
    padding: 0.5rem;
    border: 1px solid #3e4c59;
    border-radius: 4px;
    min-width: 260px;
}

.search-form button {
    padding: 0.5rem 1rem;
    background: #1f6feb;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.site-container {
    max-width: 1000px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
}

.site-container.wide {
    max-width: 1400px;
}

.legal-page {
    max-width: 760px;
    line-height: 1.6;
}

.legal-page h2 {
    margin-top: 2rem;
    font-size: 1.1rem;
    color: #1f2933;
}

.legal-page ul {
    padding-left: 1.3rem;
}

.shop-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.shop-sidebar {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.promo-banner {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    display: block;
}

.shop-main {
    flex: 1;
    min-width: 0;
}

@media (max-width: 900px) {
    .shop-layout {
        flex-direction: column;
    }

    .shop-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .shop-sidebar .promo-banner {
        width: calc(50% - 0.5rem);
    }
}

@media (max-width: 480px) {
    .shop-sidebar .promo-banner {
        width: 100%;
        max-height: 180px;
        object-fit: cover;
    }
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.filter-bar label {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
    color: #52606d;
    gap: 0.3rem;
}

.filter-bar label.checkbox-label {
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
}

.filter-bar select,
.filter-bar input[type="number"] {
    padding: 0.4rem;
    border: 1px solid #cbd2d9;
    border-radius: 4px;
    min-width: 120px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    padding: 1rem;
    display: block;
    transition: box-shadow 0.15s, transform 0.15s;
}

.product-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
    transform: translateY(-2px);
}

.card-link {
    text-decoration: none;
    color: #1f2933;
    display: block;
}

.card-cart-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.6rem;
}

.card-cart-form input[type="number"] {
    width: 55px;
    padding: 0.35rem;
    border: 1px solid #cbd2d9;
    border-radius: 4px;
}

.card-cart-form .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    margin-right: 0;
}

.product-card img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    background: #f0f2f5;
    border-radius: 4px;
    margin-bottom: 0.6rem;
}

.product-card .manufacturer {
    color: #52606d;
    font-size: 0.8rem;
}

.product-card .part-number {
    font-weight: bold;
    font-size: 1rem;
}

.product-card .item-code,
.product-detail .item-code {
    color: #52606d;
    font-size: 0.8rem;
}

.product-card .price {
    color: #1f6feb;
    font-weight: bold;
    margin-top: 0.4rem;
}

.card-description {
    display: none;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.view-toggle button {
    padding: 0.4rem 0.9rem;
    border: 1px solid #cbd2d9;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #1f2933;
    transition: background 0.15s;
}

.view-toggle button:hover:not(.active) {
    background: #f0f2f5;
}

.view-toggle button.active {
    background: #1f6feb;
    color: #fff;
    border-color: #1f6feb;
}

.product-grid.view-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.product-grid.view-list .product-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-grid.view-list .card-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.product-grid.view-list .product-card img {
    width: 140px;
    height: 100px;
    flex-shrink: 0;
    margin-bottom: 0;
}

.product-grid.view-list .product-card .card-info {
    flex: 1;
}

.product-grid.view-list .card-cart-form {
    margin-top: 0;
    flex-shrink: 0;
}

.product-grid.view-list .card-description {
    display: block;
    color: #52606d;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

@media (max-width: 640px) {
    .product-grid.view-list .product-card {
        flex-direction: column;
        align-items: stretch;
    }

    .product-grid.view-list .card-link {
        flex-direction: column;
    }

    .product-grid.view-list .product-card img {
        width: 100%;
        height: 140px;
    }

    .product-grid.view-list .card-cart-form {
        margin-top: 0.6rem;
    }
}

.empty-note {
    color: #52606d;
    padding: 2rem 0;
    text-align: center;
}

.product-detail {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
}

.product-detail .gallery img {
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    background: #f0f2f5;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.product-detail .thumbs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.product-detail .thumbs img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: #f0f2f5;
    border-radius: 4px;
}

.product-detail .manufacturer {
    color: #52606d;
}

.product-detail .price {
    font-size: 1.6rem;
    color: #1f6feb;
    font-weight: bold;
    margin: 0.5rem 0;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    background: #e6fffa;
    color: #234e52;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.spec-table td {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid #e4e7eb;
    font-size: 0.9rem;
}

.spec-table td:first-child {
    color: #52606d;
    width: 40%;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: #1f6feb;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    margin-right: 0.5rem;
    transition: background 0.15s;
}

.btn:hover:not(:disabled):not(.disabled) {
    background: #1a5fc9;
}

.btn.secondary {
    background: #7b8794;
}

.btn.secondary:hover:not(:disabled):not(.disabled) {
    background: #69747f;
}

.btn:disabled,
.btn.disabled {
    background: #cbd2d9;
    cursor: not-allowed;
}

.back-link {
    color: #1f6feb;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    text-decoration: underline;
}

.section-title {
    margin-top: 1.5rem;
    font-size: 1.1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.lang-flag {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    text-decoration: none;
    color: #fff;
    padding: 0.32rem 0.55rem;
    border-radius: 4px;
    border: 2px solid transparent;
    transition: filter 0.15s, border-color 0.15s;
}

.lang-flag[data-lang="sr"] {
    background: #c0392b;
}

.lang-flag[data-lang="en"] {
    background: #1f6feb;
}

.lang-flag:hover {
    filter: brightness(1.15);
}

.lang-flag.active {
    border-color: #fff;
}

.account-link {
    color: #9ecbff;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

.account-link:hover {
    color: #fff;
    text-decoration: underline;
}

.account-name {
    color: #fff;
    font-size: 0.9rem;
    white-space: nowrap;
}

.cart-link {
    color: #fff;
    text-decoration: none;
    background: #3e4c59;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    white-space: nowrap;
    transition: background 0.15s;
}

.cart-link:hover {
    background: #52606d;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.cart-table th,
.cart-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e4e7eb;
    text-align: left;
    vertical-align: top;
}

.cart-total {
    text-align: right;
    font-size: 1.3rem;
    font-weight: bold;
    margin: 1rem 0;
}

.errors {
    background: #fde8e8;
    color: #c53030;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.success {
    background: #e6fffa;
    color: #234e52;
    border-radius: 4px;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

.checkout-form,
.checkout-summary {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
}

.checkout-form label {
    display: block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.checkout-form .field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.password-toggle-wrap {
    position: relative;
    margin-top: 0.3rem;
}

.password-toggle-wrap input {
    margin-top: 0 !important;
    padding-right: 2.4rem !important;
}

.password-toggle-wrap .password-toggle-btn {
    position: absolute !important;
    width: auto !important;
    right: 0.3rem;
    top: 50%;
    transform: translateY(-50%);
    background: none !important;
    border: none !important;
    cursor: pointer;
    font-size: 1rem !important;
    line-height: 1;
    padding: 0.3rem 0.4rem !important;
    color: #52606d;
}

.password-toggle-wrap .password-toggle-btn:hover {
    color: #1f2933;
}

.checkout-form input,
.checkout-form select {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.3rem;
    box-sizing: border-box;
    border: 1px solid #cbd2d9;
    border-radius: 4px;
    font-family: inherit;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #e4e7eb;
    font-size: 0.9rem;
}

.summary-line.total {
    font-weight: bold;
    font-size: 1.1rem;
    border-bottom: none;
    margin-top: 0.5rem;
}

.table-scroll {
    overflow-x: auto;
}

/* Tablet i manje */
@media (max-width: 900px) {
    .product-detail {
        grid-template-columns: 1fr;
    }

    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .site-footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

/* Telefon */
@media (max-width: 640px) {
    .header-top {
        flex-wrap: wrap;
    }

    .search-form {
        order: 3;
        width: 100%;
    }

    .search-form input {
        min-width: 0;
        flex: 1;
    }

    .nav-toggle-label {
        display: block;
    }

    .site-nav {
        display: none;
        flex-direction: column;
        gap: 0;
    }

    .nav-toggle-checkbox:checked ~ .site-nav {
        display: flex;
    }

    .site-nav a {
        padding: 0.6rem 0;
        border-bottom: 1px solid #3e4c59;
    }

    .site-footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .checkout-form .field-row {
        grid-template-columns: 1fr;
    }

    .filter-bar select,
    .filter-bar input[type="number"] {
        width: 100%;
    }

    .cart-table,
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Chat widget */
#chat-widget {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
}

#chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1f6feb;
    color: #fff;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

#chat-window {
    position: absolute;
    bottom: 68px;
    right: 0;
    width: 320px;
    max-width: calc(100vw - 2rem);
    height: 420px;
    max-height: 70vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#chat-window[hidden] {
    display: none;
}

#chat-header {
    background: #1f2933;
    color: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

#chat-header button {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-msg {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    max-width: 85%;
    line-height: 1.4;
}

.chat-msg-bot {
    background: #f0f2f5;
    color: #1f2933;
    align-self: flex-start;
}

.chat-msg-user {
    background: #1f6feb;
    color: #fff;
    align-self: flex-end;
}

#chat-typing {
    padding: 0 0.75rem 0.5rem;
    font-size: 0.8rem;
    color: #9aa5b1;
    font-style: italic;
}

#chat-form {
    display: flex;
    border-top: 1px solid #e4e7eb;
}

#chat-form input {
    flex: 1;
    border: none;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
}

#chat-form input:focus {
    outline: none;
}

#chat-form button {
    background: #1f6feb;
    color: #fff;
    border: none;
    padding: 0 1rem;
    cursor: pointer;
    font-size: 0.85rem;
}

@media (max-width: 640px) {
    #chat-window {
        width: calc(100vw - 2rem);
        right: -0.75rem;
    }
}

.filter-hint {
    margin: -0.4rem 0 0.6rem;
    font-size: 0.78rem;
    color: #6b7280;
}

.package-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: 100%;
}

.package-filter-label {
    font-size: 0.8rem;
    color: #52606d;
}

.package-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.package-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border: 1px solid #cbd2d9;
    border-radius: 999px;
    font-size: 0.82rem;
    color: #1f2933;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, border-color 0.15s;
}

.package-chip:hover:not(.active) {
    background: #f0f2f5;
    border-color: #9aa5b1;
}

.package-chip input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.package-chip.active {
    background: #1f6feb;
    border-color: #1f6feb;
    color: #fff;
}

.package-chip-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    background: #fff;
    border: 1px solid #cbd2d9;
    border-radius: 6px;
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.package-chip:hover .package-chip-tooltip {
    display: block;
}

.package-chip-tooltip img {
    display: block;
    width: 110px;
    height: 110px;
    object-fit: contain;
}
