/* Google Fonts import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Nunito:wght@300;400;500;600;700&display=swap');

/* Pet Shop Color Variables */
:root {
    --amazonac-green: #2E8B57;
    --nature-green: #4CAF50;
    --warm-orange: #FF8C42;
    --calm-blue: #4A90E2;
    --pure-white: #FFFFFF;
    --dark-gray: #2C3E50;
    --light-gray: #F8F9FA;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Smooth animations for everything */
* {
    transition: none;
}

nav {
    background: transparent;
    padding: 10px 0;
    display: flex;
    justify-content: center;
    gap: 5px;
}
nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 0;
    padding: 0;
}
nav ul li a {
    text-decoration: none;
    color: rgb(0, 0, 0);
    padding: 10px 20px;
    margin: 0 2px;
    background-color: #800000;
    border-radius: 5px;
    transition: 0.3s;
    font-weight: 500;
}
nav ul li a:hover {
    background-color: #a00000;
}

/* Logo Header Styling */
.logo-header {
  text-align: center;
  padding: 20px 0 10px 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  animation: logoHeaderSlideDown 1s ease-out;
}

@keyframes logoHeaderSlideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo {
  display: inline-flex;
  align-items: center;
  animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.logo-img {
  height: 60px;
  width: auto;
  margin-right: 15px;
  filter: drop-shadow(3px 3px 6px rgba(0,0,0,0.15));
  transition: transform 0.3s ease;
}

.logo:hover .logo-img {
  transform: scale(1.1) rotate(5deg);
}

.logo-text {
  font-family: 'Poppins', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--amazonac-green), var(--warm-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
  letter-spacing: 1px;
}

/* Modern Pet Shop Navbar */
.navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible; /* allow dropdowns to appear outside the navbar */
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 25px;
  margin: 20px auto 40px auto;
  max-width: 1100px;
  width: 95%;
  box-shadow: 0 8px 32px var(--shadow);
  padding: 14px 16px;
  border: 2px solid rgba(46, 139, 87, 0.1);
  animation: navbarSlideIn 0.8s ease-out;
  position: relative;
  gap: 12px;
} 

@keyframes navbarSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modern navbar links */
.navbar a {
  color: var(--dark-gray);
  text-decoration: none;
  padding: 12px 18px;
  margin: 0 2px;
  background: transparent;
  border-radius: 18px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  transform: translateY(0);
  white-space: nowrap;
}

/* Hover animation */
.navbar a:hover {
  background: linear-gradient(135deg, var(--amazonac-green), var(--nature-green));
  color: var(--pure-white);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(46, 139, 87, 0.3);
}

/* Active link styling */
.navbar a.active {
  background: linear-gradient(135deg, var(--warm-orange), #FF6B35);
  color: var(--pure-white);
  box-shadow: 0 6px 20px rgba(255, 140, 66, 0.4);
  transform: translateY(-1px);
}

/* Korpa link special styling */
.navbar a[id="korpa-link"] {
  background: linear-gradient(135deg, var(--calm-blue), #357ABD);
  color: var(--pure-white);
  font-weight: 600;
}

.navbar a[id="korpa-link"]:hover {
  background: linear-gradient(135deg, #357ABD, var(--calm-blue));
  transform: translateY(-3px) scale(1.05);
}

/* Desktop navbar-links styling */
@media (min-width: 769px) {
  .navbar {
    flex-wrap: nowrap;
    overflow: visible;
  }
  
  .navbar-links {
    display: flex !important;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }
  
  .mobile-menu-toggle {
    display: none;
  }
}

/* Global Search Styles */
.search-container {
  position: relative;
  flex-shrink: 0;
}

.global-search-input {
  width: 200px;
  padding: 10px 14px;
  border: 2px solid rgba(46, 139, 87, 0.2);
  border-radius: 18px;
  font-size: 12px;
  font-family: 'Nunito', sans-serif;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  outline: none;
}

.global-search-input:focus {
  border-color: var(--amazonac-green);
  box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.1);
  background: white;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 8px;
  display: none;
  border: 1px solid rgba(46, 139, 87, 0.1);
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}

.search-result-item:hover {
  background: #f8f9fa;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-image {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 12px;
}

.search-result-info {
  flex: 1;
}

.search-result-info h4 {
  margin: 0 0 4px 0;
  font-size: 14px;
  color: var(--dark-gray);
  font-weight: 600;
}

.search-result-category {
  margin: 0 0 4px 0;
  font-size: 12px;
  color: var(--amazonac-green);
  font-weight: 500;
}

.search-result-price {
  margin: 0;
  font-size: 13px;
  color: var(--warm-orange);
  font-weight: 700;
}

.search-no-results {
  text-align: center;
  padding: 30px 20px;
  color: #666;
}

.no-results-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.search-no-results p {
  margin: 0;
  font-size: 14px;
}

/* Modern Typography */
body {
    font-family: 'Nunito', sans-serif;
    color: var(--dark-gray);
    line-height: 1.6;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

h1 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    text-align: center;
    color: var(--amazonac-green);
    margin: 30px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    animation: titleFadeIn 1s ease-out;
}

@keyframes titleFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--amazonac-green);
    margin-bottom: 20px;
}

