/* DBT WEB SHOP — Main stylesheet (minimalan placeholder, prosirivati BEM-om) */

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

:root {
    --primary: #d32f2f;
    --primary-dark: #9a0007;
    --dark: #1a1a1a;
    --gray-100: #f5f5f5;
    --gray-200: #e0e0e0;
    --gray-500: #757575;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--dark);
    background: var(--white);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header — bela pozadina (JPG logo je crn tekst na belom) */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 0;
}
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--dark);
    font-weight: 700;
}
.logo img {
    height: 44px;
    width: auto;
    display: block;
}
.logo__suffix {
    margin-left: 12px;
    font-size: 1rem;
    color: var(--primary);
    letter-spacing: 1px;
}
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}
.main-nav a {
    color: var(--dark);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 4px;
    transition: background 0.2s;
}
.main-nav a:hover { background: var(--gray-100); color: var(--primary); }
.btn-link--dark {
    background: none;
    border: none;
    color: var(--dark);
    cursor: pointer;
    padding: 8px 14px;
    font-size: 1rem;
    font-family: inherit;
}
.btn-link--dark:hover { color: var(--primary); }

/* HAMBURGER */
.header__mobile-tools {
    display: none;
    align-items: center;
    gap: 8px;
}
.hamburger {
    width: 44px;
    height: 44px;
    background: none;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 10px;
}
.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--dark);
    transition: transform 0.2s, opacity 0.2s;
}
.hamburger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* NAV DRAWER (mobile) */
.nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.2s;
}
.nav-backdrop.is-visible {
    display: block;
    opacity: 1;
}

.cart-link--desktop { display: inline-flex; }
.cart-link--icon-only { display: none; }

/* MOBILE STILOVI */
@media (max-width: 768px) {
    .header__mobile-tools { display: flex; }

    .main-nav {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 280px;
        max-width: 80vw;
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        padding: 80px 0 24px;
        gap: 0;
        z-index: 99;
        box-shadow: -4px 0 16px rgba(0,0,0,0.15);
        transform: translateX(100%);
        transition: transform 0.25s ease;
    }
    .main-nav.is-open {
        display: flex;
        transform: translateX(0);
    }
    .main-nav a,
    .main-nav form {
        padding: 16px 24px;
        border-bottom: 1px solid var(--gray-100);
        text-align: left;
    }
    .main-nav a:hover { background: var(--gray-100); }
    .main-nav .btn-link--dark {
        width: 100%;
        text-align: left;
        padding: 16px 24px;
    }
    .cart-link--desktop { display: none; }
    .cart-link--icon-only {
        display: inline-flex;
        padding: 10px;
        position: relative;
    }
    .cart-link--icon-only .cart-link__icon { font-size: 1.4rem; }
    .cart-link--icon-only .cart-link__badge {
        position: absolute;
        top: 2px;
        right: 2px;
        font-size: 0.65rem;
        padding: 1px 5px;
        min-width: 16px;
    }

    .site-header .container { gap: 8px; }
    .logo img { height: 36px; }
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 16px; }
.hero__subtitle { font-size: 1.2rem; opacity: 0.9; margin-bottom: 32px; }
.hero__actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: 2px solid transparent;
    cursor: pointer;
}
.btn--primary { background: var(--primary); color: var(--white); }
.btn--primary:hover { background: var(--primary-dark); }
.btn--ghost { background: transparent; color: var(--white); border-color: var(--white); }
.btn--ghost:hover { background: var(--white); color: var(--dark); }

/* Hero statistike */
.hero__stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 40px;
    flex-wrap: wrap;
}
.hero__stat {
    text-align: center;
    color: var(--white);
}
.hero__stat strong {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
}
.hero__stat span {
    font-size: 0.875rem;
    opacity: 0.85;
}
@media (max-width: 768px) {
    .hero__stats { gap: 24px; margin-top: 24px; }
    .hero__stat strong { font-size: 1.5rem; }
}

/* Home product sections */
.home-section {
    padding: 48px 0;
    background: var(--white);
}
.home-section--promo {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
}

/* Akcijski banner na početnoj — centriran letak u bijelom prostoru ispod hero-a */
.home-promo-banner {
    padding: 40px 0 12px;
    background: var(--white);
    text-align: center;
}
.home-promo-banner__img {
    display: inline-block;
    width: 100%;
    max-width: 560px;          /* tablet / default */
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    transition: transform .15s ease, box-shadow .15s ease;
}
.home-promo-banner a:hover .home-promo-banner__img {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}
/* Telefon — banner ide gotovo do ivica ekrana */
@media (max-width: 600px) {
    .home-promo-banner { padding: 20px 0 6px; }
    .home-promo-banner .container { padding-left: 6px; padding-right: 6px; }
    .home-promo-banner__img { max-width: 100%; border-radius: 8px; }
}
/* Laptop */
@media (min-width: 992px) {
    .home-promo-banner { padding: 52px 0 16px; }
    .home-promo-banner__img { max-width: 760px; }
}
/* Veliki desktop */
@media (min-width: 1400px) {
    .home-promo-banner__img { max-width: 920px; }
}
.home-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.home-section__header h2 {
    font-size: 1.75rem;
    margin: 0;
}
.home-section__more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.home-section__more:hover { text-decoration: underline; }

