/* =========================================================================
   TecnoMarket — estilos personalizados sobre Bootstrap 5
   ========================================================================= */

:root {
  --tm-primary: #4f7cff;
  --tm-primary-dark: #3a5fd9;
  --tm-accent: #ff6b4a;
  --tm-dark: #10151f;
  --tm-dark-soft: #1a2233;
  --tm-text-muted: #6b7280;
  --tm-radius: 14px;
}

* {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #f5f7fb;
  color: #1c2333;
}

a {
  text-decoration: none;
}

::selection {
  background: var(--tm-primary);
  color: #fff;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #eef1f8;
}

::-webkit-scrollbar-thumb {
  background: #c3cce4;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--tm-primary);
}

/* ============================ SECTION HEADERS ============================ */
.tm-kicker {
  display: inline-block;
  color: var(--tm-primary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
}

.tm-section-title {
  font-weight: 800;
  letter-spacing: -0.5px;
  position: relative;
  padding-bottom: 0.6rem;
  margin-bottom: 0.75rem;
}

.tm-section-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 56px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--tm-primary), var(--tm-accent));
}

/* ============================== NAVBAR ================================= */
.tm-navbar {
  background: linear-gradient(90deg, var(--tm-dark) 0%, var(--tm-dark-soft) 100%);
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
}

.tm-brand {
  font-weight: 800;
  font-size: 1.4rem;
  color: #fff !important;
  letter-spacing: -0.5px;
}

.tm-brand span {
  color: var(--tm-primary);
}

.tm-search {
  position: relative;
  width: 100%;
  max-width: 420px;
}

.tm-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tm-text-muted);
}

.tm-search .form-control {
  border-radius: 999px;
  padding-left: 40px;
  border: none;
  background: #232c40;
  color: #fff;
}

.tm-search .form-control::placeholder {
  color: #8792a8;
}

.tm-search .form-control:focus {
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.35);
  background: #232c40;
  color: #fff;
}

.tm-cart-btn {
  background: var(--tm-primary);
  color: #fff;
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-weight: 500;
  border: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.tm-cart-btn:hover {
  background: var(--tm-primary-dark);
  color: #fff;
  transform: translateY(-1px);
}

/* ================================ HERO ================================= */
.tm-hero {
  background: radial-gradient(circle at 30% 20%, #1c2947 0%, var(--tm-dark) 65%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.tm-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}

.tm-hero .container {
  position: relative;
  z-index: 1;
}

.tm-hero h1 {
  letter-spacing: -1px;
}

.tm-hero p.lead {
  color: #b7c0d8;
}

.tm-kicker-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(79, 124, 255, 0.15);
  border: 1px solid rgba(79, 124, 255, 0.4);
  color: #a9bcff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
}

.tm-btn-outline-light {
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  background: transparent;
  transition: all 0.2s ease;
}

.tm-btn-outline-light:hover {
  background: #fff;
  color: var(--tm-dark);
  transform: translateY(-1px);
}

.tm-hero-stats {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.tm-hero-stats h3 {
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.1rem;
}

.tm-hero-stats span {
  color: #8f9bc2;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =============================== BUTTONS ================================ */
.tm-btn-primary {
  background: var(--tm-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.15s ease;
}

.tm-btn-primary:hover {
  background: var(--tm-primary-dark);
  color: #fff;
  transform: translateY(-1px);
}

.tm-btn-primary:disabled {
  background: #9fb2e8;
  transform: none;
}

.tm-btn-outline {
  border: 1.5px solid var(--tm-primary);
  color: var(--tm-primary);
  border-radius: 10px;
  font-weight: 600;
  background: transparent;
}

.tm-btn-outline:hover {
  background: var(--tm-primary);
  color: #fff;
}

/* ============================== FILTERS ================================= */
.tm-pill {
  border: 1.5px solid #dfe4ee;
  background: #fff;
  color: #4b5468;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.18s ease;
}

.tm-pill:hover {
  border-color: var(--tm-primary);
  color: var(--tm-primary);
}

.tm-pill.active {
  background: var(--tm-primary);
  border-color: var(--tm-primary);
  color: #fff;
}

.tm-sort {
  max-width: 220px;
  border-radius: 10px;
  border: 1.5px solid #dfe4ee;
}

.tm-sort:focus {
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.2);
  border-color: var(--tm-primary);
}

/* ============================ PRODUCT CARDS ============================= */
.tm-card {
  border: 1px solid #eaedf3;
  border-radius: var(--tm-radius);
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: #fff;
}

.tm-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(16, 21, 31, 0.1);
}

.tm-card-img {
  background: #f0f3fa;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.tm-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.tm-card:hover .tm-card-img img {
  transform: scale(1.06);
}

.tm-badge-discount {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--tm-accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  z-index: 2;
}

.tm-card-category {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--tm-primary);
  font-weight: 600;
}

.tm-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0.25rem 0 0.35rem;
  cursor: pointer;
  line-height: 1.3;
  min-height: 2.4em;
}

.tm-card-rating i {
  color: #ffb400;
  font-size: 0.8rem;
}

.tm-price {
  font-weight: 700;
  color: #1c2333;
  font-size: 1.05rem;
}

.tm-price-old {
  text-decoration: line-through;
  color: var(--tm-text-muted);
  font-size: 0.85rem;
}

/* ============================= EMPTY STATE =============================== */
#emptyState i {
  color: #c6cce0;
}