h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: var(--dark-gray);
}

p {
    text-align: center;
    font-size: 1.1rem;
    color: var(--dark-gray);
}

.proizvodi {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

.proizvodi h2 {
    text-align: center;
    margin-bottom: 24px;
}

.proizvodi-lista {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    justify-items: center;
}

/* Modern Product Cards */
.proizvod {
    background: var(--pure-white);
    border: none;
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 300px;
    text-align: center;
    box-shadow: 0 10px 30px var(--shadow);
    transform: translateY(0);
    overflow: hidden;
    position: relative;
    animation: cardSlideUp 0.6s ease-out;
}

@keyframes cardSlideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.proizvod:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(46, 139, 87, 0.15);
}

.proizvod::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.proizvod:hover::before {
    left: 100%;
}

.proizvod img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    border-radius: 15px;
    margin-bottom: 16px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.proizvod:hover img {
    transform: scale(1.05);
}

/* Image Lightbox Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 85vw;
    max-height: 85vh;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: translate(-50%, -50%) scale(0.5); }
    to { transform: translate(-50%, -50%) scale(1); }
}

.image-modal img {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s ease;
}

.image-modal-close:hover {
    color: var(--warm-orange);
    transform: scale(1.1);
}

.image-modal-info {
    /* place caption below the modal image instead of overlaying it */
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    display: block;
    margin: 12px auto 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    padding: 12px 18px;
    border-radius: 12px;
    text-align: center;
    color: var(--dark-gray);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.proizvod h3 {
    margin: 16px 0 12px 0;
    font-size: 1.3rem;
    color: var(--dark-gray);
    font-weight: 600;
}

