/* ========================================
   BASE STYLES FOR KORICHUKO
======================================== */

/* ========================================
   GLOBAL / LAYOUT
======================================== */

/* Push content down so it's not hidden under the fixed header */
body {
  padding-top: 160px; /* desktop header height (top + nav links) */
}

@media (max-width: 991px) {
  body {
    padding-top: 90px; /* mobile header height */
  }
}

/* Make sure home hero is flush with content and not double-padded */
body[data-page="home"] .hero-banner {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* ========================================
   NAVBAR STYLES (legacy, kept for safety)
======================================== */

.logo-img {
  height: 40px;
  width: auto;
  max-height: 40px;
}

.navbar {
  min-height: 56px;
}

.navbar-dark-bg {
  background: #f6da50 !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

.navbar-transparent {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  transition: background 0.4s ease, box-shadow 0.4s ease;
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.navbar-transparent.scrolled {
  background: #f6da50 !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(237, 234, 231, 0.12);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar .container {
  align-items: center !important;
}

/* Mobile navbar always has background */
@media (max-width: 991px) {
  .navbar-transparent {
    background: #f6da50 !important;
    border: none !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
  }

  .logo-img {
    height: 32px;
    max-height: 32px;
  }

  .navbar {
    min-height: 50px;
  }
}

/* Desktop transparent navbar styling */
@media (min-width: 992px) {
  .navbar-transparent .form-control,
  .navbar-transparent .btn-outline-success {
    border-color: #fff !important;
    color: #fff !important;
  }

  .navbar-transparent.scrolled .form-control {
    border: 1.5px solid #fff !important;
    background: transparent !important;
    color: #fff !important;
  }

  .navbar-transparent.scrolled .form-control::placeholder {
    color: rgba(255, 255, 255, 0.8) !important;
  }

  .navbar-transparent.scrolled .btn-outline-success {
    border-color: #fff !important;
    color: #fff !important;
  }

  .navbar-transparent.scrolled .btn-outline-success:hover {
    background: #fff !important;
    color: #323232 !important;
  }
}

/* ========================================
   MOBILE SEARCH BAR (under fixed navbar)
======================================== */

.mobile-search-wrapper {
  position: fixed;
  top: 64px;               /* height of mobile header */
  left: 0;
  right: 0;
  width: 100%;
  background: #ffffff;
  z-index: 1400;           /* above header, below popup */
  padding: 8px 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);

  transform: translateY(-110%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
}

/* When visible */
.mobile-search-wrapper.visible {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Form responsiveness */
@media (max-width: 991px) {
  .mobile-search-wrapper form {
    max-width: 100%;
  }
  .mobile-search-wrapper input {
    width: 100%;
    min-width: 0;
  }
}

/* Hide search bar on desktop completely */
@media (min-width: 992px) {
  .mobile-search-wrapper {
    display: none !important;
  }
}


/* ========================================
   CART OFFCANVAS STYLES
======================================== */

@media (min-width: 768px) {
  #cartOffcanvas {
    width: 420px !important;
    max-width: 100%;
  }
}

@media (max-width: 767px) {
  #cartOffcanvas {
    width: 85% !important;
    max-width: 380px !important;
  }

  #cartOffcanvas .offcanvas-header {
    padding: 1rem 1rem;
  }

  #cartOffcanvas .offcanvas-title {
    font-size: 1.1rem;
  }

  #cartOffcanvas .offcanvas-body {
    padding: 0.75rem 1rem;
  }

  #cartOffcanvas .cart-item {
    padding: 0.75rem 0;
  }

  #cartOffcanvas .cart-item img {
    width: 60px !important;
    height: 60px !important;
    object-fit: cover;
  }

  #cartOffcanvas .cart-item h6,
  #cartOffcanvas .cart-item .fw-semibold {
    font-size: 0.9rem;
    line-height: 1.3;
  }

  #cartOffcanvas .cart-item .text-muted,
  #cartOffcanvas .cart-item small {
    font-size: 0.8rem;
  }

  #cartOffcanvas .quantity-controls {
    gap: 0.5rem !important;
  }

  #cartOffcanvas .quantity-controls button {
    width: 28px !important;
    height: 28px !important;
    font-size: 14px !important;
    padding: 0 !important;
  }

  #cartOffcanvas .quantity-display {
    font-size: 0.9rem;
    min-width: 30px;
  }

  #cartOffcanvas .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
  }

  #cartOffcanvas .d-flex.justify-content-between.align-items-center {
    margin: 0.75rem 0;
  }

  #cartOffcanvas .fw-bold {
    font-size: 1rem;
  }

  #cartOffcanvas .btn-success,
  #cartOffcanvas .btn-primary {
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
  }

  #cartOffcanvas .text-center.py-4 {
    padding: 2rem 1rem !important;
  }
}

