/* ======================================================
   MYM Tienda — tienda.css
   Bootstrap 5 + custom design system
   Paleta: #3498db (azul), #2980b9 (azul oscuro), #111111 (negro), #f8f9fa (fondo)
   ====================================================== */

:root {
  --mym-primary:   #3498db;
  --mym-primary-d: #2980b9;
  --mym-text:      #222222;
  --mym-light:     #f8f9fa;
  --mym-border:    #e3e6ef;
  --mym-radius:    12px;
  --mym-shadow:    0 2px 12px rgba(0,0,0,.08);

  /* Override Bootstrap 5 primary color */
  --bs-primary:          #3498db;
  --bs-primary-rgb:      52,152,219;
  --bs-link-color:       #3498db;
  --bs-link-hover-color: #2980b9;
}

/* Bootstrap button overrides */
.btn-primary {
  --bs-btn-bg:                #3498db;
  --bs-btn-border-color:      #3498db;
  --bs-btn-hover-bg:          #2171a0;
  --bs-btn-hover-border-color:#2171a0;
  --bs-btn-active-bg:         #2980b9;
  --bs-btn-active-border-color:#2980b9;
  --bs-btn-disabled-bg:       #3498db;
  --bs-btn-disabled-border-color:#3498db;
}
.btn-outline-primary {
  --bs-btn-color:             #3498db;
  --bs-btn-border-color:      #3498db;
  --bs-btn-hover-bg:          #3498db;
  --bs-btn-hover-border-color:#3498db;
  --bs-btn-hover-color:       #fff;
  --bs-btn-active-bg:         #2980b9;
  --bs-btn-active-border-color:#2980b9;
}
.text-primary { color: #3498db !important; }
.bg-primary   { background-color: #3498db !important; }
.border-primary { border-color: #3498db !important; }
.badge.bg-primary { background-color: #3498db !important; }

/* ===== RESET & BASE ===== */
body {
  font-family: 'Open Sans', sans-serif;
  color: var(--mym-text);
  background: #fff;
}
h1,h2,h3,h4,h5,h6 { font-family: 'Raleway', sans-serif; }
a { color: var(--mym-primary); }
a:hover { color: var(--mym-primary-d); }

/* ===== NAVBAR ===== */
#tienda-navbar {
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
  z-index: 1000;
}
.navbar-logo {
  max-height: 42px;
  width: auto;
}
/* La barra superior no debe envolver ni desbordar al achicar la pantalla */
#tienda-navbar > .container { flex-wrap: nowrap; }
#tienda-navbar #navbar-actions .btn { white-space: nowrap; }
@media (max-width: 991.98px) {
  #tienda-navbar #navbar-actions { gap: .35rem !important; }
  .navbar-logo { max-height: 36px; }
}
@media (max-width: 400px) {
  #tienda-navbar #navbar-actions { gap: .25rem !important; }
  #tienda-navbar #navbar-actions .btn { padding-left: .5rem; padding-right: .5rem; }
  .navbar-logo { max-height: 30px; }
}
#cat-bar {
  background: #fff;
  font-size: .82rem;
  scrollbar-width: none;
}
#cat-bar::-webkit-scrollbar { display: none; }
.cat-link {
  color: var(--mym-text);
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.cat-link:hover { color: var(--mym-primary); border-bottom-color: var(--mym-primary); }
.cart-badge {
  font-size: .65rem;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ===== BARRA SERVICIO TÉCNICO ===== */
.mym-servicio-bar {
  background: #1a2b49;
  color: #fff;
  font-size: 14px;
  padding: 7px 0;
}
.mym-servicio-bar a.mym-servicio-link {
  color: #ffce7a;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.mym-servicio-bar a.mym-servicio-link:hover { text-decoration: underline; color: #ffce7a; }
@media (max-width: 576px) {
  .mym-servicio-bar { font-size: 12.5px; }
}

/* ===== CAROUSEL HOME ===== */
.home-carousel-img {
  height: 460px;
  object-fit: cover;
  object-position: center;
}
#homeCarousel .carousel-item {
  position: relative;
}
#homeCarousel .carousel-caption {
  left: 8%;
  right: auto;
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
  text-align: left;
  max-width: 55%;
  padding: 0;
}
#homeCarousel .carousel-caption h2 {
  font-size: 2.2rem;
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
  margin-bottom: .5rem;
}
#homeCarousel .carousel-caption p {
  font-size: 1.1rem;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
  margin-bottom: 1.25rem;
}
#homeCarousel .carousel-caption .btn {
  font-weight: 600;
  padding: .55rem 1.5rem;
}
@media (max-width: 767px) {
  .home-carousel-img { height: 210px; }
  #homeCarousel .carousel-caption {
    left: 5%;
    right: 5%;
    max-width: 65%;
    text-align: left;
  }
  #homeCarousel .carousel-caption h2 { font-size: 1.15rem; margin-bottom: .2rem; }
  #homeCarousel .carousel-caption p  { font-size: .8rem; line-height: 1.25; margin-bottom: .55rem; }
  #homeCarousel .carousel-caption .btn { font-size: .78rem; padding: .3rem 1rem; }
}

/* ===== HERO ===== */
.tienda-hero {
  background: linear-gradient(135deg, #3498db 0%, #1a5276 100%);
  padding: 60px 0;
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-weight: 700;
  font-size: 1.35rem;
  position: relative;
  padding-bottom: 10px;
  margin-bottom: 24px;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--mym-primary);
  border-radius: 2px;
}