.proizvod p {
    color: var(--amazonac-green);
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.proizvod .product-code {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 16px;
    font-style: italic;
}

/* Modern Button Styling */
.proizvod button {
    background: linear-gradient(135deg, var(--warm-orange), #FF6B35);
    color: var(--pure-white);
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    transform: translateY(0);
}

.proizvod button:hover {
    background: linear-gradient(135deg, #FF6B35, var(--warm-orange));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 140, 66, 0.4);
}

.proizvod button:active {
    transform: translateY(0);
}

.kontakt-info {
    max-width: 400px;
    margin: 32px auto 16px auto;
    font-size: 17px;
    background: #f9f9f9;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.kontakt-forma {
    max-width: 400px;
    margin: 0 auto 32px auto;
    background: #f9f9f9;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.kontakt-forma h2 {
    text-align: center;
    margin-bottom: 16px;
}

.kontakt-forma form label {
    font-weight: bold;
}

.kontakt-forma input,
.kontakt-forma textarea {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    margin-bottom: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
}

.kontakt-forma button {
    background: #1e7e34;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 15px;
    width: 100%;
    transition: background 0.2s;
}

.kontakt-forma button:hover {
    background: #155d27;
}

.o-nama {
    max-width: 700px;
    margin: 40px auto;
    background: rgb(225,241,242);
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    text-align: center;
}

.o-nama h2 {
    margin-bottom: 16px;
}

.o-nama .mapa {
    margin-top: 24px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.mapa {
    margin: 32px auto;
    max-width: 800px;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

footer {
    background: #f2f2f2;
    text-align: center;
    padding: 16px 0;
    color: #555;
    font-size: 15px;
    border-top: 1px solid #e0e0e0;
    margin-top: 40px;
    width: 100%;
}

/* Flexbox layout za footer na dnu */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Glavni sadržaj da zauzme dostupan prostor */
main {
    flex: 1;
}

/* Ako nema main tag, ovo će raditi za sve elemente osim footer-a */
body > *:not(footer) {
    flex-shrink: 0;
}

body > section,
body > div:not(.modal),
body > nav,
body > h1 {
    flex-shrink: 0;
}

/* Modern Homepage Hero Section */
body.pocetna {
    background: linear-gradient(135deg, 
        rgba(46, 139, 87, 0.1) 0%, 
        rgba(76, 175, 80, 0.1) 50%, 
        rgba(255, 140, 66, 0.1) 100%),
        url('slike/poozadniska.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Hero Title with Modern Animation */
body.pocetna h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 3.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--calm-blue), var(--warm-orange), var(--amazonac-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin: 40px auto 30px auto;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    animation: heroTitleAnimation 3s ease-in-out infinite;
    max-width: 900px;
    line-height: 1.2;
}

@keyframes heroTitleAnimation {
    0%, 100% { 
        transform: translateY(0px) scale(1);
        filter: hue-rotate(0deg);
    }
    50% { 
        transform: translateY(-5px) scale(1.02);
        filter: hue-rotate(10deg);
    }
}

/* Welcome Message */
body.pocetna p3 {
    font-family: 'Nunito', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--dark-gray);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: block;
    margin: 0 auto 40px auto;
    text-align: center;
    padding: 20px 40px;
    border-radius: 25px;
    max-width: 600px;
    box-shadow: 0 8px 32px var(--shadow);
    border: 2px solid rgba(46, 139, 87, 0.2);
    animation: welcomeSlideIn 1.2s ease-out 0.5s both;
}

@keyframes welcomeSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* About Section */
body.pocetna p2 {
    font-family: 'Nunito', sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--dark-gray);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    display: block;
    margin: 0 auto;
    text-align: center;
    padding: 25px 35px;
    border-radius: 20px;
    line-height: 1.7;
    box-shadow: 0 6px 25px var(--shadow);
    border-left: 5px solid var(--amazonac-green);
    border-right: 5px solid var(--warm-orange);
    animation: aboutFadeIn 1.5s ease-out 1s both;
}

@keyframes aboutFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== MOBILE RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    /* Logo Header Mobile */
    .logo-header {
        padding: 15px 0 8px 0;
    }
    
    .logo-img {
        height: 45px;
        margin-right: 10px;
    }
    
    .logo-text {
        font-size: 1.6rem;
    }
    /*ovde sad*/
    /* Mobile Navbar */
    .navbar {
        flex-direction: column;
        margin: 10px 16px 30px 16px;
        padding: 12px;
        border-radius: 20px;
        max-width: none;
        align-items: flex-start;
        position: relative;
        z-index: 1200; /* keep navbar above hero */
    }
    
    .mobile-menu-toggle {
        display: block !important;
        background: none;
        border: none;
        font-size: 24px;
        padding: 10px;
        cursor: pointer;
        color: var(--amazonac-green);
        transition: transform 0.18s ease;
        z-index: 1600;
        position: absolute;
        right: 18px;
        top: 50%;
        transform: translateY(-50%) rotate(0deg);
    }

    .mobile-menu-toggle:hover {
        background: rgba(46, 139, 87, 0.1);
        transform: translateY(-50%) scale(1.1);
    }

    .mobile-menu-toggle.open {
        transform: translateY(-50%) rotate(90deg);
    }
    /*novo*/
    /* When navbar has .open (menu visible), keep toggle at top-right instead of vertically centering 
    /*.navbar.open .mobile-menu-toggle {
        top: 18px !important;
    }*/
    /* When both navbar is open and the toggle has .open, apply rotation but keep it at the top */
    /*.navbar.open .mobile-menu-toggle.open {
        transform: rotate(90deg) !important;
        translate: none;
    }*/
    
    /* Mobile Search */
    .search-container {
        margin: 10px 0;
        width: 100%;
        order: 2;
        padding-right: 0;
        box-sizing: border-box;
        position: relative;
        z-index: 1550; /* ensure search sits above hero text */
    }
    
    .global-search-input {
        width: 100%;
        box-sizing: border-box;
        position: relative;
        z-index: 1555;
    }
    
    .search-results {
        left: -12px;
        right: -12px;
        z-index: 1560;
        position: absolute;
    }
    
    .navbar-links {
        display: none !important;
        flex-direction: column;
        width: 100%;
        gap: 8px;
        order: 3;
    }
    
    .navbar-links.active {
        display: flex !important;
        animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .navbar a {
        padding: 12px 20px;
        margin: 0;
        text-align: center;
        font-size: 15px;
        border-radius: 15px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Mobile Typography */
    h1 {
        font-size: 2rem;
        margin: 20px 16px;
        line-height: 1.3;
    }
    
    body.pocetna h1 {
        font-size: 2.4rem;
        margin: 30px 16px 20px 16px;
    }
    
    /* Mobile Products */
    .proizvodi {
        margin: 20px 16px;
        padding: 0;
    }
    
    .proizvodi-lista {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }
    
    .proizvod {
        width: 100%;
        max-width: 320px;
        padding: 20px;
    }
    
    .proizvod img {
        height: 180px;
    }
    
    .proizvod h3 {
        font-size: 1.2rem;
    }
    
    .proizvod p {
        font-size: 1.3rem;
    }
    
    .proizvod button {
        padding: 14px 20px;
        font-size: 13px;
        width: 100%;
    }
    
    /* Mobile Homepage */
    body.pocetna p3 {
        font-size: 1.2rem;
        margin: 0 16px 30px 16px;
        padding: 16px 24px;
    }
    
    body.pocetna p2 {
        font-size: 1.1rem;
        margin: 0 16px;
        padding: 20px 24px;
        line-height: 1.6;
    }
    
    .o-nama {
        margin: 20px 16px;
        padding: 20px;
    }
    
    /* Mobile Contact */
    .kontakt-info {
        margin: 20px 16px;
        font-size: 16px;
    }
    
    .mapa {
        margin: 20px 16px;
        height: 300px;
    }
    
    /* Mobile Modals */
    .modal-content {
        margin: 20px auto;
        width: 95%;
        max-width: none;
        padding: 20px;
    }
    
    #porudzbina-forma input,
    #porudzbina-forma button {
        font-size: 16px;
        padding: 12px;
    }
    
    /* Mobile Image Modal */
    .image-modal-content {
        max-width: 95vw;
        max-height: 90vh;
    }
    
    .image-modal img {
        max-height: 80vh;
    }
    
    .image-modal-close {
        top: 10px;
        right: 15px;
        font-size: 35px;
    }
    
    .image-modal-info {
        bottom: 10px;
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .logo-text {
        font-size: 1.4rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    body.pocetna h1 {
        font-size: 2rem;
    }
    
    .proizvod {
        max-width: 280px;
        padding: 16px;
    }
    
    .navbar {
        margin: 10px 12px 20px 12px;
    }
    
    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
        padding: 16px;
    }
}
