/*
 * ========================================
 * ALU & PLAST INTERNACIONAL
 * Mobile-First Responsive Design
 * Optimizirano za iPhone, Samsung, tablete
 * ========================================
 */

/* ========================================
   BASE MOBILE STYLES (320px+)
   iPhone SE, Samsung Galaxy mini
   ======================================== */

/* Viewport fix za iOS Safari */
html {
  -webkit-text-size-adjust: 100%;
}

/* Smooth scrolling za mobilne */
@supports (scroll-behavior: smooth) {
  html {
    scroll-behavior: smooth;
  }
}

/* Safe area za iPhone X+ (notch) */
body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Touch optimization */
a, button, .btn, .nav-link, .card, .product-card, .service-card {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Prevent zoom on input focus (iOS) */
input, select, textarea {
  font-size: 16px !important;
}

/* ========================================
   EXTRA SMALL DEVICES (< 375px)
   iPhone SE, Galaxy S mini
   ======================================== */
@media (max-width: 374px) {
  :root {
    --section-padding: 40px;
  }
  
  .container {
    padding: 0 12px;
  }
  
  .hero-badge {
    padding: 10px 16px;
    font-size: 0.75rem;
    margin-top: 30px;
  }
  
  .hero-title,
  .hero h1 {
    font-size: 2rem !important;
    line-height: 1.2;
    letter-spacing: -0.5px;
  }
  
  .hero-title .text-gradient {
    font-size: 2rem !important;
  }
  
  .hero-text {
    font-size: 0.875rem;
    line-height: 1.6;
  }
  
  .hero-buttons {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
  
  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
  }
  
  .btn-lg {
    padding: 12px 20px;
    font-size: 0.875rem;
  }
  
  .section-overline {
    font-size: 0.7rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .trust-card {
    padding: 20px 16px;
  }
  
  .trust-icon {
    width: 50px;
    height: 50px;
  }
  
  .trust-icon i {
    font-size: 20px;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .stat-label {
    font-size: 0.75rem;
  }
  
  .product-card h3 {
    font-size: 1rem;
  }
  
  .promo-badge {
    font-size: 0.7rem;
    padding: 6px 12px;
  }
  
  .promo-title {
    font-size: 1.5rem;
  }
  
  .partners-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .partner-logo {
    font-size: 0.8rem;
    padding: 10px 12px;
  }
  
  .cta-title {
    font-size: 1.5rem;
  }
  
  .footer-logo {
    font-size: 1.5rem;
  }
}

/* ========================================
   SMALL DEVICES (375px - 479px)
   iPhone 12/13/14 mini, SE, Samsung S21
   ======================================== */
@media (min-width: 375px) and (max-width: 479px) {
  :root {
    --section-padding: 50px;
  }
  
  .container {
    padding: 0 16px;
  }
  
  .hero-badge {
    padding: 12px 20px;
    font-size: 0.8rem;
    margin-top: 40px;
  }
  
  .hero-title,
  .hero h1 {
    font-size: 2.5rem !important;
    line-height: 1.15;
  }
  
  .hero-title .text-gradient {
    font-size: 2.5rem !important;
  }
  
  .hero-text {
    font-size: 0.9375rem;
    margin-bottom: 32px;
  }
  
  .hero-buttons {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
  
  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
  }
  
  .section-title {
    font-size: 1.75rem;
  }
  
  .trust-grid {
    gap: 16px;
  }
  
  .trust-card {
    padding: 24px 20px;
  }
  
  .stat-number {
    font-size: 2.25rem;
  }
  
  .promo-title {
    font-size: 1.75rem;
  }
  
  .promo-text {
    font-size: 0.9375rem;
  }
}

/* ========================================
   MEDIUM PHONES (480px - 575px)
   iPhone 12/13/14 Pro Max, Samsung S21 Ultra
   ======================================== */
@media (min-width: 480px) and (max-width: 575px) {
  :root {
    --section-padding: 60px;
  }
  
  .container {
    padding: 0 20px;
  }
  
  .hero-badge {
    margin-top: 50px;
  }
  
  .hero-title,
  .hero h1 {
    font-size: 2.75rem !important;
  }
  
  .hero-buttons {
    flex-direction: row;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .hero-buttons .btn {
    width: auto;
  }
  
  .section-title {
    font-size: 1.875rem;
  }
  
  .trust-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .partners-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

/* ========================================
   LARGE PHONES / PHABLETS (576px - 767px)
   Tablets in portrait, large phones landscape
   ======================================== */
@media (min-width: 576px) and (max-width: 767px) {
  :root {
    --section-padding: 70px;
  }
  
  .container {
    padding: 0 24px;
  }
  
  .hero-badge {
    margin-top: 50px;
    font-size: 0.9rem;
  }
  
  .hero-title,
  .hero h1 {
    font-size: 3rem !important;
  }
  
  .hero-content {
    max-width: 480px;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .trust-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  
  .trust-card {
    padding: 20px 16px;
  }
  
  .trust-icon {
    width: 50px;
    height: 50px;
  }
  
  .trust-card h3 {
    font-size: 0.95rem;
  }
  
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .promo-wrapper {
    text-align: center;
  }
  
  .promo-image {
    margin: 0 auto;
  }
  
  .partners-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  
  .footer-main {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
}

/* ========================================
   TABLETS (768px - 1023px)
   iPad, iPad Mini, Samsung Tab
   ======================================== */
@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --section-padding: 80px;
  }
  
  .container {
    padding: 0 32px;
  }
  
  .hero-badge {
    margin-top: 60px;
    font-size: 1rem;
  }
  
  .hero-title,
  .hero h1 {
    font-size: 3.5rem !important;
  }
  
  .hero-content {
    max-width: 550px;
  }
  
  .hero-buttons {
    flex-direction: row;
    gap: 20px;
  }
  
  .section-title {
    font-size: 2.25rem;
  }
  
  .trust-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
  
  .trust-card {
    padding: 28px 24px;
  }
  
  .trust-icon {
    width: 60px;
    height: 60px;
  }
  
  .trust-stats {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
  }
  
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
  
  .services-wrapper {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .services-visual {
    order: -1;
  }
  
  .promo-wrapper {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
  }
  
  .partners-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
  
  .footer-main {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
  
  .footer-col {
    text-align: left;
  }
}

/* ========================================
   SMALL LAPTOPS (1024px - 1279px)
   iPad Pro, small laptops
   ======================================== */
@media (min-width: 1024px) and (max-width: 1279px) {
  :root {
    --section-padding: 100px;
  }
  
  .hero-badge {
    margin-top: 60px;
  }
  
  .hero-title,
  .hero h1 {
    font-size: 4.5rem !important;
  }
  
  .hero-content {
    max-width: 650px;
  }
  
  .trust-grid {
    gap: 30px;
  }
  
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
  }
  
  .services-wrapper {
    grid-template-columns: 1fr 1fr;
    gap: 60px;
  }
  
  .services-visual {
    order: 0;
  }
  
  .partners-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* ========================================
   DESKTOPS (1280px+)
   Full desktop experience
   ======================================== */
@media (min-width: 1280px) {
  :root {
    --section-padding: 120px;
  }
  
  .hero-title,
  .hero h1 {
    font-size: 5.5rem !important;
  }
  
  .hero-content {
    max-width: 700px;
  }
}

/* ========================================
   LARGE DESKTOPS (1536px+)
   ======================================== */
@media (min-width: 1536px) {
  .hero-title,
  .hero h1 {
    font-size: 6rem !important;
  }
  
  .hero-content {
    max-width: 750px;
  }
}

/* ========================================
   MOBILE NAVIGATION (< 1024px)
   ======================================== */
@media (max-width: 1023px) {
  .nav-menu,
  .nav-actions {
    display: none !important;
  }
  
  .nav-toggle {
    display: flex !important;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    cursor: pointer;
    z-index: 1001;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }
  
  .nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--gray-900) 0%, #1a3a4a 100%);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    padding: 20px;
    overflow-y: auto;
  }
  
  .nav-menu.active {
    display: flex !important;
    transform: translateX(0);
  }
  
  .nav-menu li {
    width: 100%;
    text-align: center;
  }
  
  .nav-menu .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--white);
    font-size: 1.125rem;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    width: 100%;
    background: rgba(255,255,255,0.05);
    margin-bottom: 8px;
  }
  
  .nav-menu .nav-link i {
    font-size: 1.25rem;
    color: var(--accent);
  }
  
  .nav-menu .nav-link:hover,
  .nav-menu .nav-link.active {
    background: rgba(255,255,255,0.15);
    transform: scale(1.02);
  }
  
  .nav-menu .nav-link.active::after {
    display: none;
  }
  
  /* Dropdown u mobilnom */
  .nav-dropdown .dropdown-menu {
    position: static;
    background: rgba(0,0,0,0.2);
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    padding: 8px 0;
    margin-top: 8px;
    border-radius: var(--radius-md);
    display: none;
  }
  
  .nav-dropdown:hover .dropdown-menu,
  .nav-dropdown.active .dropdown-menu {
    display: block;
  }
  
  .dropdown-menu a {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    justify-content: center;
  }
  
  .dropdown-menu a:hover {
    background: rgba(255,255,255,0.1);
    color: var(--white);
  }
  
  /* Mobile nav toggle button */
  .nav-toggle {
    z-index: 1001 !important;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.15);
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  
  .nav-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--white);
    border-radius: 3px;
    transition: all 0.3s ease;
  }
  
  .header.scrolled .nav-toggle {
    background: var(--gray-100);
  }
  
  .header.scrolled .nav-toggle span {
    background: var(--gray-700);
  }
  
  /* Active state - hamburger to X */
  .nav-toggle.active {
    background: rgba(255,255,255,0.2);
    z-index: 1002 !important;
  }
  
  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }
  
  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  
  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
}