/* CTA banner za neulogovane */
.cta-banner {
    background: var(--dark);
    color: var(--white);
    padding: 48px 0;
    text-align: center;
}
.cta-banner h2 { font-size: 1.5rem; margin-bottom: 8px; }
.cta-banner p { opacity: 0.85; margin-bottom: 16px; }

/* Features */
.features { padding: 64px 0; }
.features h2 { text-align: center; font-size: 2rem; margin-bottom: 40px; }
.features__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}
.feature {
    background: var(--gray-100);
    padding: 24px;
    border-radius: 8px;
}
.feature h3 { color: var(--primary); margin-bottom: 8px; font-size: 1.1rem; }

/* CTA */
.cta { padding: 64px 0; text-align: center; background: var(--gray-100); }
.cta h2 { font-size: 1.5rem; margin-bottom: 16px; }

/* Placeholder */
.placeholder { padding: 80px 16px; text-align: center; }
.placeholder h1 { margin-bottom: 16px; color: var(--gray-500); }

/* Flash poruke */
.flash-container { padding: 16px; }
.flash {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 8px;
}
.flash--success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #2e7d32; }
.flash--error   { background: #ffebee; color: #c62828; border-left: 4px solid #c62828; }
.flash--info    { background: #e3f2fd; color: #1565c0; border-left: 4px solid #1565c0; }
.flash--warning { background: #fff3e0; color: #ef6c00; border-left: 4px solid #ef6c00; }

/* Footer */
.site-footer {
    background: var(--dark);
    color: var(--white);
    padding: 48px 0 16px;
    margin-top: 64px;
}
.site-footer__top {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1.4fr;
    gap: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.site-footer__brand img { margin-bottom: 12px; }
.site-footer__brand p { color: rgba(255,255,255,0.7); max-width: 320px; }
.site-footer h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    color: var(--primary);
}
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { padding: 4px 0; }
.site-footer a { color: rgba(255,255,255,0.85); text-decoration: none; }
.site-footer a:hover { color: var(--primary); }
.site-footer__contact p { color: rgba(255,255,255,0.85); line-height: 1.7; }
.footer-contact__label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    margin: 14px 0 4px;
}
.footer-phones { margin: 0; }
.footer-phones li { padding: 2px 0; color: rgba(255,255,255,0.85); }
.footer-phones a { white-space: nowrap; }
.footer-phones--sales li { padding: 5px 0; }
.footer-phones__area {
    display: block;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    padding-left: 22px;
    line-height: 1.35;
}
.site-footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    flex-wrap: wrap;
    gap: 16px;
}
.site-footer .version { color: var(--gray-500); font-size: 0.875rem; }
@media (max-width: 768px) {
    .site-footer__top { grid-template-columns: 1fr; gap: 24px; }
}

/* Moj nalog (account) — public layout */
.account { padding: 32px 16px; }
.account__back { margin-bottom: 16px; }
.account__back a { text-decoration: none; color: var(--gray-500); }
.account__back a:hover { color: var(--primary); }
.account__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.account__welcome {
    background: var(--gray-100);
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
}
.account__welcome p { margin-bottom: 4px; }
.account__menu {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.account__menu-item {
    background: var(--white);
    border: 1px solid var(--gray-200);
    padding: 24px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--dark);
    transition: all 0.2s;
    display: block;
}
.account__menu-item:not(.account__menu-item--disabled):hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}
.account__menu-item h3 { color: var(--primary); margin-bottom: 8px; }
.account__menu-item p { color: var(--gray-500); font-size: 0.9rem; margin: 0; }
.account__menu-item--disabled { opacity: 0.5; cursor: not-allowed; }
.account__profile-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}
@media (max-width: 900px) {
    .account__profile-layout { grid-template-columns: 1fr; }
}
.btn--ghost-dark {
    background: transparent;
    color: var(--dark);
    border: 2px solid var(--dark);
}
.btn--ghost-dark:hover { background: var(--dark); color: var(--white); }
.info-table {
    width: 100%;
    border-collapse: collapse;
}
.info-table td {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}
.info-table td:first-child {
    color: var(--gray-500);
    width: 200px;
    font-size: 0.9rem;
}
.info-table tr:last-child td { border-bottom: none; }
.form-actions-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* Static page (CMS) */
.static-page { max-width: 820px; padding: 40px 16px; }
.static-page__header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--gray-200); }
.static-page__header h1 { font-size: 2rem; }
.static-page__content { line-height: 1.7; font-size: 1.05rem; }
.static-page__content h2 { font-size: 1.4rem; margin: 24px 0 12px; color: var(--dark); }
.static-page__content h3 { font-size: 1.15rem; margin: 20px 0 8px; }
.static-page__content p { margin-bottom: 12px; }
.static-page__content ul, .static-page__content ol { margin: 0 0 12px 24px; }
.static-page__content li { margin-bottom: 4px; }
.static-page__content a { color: var(--primary); }
.static-page__footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--gray-200); }