@media (max-width: 576px) {
  #cartOffcanvas {
    width: 90% !important;
    max-width: 340px !important;
  }

  #cartOffcanvas .offcanvas-header {
    padding: 0.85rem 0.85rem;
  }

  #cartOffcanvas .offcanvas-body {
    padding: 0.5rem 0.85rem;
  }

  #cartOffcanvas .cart-item img {
    width: 50px !important;
    height: 50px !important;
  }

  #cartOffcanvas .cart-item h6,
  #cartOffcanvas .cart-item .fw-semibold {
    font-size: 0.85rem;
  }

  #cartOffcanvas .quantity-controls button {
    width: 26px !important;
    height: 26px !important;
    font-size: 13px !important;
  }
}

@media (max-width: 767px) {
  .offcanvas-backdrop.show {
    opacity: 0.7 !important;
  }
}

#cartOffcanvas {
  transition: transform 0.3s ease-in-out;
}

#cartOffcanvas .offcanvas-body {
  overflow-y: auto;
  overflow-x: hidden;
}

#cartOffcanvas .offcanvas-body::-webkit-scrollbar {
  width: 6px;
}

#cartOffcanvas .offcanvas-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

#cartOffcanvas .offcanvas-body::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

#cartOffcanvas .offcanvas-body::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ========================================
   ANIMATIONS
======================================== */

@keyframes cartPop {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.2) rotate(-10deg);
  }
  60% {
    transform: scale(1.2) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

.cart-btn.pop {
  animation: cartPop 0.5s ease;
}

@keyframes bump {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
  }
}

.cart-badge.bump {
  animation: bump 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.quantity-controls {
  animation: fadeIn 0.25s ease;
}

/* ========================================
   SNACKBAR
======================================== */

.snackbar {
  visibility: hidden;
  min-width: 260px;
  background: #323232;
  color: #fff;
  text-align: center;
  border-radius: 30px;
  padding: 14px 24px;
  position: fixed;
  z-index: 3000;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  font-size: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}

.snackbar.show {
  visibility: visible;
  animation: snackbarFadeIn 0.3s, snackbarFadeOut 0.5s 2.5s;
}

.snackbar button {
  background: transparent;
  border: none;
  color: #4ade80;
  font-weight: 600;
  cursor: pointer;
}

@keyframes snackbarFadeIn {
  from {
    bottom: 10px;
    opacity: 0;
  }
  to {
    bottom: 30px;
    opacity: 1;
  }
}

@keyframes snackbarFadeOut {
  from {
    bottom: 30px;
    opacity: 1;
  }
  to {
    bottom: 10px;
    opacity: 0;
  }
}

/* ========================================
   FOOTER STYLES
======================================== */

.footer-item {
  max-width: 320px;
  margin: 0 auto;
}

.footer a:hover {
  color: #e45959 !important;
}

@media (min-width: 768px) {
  .footer .footer-item {
    border-right: 1px solid #eee;
  }
  .footer .footer-item:last-child {
    border-right: none;
  }
}

@media (max-width: 767px) {
  .footer-item {
    text-align: center;
    margin-bottom: 1.5rem;
  }
}

/* ========================================
   WELCOME POPUP
======================================== */

#welcome-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#welcome-popup-content {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: popupFadeIn 0.4s ease;
}

#welcome-popup-content img {
  width: 320px;
  max-width: 90vw;
  height: auto;
  display: block;
  border-radius: 10px;
}

#close-popup {
  position: absolute;
  top: 6px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 16px;
  cursor: pointer;
  text-align: center;
  line-height: 24px;
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
