/* ===== RESPONSIVE STYLES - MOBILE FIRST ===== */

/* Base styles for all devices */
* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

/* Hide scrollbar but keep functionality */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Better image loading */
img {
  image-rendering: -webkit-optimize-contrast;
  max-width: 100%;
  height: auto;
}

/* ===== MOBILE MENU ===== */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-menu {
  animation: slideDown 0.3s ease-out;
}

/* ===== HERO SECTION ===== */
.hero-gradient {
  background: linear-gradient(rgba(13, 27, 62, 0.85), rgba(13, 27, 62, 0.85)),
    url('https://images.unsplash.com/photo-1597075687490-8f673c6c17f6?auto=format&fit=crop&q=80&w=2000')
      no-repeat center center;
  background-size: cover;
  background-attachment: fixed;
}

@media (max-width: 768px) {
  .hero-gradient {
    background-attachment: scroll;
  }
}

/* ===== PRODUCT CARDS ===== */
.product-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

@media (max-width: 768px) {
  .product-card:active {
    transform: scale(0.98);
  }
}

/* ===== FLOATING BUTTONS ===== */
.floating-buttons {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 40;
}

.floating-buttons a,
.floating-buttons button {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.floating-buttons a:hover,
.floating-buttons button:hover {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .floating-buttons {
    right: 1rem;
    gap: 0.75rem;
  }

  .floating-buttons a,
  .floating-buttons button {
    width: 2.75rem;
    height: 2.75rem;
  }
}

@media (max-width: 480px) {
  .floating-buttons {
    right: 0.75rem;
    gap: 0.5rem;
  }

  .floating-buttons a,
  .floating-buttons button {
    width: 2.5rem;
    height: 2.5rem;
  }

  .floating-buttons svg,
  .floating-buttons .material-symbols-outlined {
    font-size: 1.25rem;
  }
}

/* ===== CONTACT BUTTONS ===== */
.contact-button {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-button:active {
  transform: scale(0.95);
}

@media (max-width: 640px) {
  .contact-button {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
  }
}

/* ===== LOADING SKELETON ===== */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton {
  animation: shimmer 2s infinite;
  background: linear-gradient(
    to right,
    #f0f0f0 4%,
    #e0e0e0 25%,
    #f0f0f0 36%
  );
  background-size: 1000px 100%;
}

/* ===== FADE IN ANIMATION ===== */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== CATEGORY OVERLAY ===== */
.category-card {
  position: relative;
  overflow: hidden;
}

.category-overlay {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-card:hover .category-overlay {
  opacity: 1;
}

@media (max-width: 768px) {
  .category-overlay {
    opacity: 0.9;
  }
}

/* ===== HEADER RESPONSIVE ===== */
@media (max-width: 1024px) {
  header nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  header nav ul {
    padding: 0 1rem;
  }
}

/* ===== FOOTER RESPONSIVE ===== */
@media (max-width: 768px) {
  footer {
    padding: 2rem 0;
  }

  footer .grid {
    gap: 2rem;
  }
}

/* ===== FORM INPUTS ===== */
input,
textarea,
select {
  font-size: 16px !important; /* Prevent zoom on iOS */
}

@media (max-width: 768px) {
  input,
  textarea,
  select {
    padding: 0.75rem;
  }
}

/* ===== SAFE AREA FOR NOTCH DEVICES ===== */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }

  header {
    padding-top: max(0px, env(safe-area-inset-top));
  }
}

/* ===== TOUCH OPTIMIZATION ===== */
button,
a {
  touch-action: manipulation;
}

/* Larger touch targets on mobile */
@media (max-width: 768px) {
  button,
  a {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ===== GRID RESPONSIVE ===== */
.responsive-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (max-width: 640px) {
  .responsive-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
}

/* ===== TEXT RESPONSIVE ===== */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  h3 {
    font-size: 1.25rem;
    line-height: 1.4;
  }

  p {
    font-size: 0.875rem;
    line-height: 1.6;
  }
}

/* ===== MODAL RESPONSIVE ===== */
@media (max-width: 768px) {
  .modal {
    margin: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.will-change-transform {
  will-change: transform;
}

.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}