/* ===== PRODUCT CARDS ===== */
.product-card {
  transition: transform .2s, box-shadow .2s;
  border-radius: var(--mym-radius) !important;
  overflow: hidden;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(52,152,219,.15) !important;
}
.product-img-wrap {
  aspect-ratio: 1/1;
  overflow: hidden;
  background: #f5f7fa;
}
.product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .3s;
  padding: 8px;
}
.product-card:hover .product-img { transform: scale(1.05); }
.product-title {
  font-size: .85rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.price-main { font-size: 1.05rem; }
.price-old  { font-size: .82rem; }

/* ===== CATEGORIES ===== */
.cat-card {
  transition: background .2s, border-color .2s, transform .2s;
  background: #fff;
}
.cat-card:hover {
  background: #eaf4fb !important;
  border-color: var(--mym-primary) !important;
  transform: translateY(-2px);
}

/* Color block style */
.cat-card-block {
  transition: transform .2s, box-shadow .2s;
}
.cat-card-block:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,.15) !important;
}

/* Home categories grid — scroll horizontal mobile, auto-fit desktop */
.cat-grid-home {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.cat-grid-home::-webkit-scrollbar { display: none; }
.cat-home-item {
  flex: 0 0 140px;
  min-width: 0;
}
.cat-home-icon {
  height: 90px;
  font-size: 2.2rem;
}
@media (min-width: 576px) {
  /* Columnas fijas + grilla centrada: filas parejas y última fila con 2+ ítems,
     nunca un solo huérfano estirado. (8 categorías → 3+3+2 en tablet, 4+4 en desktop). */
  .cat-grid-home {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    overflow: visible;
    padding-bottom: 0;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }
  .cat-home-item {
    flex: none;
    min-width: 0;
    max-width: none;
  }
  .cat-home-icon {
    height: 100px;
    font-size: 2.4rem;
  }
}
@media (min-width: 768px) {
  .cat-grid-home {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 900px;
  }
}
@media (min-width: 992px) {
  .cat-grid-home {
    gap: 16px;
    max-width: 1000px;
  }
  .cat-home-icon {
    height: 110px;
    font-size: 2.6rem;
  }
}

/* ===== PRODUCT DETAIL ===== */
.product-detail-img {
  aspect-ratio: 1/1;
  object-fit: contain;
  background: #f5f7fa;
  padding: 16px;
  width: 100%;
}
.thumb-img { transition: opacity .2s; }
.thumb-img:hover { opacity: .75; }
.variant-btn { transition: all .15s; }
.variant-btn.active {
  border-color: var(--mym-primary) !important;
  box-shadow: 0 0 0 3px rgba(52,152,219,.2);
  font-weight: 600;
}
.variant-btn:focus-visible { outline: 2px solid var(--mym-primary); outline-offset: 2px; }
.color-btn.active { outline: 3px solid var(--mym-primary); outline-offset: 2px; box-shadow: 0 0 0 3px rgba(52,152,219,.25); }
.precio-wrap .display-6 { font-family: 'Raleway', sans-serif; }

/* ===== SHARE BUTTONS ===== */
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, box-shadow .15s;
}
.share-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 2px 8px rgba(0,0,0,.15) !important;
}

/* ===== CART ===== */
/* nothing extra needed — Bootstrap handles it */

/* ===== CHECKOUT ===== */
/* sticky sidebar handled inline */

/* ===== FORMS ===== */
.form-control:focus, .form-select:focus {
  border-color: var(--mym-primary);
  box-shadow: 0 0 0 3px rgba(52,152,219,.12);
}

/* ===== INSTAGRAM SECTION ===== */
.instagram-section {
  background: linear-gradient(135deg, #f0f4ff 0%, #f0f9ff 100%);
}
.instagram-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  flex-shrink: 0;
}
.btn-instagram {
  background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
  border: none;
  font-weight: 600;
  transition: opacity .2s, transform .2s;
}
.btn-instagram:hover {
  color: #fff;
  opacity: .9;
  transform: translateY(-2px);
}

/* ===== FOOTER ===== */
.tienda-footer {
  background: #1a2035;
  color: #b0bad0;
}
.tienda-footer h6 { color: #fff; }
.footer-link { color: #b0bad0; text-decoration: none; display: block; margin-bottom: 4px; transition: color .2s; }
.footer-link:hover { color: #5dade2; }

/* ===== WHATSAPP FLOAT ===== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  background: #25d366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 16px rgba(37,211,102,.4);
  z-index: 9999;
  text-decoration: none;
  transition: transform .2s;
}
.whatsapp-float:hover { transform: scale(1.1); color: #fff; }

/* ===== PAGINATION ===== */
.page-link {
  color: var(--mym-primary);
  border-radius: 6px !important;
  margin: 0 2px;
}
.page-item.active .page-link {
  background: var(--mym-primary);
  border-color: var(--mym-primary);
}

/* ===== ALERTS ===== */
.alert { border-radius: var(--mym-radius); border: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 576px) {
  .tienda-hero { padding: 40px 0; }
  .tienda-hero h1 { font-size: 1.5rem; }
  .product-img-wrap { aspect-ratio: 1/1; }
}

/* ===== Favoritos / Wishlist ===== */
.fav-btn {
    z-index: 3;
    width: 34px; height: 34px;
    border: none; border-radius: 50%;
    background: rgba(255,255,255,.9);
    color: #dc3545;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
    cursor: pointer; font-size: 1rem;
    transition: transform .15s ease, background .15s ease;
}
.fav-btn:hover { transform: scale(1.12); background: #fff; }
.fav-btn .bi-heart-fill, .fav-btn.is-fav { color: #dc3545; }
.fav-btn-lg.is-fav { background: #dc3545; color: #fff; }
.fav-btn-lg.is-fav .bi { color: #fff; }
@keyframes favPop { 0%{transform:scale(1);} 50%{transform:scale(1.35);} 100%{transform:scale(1);} }
.fav-btn.is-fav .bi, .fav-btn-lg.is-fav .bi { animation: favPop .25s ease; }
