/*--Site Header - Moderan web shop dizajn--------------------------*/

/* Zajednički layout tokeni (header, footer, mega-menu, .home-container) */
:root {
    --site-content-max: 1400px;
    --site-gutter: clamp(1rem, 4vw, 2rem);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Header container — ista kolona kao .home-container / glavni sadržaj */
.header-container {
    width: 100%;
    max-width: var(--site-content-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--site-gutter);
    padding-right: var(--site-gutter);
    box-sizing: border-box;
}

/*--Header Top Bar (kontakt i social)-------------------------------*/
.header-top {
    background-color: #000022;
    color: #ffffff;
    font-size: 13px;
    padding: 8px 0;
}

.header-top .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-contact {
    display: flex;
    gap: 25px;
}

.header-contact span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-contact i {
    font-size: 12px;
    color: #e28413;
}

.header-social {
    display: flex;
    gap: 15px;
}

.header-social a {
    color: #ffffff;
    font-size: 16px;
    transition: all 0.2s ease;
    display: inline-block;
}

.header-social a:hover {
    color: #e28413;
    transform: translateY(-2px);
}

/*--Header Main (logo, search, akcije)------------------------------*/
.header-main {
    padding: 15px 0;
    background: #ffffff;
}

.header-main .header-container {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: clamp(0.75rem, 2vw, 1.5rem);
}

/* Logo */
.site-logo {
    flex-shrink: 0;
    display: block;
    height: 50px;
    transition: transform 0.2s ease;
}

.site-logo:hover {
    transform: scale(1.05);
}

.site-logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

/* Search bar */
.header-search {
    flex: 1;
    max-width: min(680px, 100%);
    position: relative;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.header-search input,
.header-search__input {
    width: 100%;
    padding: 12px 88px 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 15px;
    font-family: 'Nunito', sans-serif;
    transition: all 0.2s ease;
    background: #fbf5f3;
    color: #1a1a2e;
}

.header-search input::-webkit-search-cancel-button,
.header-search__input::-webkit-search-cancel-button {
    display: none;
}

.header-search input:focus,
.header-search__input:focus {
    outline: none;
    border-color: #e28413;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(226, 132, 19, 0.1);
}

.header-search input::placeholder,
.header-search__input::placeholder {
    color: #8a93a3;
}

.search-clear {
    position: absolute;
    right: 44px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #7a8494;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.search-clear:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}

.search-loading {
    position: absolute;
    right: 44px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #e28413;
    pointer-events: none;
}

.search-loading[hidden],
.search-clear[hidden] {
    display: none !important;
}

.header-search .search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e28413;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.header-search .search-button:hover {
    background: #c66f0f;
    transform: translateY(-50%) scale(1.05);
}

.header-search .search-button i {
    font-size: 16px;
}

/* Search dropdown */
.header-search .search-drop-down {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e8e8ee;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(17, 24, 39, 0.14);
    max-height: min(70vh, 460px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1001;
    padding: 8px 0;
}

.header-search .search-drop-down[hidden] {
    display: none !important;
}

.catalog-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f1f3f6;
    transition: background-color 0.15s ease;
}

.catalog-search-item:last-child {
    border-bottom: none;
}

.catalog-search-item:hover,
.catalog-search-item:focus-visible {
    background: #faf7f4;
    outline: none;
}

.catalog-search-item--category {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.catalog-search-item__thumb {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 10px;
    background: #f3f4f6 center / contain no-repeat;
    border: 1px solid #eceff3;
}

.catalog-search-item__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.catalog-search-item__eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #e28413;
}

.catalog-search-item__title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.catalog-search-item__meta {
    font-size: 12px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.catalog-search-item__availability {
    font-size: 11px;
    font-weight: 600;
    color: #4b5563;
}

.catalog-search-item__price {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    color: #e28413;
    white-space: nowrap;
}

.catalog-search-empty {
    padding: 18px 16px;
    text-align: center;
}

.catalog-search-empty__title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
}

.catalog-search-empty__hint {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.45;
}

.catalog-search-footer {
    padding: 8px 12px 10px;
    border-top: 1px solid #f1f3f6;
}

.catalog-search-footer__btn {
    width: 100%;
    border: 1px solid #eadfce;
    background: #fffaf4;
    color: #9a5b10;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.catalog-search-footer__btn:hover {
    background: #fff3e4;
    border-color: #e8c9a0;
}

/* Header Actions (CTA dugmići) */
.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(0.5rem, 1.2vw, 0.75rem);
    flex-shrink: 0;
    min-width: 0;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-action i {
    font-size: 16px;
}

.btn-primary {
    background: #e28413;
    color: #ffffff;
}

.btn-primary:hover {
    background: #c66f0f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(226, 132, 19, 0.3);
}

.btn-secondary {
    background: #000022;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #000033;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 34, 0.3);
}

.btn-cart {
    position: relative;
    background: #e28413;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 10px 16px;
}

.btn-cart:hover {
    background: #c66f0f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(226, 132, 19, 0.3);
}

.btn-cart i {
    font-size: 17px;
}

#global-saved-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #fff;
    color: #e28413;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    position: absolute;
    top: -4px;
    right: -4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: #000022;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/*--Site Navigation-------------------------------------------------*/
.site-nav {
    background: #e28413;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 999;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px clamp(0.65rem, 1.2vw, 1rem);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-menu > li > a i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.nav-menu > li > a:hover {
    background: rgba(0, 0, 0, 0.1);
}

.nav-menu > li.has-mega-menu > a:hover i {
    transform: rotate(180deg);
}

.nav-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 3px;
    background: #ffffff;
    transition: transform 0.3s ease;
}

.nav-menu > li > a:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.nav-menu > li:first-child > a {
    padding-left: 0;
}

.mobile-nav-close {
    display: none;
}

/*--Responsive Mobile-----------------------------------------------*/
@media (max-width: 1024px) {
    .header-search {
        max-width: min(400px, 100%);
    }

    .btn-action span {
        display: none;
    }

    .btn-action {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
    }

    .btn-cart {
        width: 42px;
        height: 42px;
        padding: 0;
        justify-content: center;
    }

    #global-saved-count {
        min-width: 16px;
        height: 16px;
        font-size: 10px;
        padding: 0 4px;
    }
}

@media (max-width: 768px) {
    .header-contact {
        gap: 15px;
        font-size: 12px;
    }

    .header-contact span:nth-child(3) {
        display: none; /* Sakrij email na mobile */
    }

    .header-main .header-container {
        grid-template-columns: 1fr auto auto;
        grid-template-rows: auto auto;
        row-gap: 0.75rem;
    }

    .site-logo {
        grid-column: 1;
        grid-row: 1;
    }

    .header-actions {
        grid-column: 2;
        grid-row: 1;
        gap: 0.5rem;
    }

    .mobile-menu-toggle {
        display: flex;
        grid-column: 3;
        grid-row: 1;
    }

    .header-search {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .header-search .search-drop-down {
        left: 0;
        right: 0;
        max-width: 100%;
    }

    .catalog-search-item {
        padding: 12px 14px;
    }

    .catalog-search-item__thumb {
        width: 44px;
        height: 44px;
    }

    .site-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.95);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 2000;
    }

    .site-nav .header-container {
        height: 100%;
        padding-top: 55px;
    }

    .mobile-nav-close {
        position: absolute;
        top: 18px;
        right: var(--site-gutter);
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.25);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff;
        font-size: 18px;
        cursor: pointer;
    }

    .nav-menu {
        flex-direction: column;
        padding: 0 0 20px;
        gap: 0;
        height: 100%;
        overflow-y: auto;
    }

    .site-nav.mobile-active {
        transform: translateX(0);
    }

    .nav-menu > li > a {
        padding: 16px var(--site-gutter);
        font-size: 18px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-menu > li:first-child > a {
        padding-left: var(--site-gutter);
    }

    .nav-menu > li > a::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-top {
        font-size: 11px;
    }

    .header-contact {
        gap: 10px;
    }

    .header-social {
        gap: 10px;
    }

    .site-logo {
        height: 40px;
    }

    .header-search input {
        padding: 10px 45px 10px 15px;
        font-size: 14px;
    }
}