/* Mobile */
@media (max-width: 768px) {
    .hero { padding: 48px 0; }
    .hero h1 { font-size: 1.75rem; }
    .hero__subtitle { font-size: 1rem; }
    .hero__actions { flex-direction: column; }
    .hero__actions .btn { width: 100%; }
    .features { padding: 40px 0; }
    .features h2 { font-size: 1.5rem; }
    .features__grid { grid-template-columns: 1fr; }
    .cta { padding: 40px 0; }
    .container { padding: 0 12px; }
}

/* Tabele responsivne — scrollable na uskim ekranima */
.orders-table,
.order-items-table,
.products-table,
.summary-table {
    width: 100%;
}
.orders-table thead,
.order-items-table thead {
    white-space: nowrap;
}
@media (max-width: 768px) {
    .orders-table-wrap,
    .order-items-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .orders-table,
    .order-items-table,
    .products-table {
        font-size: 0.85rem;
    }
    .orders-table th,
    .orders-table td,
    .order-items-table th,
    .order-items-table td {
        padding: 8px 6px;
        white-space: nowrap;
    }
}

/* Touch targets na mobile-u */
@media (max-width: 768px) {
    .btn { min-height: 44px; padding: 12px 18px; }
    .btn--sm { min-height: 36px; padding: 8px 14px; }
    input, select, textarea { font-size: 16px; }  /* sprečava iOS zoom na focus */
}

/* =====================================================
   MOBILE POLISH v2 — kompletan audit (sprečava asimetrije)
   ===================================================== */

/* Konzistentan container padding */
@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .site-header { padding: 12px 0; }
    .logo img { height: 36px; }

    /* Naslovi smanjeni za bolji ritam */
    h1 { font-size: 1.5rem; line-height: 1.3; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1rem; }

    /* Account — kartice 2 u redu */
    .account { padding: 20px 16px; }
    .account__header {
        flex-direction: column;
        align-items: flex-start;
    }
    .account__welcome {
        padding: 16px;
        margin-bottom: 16px;
        font-size: 0.95rem;
    }
    .account__menu {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .account__menu-item { padding: 16px 14px; }
    .account__menu-item h3 { font-size: 0.95rem; margin-bottom: 4px; }
    .account__menu-item p { font-size: 0.8rem; line-height: 1.4; }

    /* Profile info table — uži labels */
    .info-table td:first-child { width: 120px; font-size: 0.85rem; }

    /* Static stranice */
    .static-page { padding: 24px 16px; }
    .static-page__header h1 { font-size: 1.5rem; }
    .static-page__content { font-size: 1rem; }
    .static-page__content h2 { font-size: 1.25rem; margin: 20px 0 10px; }

    /* Forme action row stack-uje vertikalno */
    .form-actions-row { flex-direction: column; align-items: stretch; }
    .form-actions-row .btn { width: 100%; text-align: center; }
    .form-actions-row a { text-align: center; }

    /* Footer — manji padding */
    .site-footer { padding: 32px 0 16px; margin-top: 40px; }
    .site-footer__top { padding-bottom: 24px; }
    .site-footer__bottom { flex-direction: column; align-items: flex-start; gap: 8px; }

    /* Home section header (sa "Pregled kataloga →" linkom) */
    .home-section__header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* Veoma uski telefoni (max 480px) — fine tuning */
@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .site-header { padding: 10px 0; }
    .logo img { height: 30px; }

    /* Account — 1 kartica po redu na vrlo malim */
    .account__menu { grid-template-columns: 1fr; }

    /* Hero kompaktniji */
    .hero { padding: 32px 0; }
    .hero h1 { font-size: 1.4rem; }
    .hero__subtitle { font-size: 0.95rem; margin-bottom: 20px; }
    .hero__stats { gap: 16px; margin-top: 20px; }
    .hero__stat strong { font-size: 1.4rem; }
    .hero__stat span { font-size: 0.75rem; }

    /* Home sections */
    .home-section { padding: 28px 0; }
    .home-section__header h2 { font-size: 1.2rem; }

    /* Features */
    .features { padding: 28px 0; }
    .features h2 { font-size: 1.3rem; margin-bottom: 20px; }
    .feature { padding: 18px; }
    .feature h3 { font-size: 1rem; }

    /* CTA banner */
    .cta-banner { padding: 32px 0; }
    .cta-banner h2 { font-size: 1.25rem; }
}