/* ========================================
   HERO SLIDER MOBILE OPTIMIZATIONS
   ======================================== */
@media (max-width: 767px) {
  .hero {
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
  }
  
  .hero-slide {
    background-position: center center;
    background-size: cover;
  }
  
  .hero-overlay {
    background: linear-gradient(
      135deg,
      rgba(0,0,0,0.75) 0%,
      rgba(0,0,0,0.5) 50%,
      rgba(0,0,0,0.4) 100%
    );
  }
  
  .hero-content {
    padding: 0 8px;
    text-align: center;
  }
  
  .hero-slider-nav {
    bottom: 20px;
    gap: 8px;
  }
  
  .hero-nav-btn {
    width: 40px;
    height: 40px;
  }
  
  .hero-pagination {
    gap: 8px;
  }
  
  .hero-pagination .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
  }
  
  .hero-scroll {
    display: none;
  }
}

/* ========================================
   TRUST SECTION MOBILE
   ======================================== */
@media (max-width: 575px) {
  .trust-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .trust-card {
    flex-direction: row;
    text-align: left;
    gap: 16px;
    padding: 20px;
  }
  
  .trust-icon {
    flex-shrink: 0;
  }
  
  .trust-card h3 {
    margin-bottom: 4px;
  }
  
  .trust-card p {
    font-size: 0.875rem;
    line-height: 1.5;
  }
  
  .trust-stats {
    flex-direction: column;
    gap: 24px;
    margin-top: 40px;
  }
  
  .stat-divider {
    width: 60px;
    height: 1px;
  }
}