/* =============================== FOOTER ================================== */
.tm-footer {
  background: var(--tm-dark);
  color: #cdd4e6;
}

/* ============================ PRODUCT MODAL =============================== */
.tm-modal {
  border-radius: 18px;
  border: none;
}

.tm-modal-img {
  background: #f0f3fa;
  border-radius: var(--tm-radius);
  overflow: hidden;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tm-modal-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================ QTY STEPPER =============================== */
.tm-qty-stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid #dfe4ee;
  border-radius: 10px;
  overflow: hidden;
}

.tm-qty-stepper input {
  width: 40px;
  text-align: center;
  border: none;
  outline: none;
  font-weight: 600;
}

.tm-qty-btn {
  background: #f0f3fa;
  border: none;
  width: 34px;
  height: 34px;
  font-weight: 700;
  color: #1c2333;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tm-qty-btn:hover {
  background: #e2e7f5;
}

.tm-qty-stepper-sm .tm-qty-btn {
  width: 26px;
  height: 26px;
  font-size: 0.85rem;
}

.tm-qty-stepper-sm input {
  width: 30px;
  font-size: 0.85rem;
}

/* =============================== CART ===================================== */
.tm-cart-offcanvas {
  width: 400px;
}

.tm-cart-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #eef0f6;
}

.tm-cart-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  background: #f0f3fa;
  flex-shrink: 0;
}

.tm-cart-item-info {
  flex-grow: 1;
  min-width: 0;
}

.tm-cart-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.tm-remove-btn {
  color: #d9534f;
  border: none;
  background: transparent;
}

.tm-remove-btn:hover {
  background: #fdeceb;
}

.tm-cart-summary {
  border-color: #eef0f6 !important;
}

.tm-order-summary {
  background: #f0f3fa;
}

/* =============================== TOAST ===================================== */
.tm-toast {
  border-radius: 12px;
  border: none;
  box-shadow: 0 10px 30px rgba(16, 21, 31, 0.15);
}

.tm-toast i {
  margin-right: 0.4rem;
}

/* =============================== NAV LINK =================================== */
.tm-nav-link {
  color: #cdd4e6 !important;
  font-weight: 500;
  margin-right: 0.5rem;
}

.tm-nav-link:hover {
  color: #fff !important;
}

/* ============================ WHATSAPP FLOTANTE ============================= */
.tm-whatsapp-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.8rem;
  box-shadow: 0 8px 22px rgba(37, 211, 102, 0.45);
  z-index: 1040;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: tm-whatsapp-pulse 2.4s infinite;
}

.tm-whatsapp-float:hover {
  color: #fff;
  transform: scale(1.08);
}

@keyframes tm-whatsapp-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* ============================= SECCIÓN CONTACTO ============================= */
.tm-contact-section {
  background: #eef1f8;
}

.tm-contact-card {
  background: #fff;
  border-radius: var(--tm-radius);
  box-shadow: 0 10px 30px rgba(16, 21, 31, 0.06);
  border: 1px solid #eaedf3;
}

.tm-contact-card .form-control,
.tm-contact-card textarea {
  border-radius: 10px;
  border: 1.5px solid #dfe4ee;
}

.tm-contact-card .form-control:focus {
  border-color: var(--tm-primary);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.2);
}

.tm-map-wrapper {
  border-radius: var(--tm-radius);
  overflow: hidden;
  border: 1px solid #eaedf3;
}

.tm-map-wrapper iframe {
  width: 100%;
  height: 220px;
  border: 0;
  display: block;
}

.tm-social-icons {
  display: flex;
  gap: 0.6rem;
}

.tm-social-icons a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f3fa;
  color: var(--tm-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.tm-social-icons a:hover {
  background: var(--tm-primary);
  color: #fff;
  transform: translateY(-2px);
}

.tm-social-icons-footer a {
  background: rgba(255, 255, 255, 0.08);
  color: #cdd4e6;
}

.tm-social-icons-footer a:hover {
  background: var(--tm-primary);
  color: #fff;
}

.tm-inline-link {
  color: var(--tm-primary);
  font-weight: 500;
}

.tm-inline-link:hover {
  color: var(--tm-primary-dark);
  text-decoration: underline;
}

.tm-footer-link {
  color: #cdd4e6;
  transition: color 0.15s ease;
}

.tm-footer-link:hover {
  color: var(--tm-primary);
  text-decoration: underline;
}

/* ============================ RESPONSIVE =================================== */
@media (max-width: 575.98px) {
  .tm-cart-offcanvas {
    width: 100%;
  }

  .tm-search {
    max-width: 100%;
  }

  .tm-whatsapp-float {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    right: 16px;
    bottom: 16px;
  }
}