/* ========================================
   PRODUCTS SECTION MOBILE
   ======================================== */
@media (max-width: 575px) {
  .products-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .product-card {
    aspect-ratio: 4/3;
  }
  
  .product-card-content {
    padding: 16px;
  }
  
  .product-card h3 {
    font-size: 1.125rem;
  }
  
  .product-card p {
    font-size: 0.875rem;
    -webkit-line-clamp: 2;
  }
}

/* ========================================
   SERVICES SECTION MOBILE
   ======================================== */
@media (max-width: 767px) {
  .services-wrapper {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .services-visual {
    order: -1;
  }
  
  .services-image-main {
    height: 250px;
  }
  
  .services-floating-card {
    display: none;
  }
  
  .service-item {
    padding: 16px;
  }
  
  .service-item h4 {
    font-size: 1rem;
  }
}

/* ========================================
   PROMO SECTION MOBILE
   ======================================== */
@media (max-width: 767px) {
  .promo-section {
    padding: 50px 0;
  }
  
  .promo-wrapper {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }
  
  .promo-badge {
    margin: 0 auto 16px;
  }
  
  .promo-title {
    font-size: 2rem;
  }
  
  .promo-features {
    text-align: left;
    max-width: 300px;
    margin: 0 auto;
  }
  
  .promo-features li {
    justify-content: flex-start;
  }
  
  .promo-buttons {
    flex-direction: column;
    gap: 12px;
  }
  
  .promo-buttons .btn {
    width: 100%;
    justify-content: center;
  }
  
  .promo-image {
    order: -1;
    margin-bottom: 20px;
  }
  
  .promo-image img {
    width: 200px;
    height: 200px;
  }
}

/* ========================================
   PARTNERS SECTION MOBILE
   ======================================== */
@media (max-width: 575px) {
  .partners-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .partner-logo {
    font-size: 0.85rem;
    padding: 12px 10px;
  }
}

/* ========================================
   CTA SECTION MOBILE
   ======================================== */
@media (max-width: 767px) {
  .cta {
    padding: 50px 0;
  }
  
  .cta-content {
    padding: 40px 24px;
    border-radius: var(--radius-xl);
  }
  
  .cta-badge {
    font-size: 0.8rem;
  }
  
  .cta-title {
    font-size: 1.75rem;
    line-height: 1.3;
  }
  
  .cta-text {
    font-size: 0.9375rem;
  }
  
  .cta-buttons {
    flex-direction: column;
    gap: 12px;
  }
  
  .cta-buttons .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================
   FOOTER MOBILE
   ======================================== */
@media (max-width: 767px) {
  .footer {
    padding: 50px 0 24px;
  }
  
  .footer-main {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  
  .footer-brand {
    margin-bottom: 20px;
  }
  
  .footer-social {
    justify-content: center;
  }
  
  .footer-col h4 {
    margin-bottom: 16px;
  }
  
  .footer-col h4::after {
    left: 50%;
    transform: translateX(-50%);
  }
  
  .footer-contact ul li {
    justify-content: center;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .footer-legal {
    justify-content: center;
  }
}

/* ========================================
   MODAL MOBILE OPTIMIZATIONS
   ======================================== */
@media (max-width: 767px) {
  .trust-modal-content,
  .service-modal-content {
    padding: 24px 20px;
    margin: 16px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    border-radius: var(--radius-xl);
  }
  
  .trust-modal-content h2,
  .service-modal-content h2 {
    font-size: 1.5rem;
  }
  
  .trust-modal-icon,
  .service-modal-icon {
    width: 60px;
    height: 60px;
  }
  
  .trust-modal-icon i,
  .service-modal-icon i {
    font-size: 24px;
  }
  
  .trust-modal-close,
  .service-modal-close {
    top: 12px;
    right: 16px;
    font-size: 28px;
  }
}

/* ========================================
   LANDSCAPE PHONE OPTIMIZATIONS
   ======================================== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    padding: 60px 0;
  }
  
  .hero-badge {
    margin-top: 20px;
    margin-bottom: 16px;
    padding: 8px 16px;
    font-size: 0.75rem;
  }
  
  .hero-title,
  .hero h1 {
    font-size: 2rem !important;
    margin-bottom: 12px;
  }
  
  .hero-text {
    font-size: 0.875rem;
    margin-bottom: 20px;
  }
  
  .hero-buttons {
    gap: 12px;
  }
  
  .btn-lg {
    padding: 10px 20px;
    font-size: 0.875rem;
  }
  
  .hero-slider-nav {
    bottom: 10px;
  }
  
  .nav-menu {
    padding-top: 60px;
    gap: 8px;
  }
  
  .nav-menu .nav-link {
    padding: 10px 20px;
    font-size: 1rem;
  }
}

/* ========================================
   TABLET LANDSCAPE
   ======================================== */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
  }
  
  .hero-title,
  .hero h1 {
    font-size: 3rem !important;
  }
  
  .hero-badge {
    margin-top: 40px;
  }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATIONS
   ======================================== */
@media (hover: none) and (pointer: coarse) {
  /* Veci touch targeti */
  .btn {
    min-height: 48px;
  }
  
  .nav-link {
    min-height: 48px;
  }
  
  .product-card,
  .service-card,
  .trust-card {
    cursor: pointer;
  }
  
  /* Ukloni hover efekte koji ne rade na touchu */
  .btn:hover {
    transform: none;
  }
  
  .card:hover,
  .service-card:hover,
  .product-card:hover {
    transform: none;
  }
  
  /* Active state umjesto hovera */
  .btn:active {
    transform: scale(0.98);
    opacity: 0.9;
  }
  
  .card:active,
  .service-card:active,
  .product-card:active,
  .trust-card:active {
    transform: scale(0.98);
  }
  
  .partner-logo:active {
    transform: scale(0.95);
  }
}

/* ========================================
   REDUCED MOTION
   Respect user preferences
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .hero-scroll {
    animation: none;
  }
  
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */
@media (prefers-contrast: high) {
  :root {
    --primary: #0056b3;
    --accent: #ff8c00;
  }
  
  .btn {
    border: 2px solid currentColor;
  }
  
  .card,
  .trust-card,
  .product-card {
    border: 2px solid var(--gray-900);
  }
  
  .hero-title,
  .hero h1 {
    text-shadow: none;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  .header,
  .footer,
  .back-to-top,
  .hero-scroll,
  .hero-slider-nav,
  .nav-toggle,
  .preloader {
    display: none !important;
  }
  
  .hero {
    min-height: auto;
    padding: 40px 0;
    background: none !important;
  }
  
  .hero-overlay {
    display: none;
  }
  
  .hero-title,
  .hero h1,
  .hero-text {
    color: #000 !important;
  }
  
  .section {
    padding: 30px 0;
    page-break-inside: avoid;
  }
  
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }
}
