/* ==========================================================
   AMAM Trading - Amazon-inspired Martfury footer upgrade
   Scope: footer only. Header is intentionally untouched.
   ========================================================== */

:root {
  --amam-footer-top: #37475a;
  --amam-footer-main: #232f3e;
  --amam-footer-bottom: #131a22;
  --amam-footer-text: #d5d7dc;
  --amam-footer-muted: #aeb4bd;
  --amam-footer-heading: #ffffff;
  --amam-footer-link: #e7e9ec;
  --amam-footer-link-hover: #ffffff;
  --amam-footer-accent: #febd69;
  --amam-footer-border: rgba(255, 255, 255, 0.10);
}

/* Back-to-top strip inserted by the child theme */
.amam-footer-backtop {
  display: block;
  width: 100%;
  background: var(--amam-footer-top) !important;
  color: #fff !important;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 15px 12px;
  text-decoration: none !important;
  transition: background-color 0.18s ease;
  border: 0;
}

.amam-footer-backtop:hover,
.amam-footer-backtop:focus {
  background: #485769 !important;
  color: #fff !important;
  text-decoration: none !important;
  outline: none;
}

/* Martfury footer wrapper */
.site-footer,
.site-footer .footer-layout,
.site-footer .footer-layout-1,
footer.site-footer,
#colophon.site-footer {
  background: var(--amam-footer-main) !important;
  color: var(--amam-footer-text) !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  clear: both;
  overflow-x: hidden;
}

/* Remove Martfury light footer skin conflicts */
.site-footer .footer-light,
.site-footer .footer-dark,
.site-footer .footer-custom,
.site-footer .footer-content,
.site-footer .footer-widgets,
.site-footer .footer-links,
.site-footer .footer-info {
  background: var(--amam-footer-main) !important;
  color: var(--amam-footer-text) !important;
}

/* Main footer container */
.site-footer .footer-layout .martfury-container,
.site-footer .footer-layout .container,
.site-footer .footer-layout .martfury-container-fluid {
  width: 100% !important;
  max-width: 1280px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  box-sizing: border-box;
}

/* Main content spacing */
.site-footer .footer-content {
  padding: 42px 0 36px !important;
  border: 0 !important;
}

/* Footer information/service icons row, if enabled */
.site-footer .footer-info {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--amam-footer-border) !important;
  padding: 0 0 28px !important;
  margin: 0 0 30px !important;
}

.site-footer .footer-info .info-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 0 20px !important;
  border-right: 1px solid var(--amam-footer-border) !important;
}

.site-footer .footer-info .info-item:first-child {
  padding-left: 0 !important;
}

.site-footer .footer-info .info-item:last-of-type {
  border-right: 0 !important;
  padding-right: 0 !important;
}

.site-footer .footer-info .info-item-sep {
  display: none !important;
}

.site-footer .footer-info .info-thumb,
.site-footer .footer-info .info-thumb i,
.site-footer .footer-info .info-thumb svg {
  color: var(--amam-footer-accent) !important;
  fill: var(--amam-footer-accent) !important;
  font-size: 24px !important;
  line-height: 1 !important;
}

.site-footer .footer-info h3,
.site-footer .footer-info .info-content h3 {
  color: var(--amam-footer-heading) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  margin: 0 0 5px !important;
}

.site-footer .footer-info p,
.site-footer .footer-info .info-content p {
  color: var(--amam-footer-muted) !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  margin: 0 !important;
}

/* Footer widget columns */
.site-footer .footer-widgets {
  display: grid !important;
  grid-template-columns: 1.55fr 1fr 1fr 1.15fr !important;
  gap: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.site-footer .footer-widgets.columns-1 { grid-template-columns: 1fr !important; }
.site-footer .footer-widgets.columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.site-footer .footer-widgets.columns-3 { grid-template-columns: 1.4fr 1fr 1fr !important; }
.site-footer .footer-widgets.columns-4 { grid-template-columns: 1.55fr 1fr 1fr 1.15fr !important; }
.site-footer .footer-widgets.columns-5 { grid-template-columns: 1.45fr repeat(4, minmax(0, 1fr)) !important; }

.site-footer .footer-sidebar,
.site-footer .footer-widgets .widget {
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--amam-footer-text) !important;
  float: none !important;
}

.site-footer .footer-widgets .widget + .widget {
  margin-top: 18px !important;
}

/* Footer headings */
.site-footer .widget-title,
.site-footer .footer-widgets .widget-title,
.site-footer .footer-widgets h1,
.site-footer .footer-widgets h2,
.site-footer .footer-widgets h3,
.site-footer .footer-widgets h4,
.site-footer .footer-widgets h5,
.site-footer .footer-widgets h6,
.site-footer .footer-links .widget-title,
.site-footer .footer-bottom .widget-title {
  color: var(--amam-footer-heading) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  border: 0 !important;
}

/* Company title */
.site-footer .footer-sidebar:first-child .widget-title,
.site-footer .footer-sidebar:first-child h3,
.site-footer .footer-sidebar:first-child h4 {
  font-size: 18px !important;
  text-transform: uppercase !important;
}

/* Text and links */
.site-footer p,
.site-footer .textwidget,
.site-footer .textwidget p,
.site-footer .footer-widgets .widget,
.site-footer .footer-links,
.site-footer .footer-links p {
  color: var(--amam-footer-text) !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
}

.site-footer a,
.site-footer .footer-widgets a,
.site-footer .footer-links a,
.site-footer .footer-bottom a,
.site-footer .footer-copyright a {
  color: var(--amam-footer-link) !important;
  font-size: 14px !important;
  line-height: 1.8 !important;
  text-decoration: none !important;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.site-footer a:hover,
.site-footer a:focus,
.site-footer .footer-widgets a:hover,
.site-footer .footer-links a:hover,
.site-footer .footer-bottom a:hover,
.site-footer .footer-copyright a:hover {
  color: var(--amam-footer-link-hover) !important;
  text-decoration: underline !important;
  text-decoration-color: var(--amam-footer-link-hover) !important;
}

/* Lists */
.site-footer ul,
.site-footer ol,
.site-footer .menu {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.site-footer li,
.site-footer .menu li {
  margin: 0 0 6px !important;
  padding: 0 !important;
  border: 0 !important;
}

.site-footer li::before,
.site-footer .menu li::before,
.site-footer .widget li::before {
  content: none !important;
  display: none !important;
}

/* Contact details: keep readable */
.site-footer .widget_text strong,
.site-footer strong,
.site-footer b {
  color: #fff !important;
  font-weight: 700 !important;
}

/* Footer links area if Martfury footer-links widget is enabled */
.site-footer .footer-links {
  margin-top: 28px !important;
  padding-top: 24px !important;
  border-top: 1px solid var(--amam-footer-border) !important;
}

/* Footer bottom bar */
.site-footer .footer-bottom {
  background: var(--amam-footer-bottom) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  padding: 18px calc((100vw - min(1280px, 100vw)) / 2 + 24px) !important;
  color: var(--amam-footer-muted) !important;
}

.site-footer .footer-bottom .footer-row,
.site-footer .footer-bottom .row {
  max-width: 1280px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
}

.site-footer .footer-bottom [class*="col-"] {
  float: none !important;
  width: auto !important;
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.site-footer .footer-copyright,
.site-footer .footer-copyright p,
.site-footer .footer-bottom p {
  color: var(--amam-footer-muted) !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  margin: 0 !important;
}

/* Payments */
.site-footer .footer-payments {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  color: var(--amam-footer-muted) !important;
  font-size: 13px !important;
  margin: 0 !important;
}

.site-footer .footer-payments .text {
  color: var(--amam-footer-muted) !important;
  font-size: 13px !important;
  white-space: nowrap;
}

.site-footer .footer-payments ul.payments,
.site-footer .footer-payments .payments {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  margin: 0 !important;
  padding: 0 !important;
}

.site-footer .footer-payments ul.payments li,
.site-footer .footer-payments .payments li {
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
}

.site-footer .footer-payments img,
.site-footer .payments img {
  display: block !important;
  max-height: 28px !important;
  width: auto !important;
  object-fit: contain !important;
  background: #fff !important;
  border-radius: 4px !important;
  padding: 5px 8px !important;
  box-shadow: none !important;
  filter: none !important;
}

/* Newsletter / forms if enabled */
.site-footer .footer-newsletter {
  background: #1b2532 !important;
  border-bottom: 1px solid var(--amam-footer-border) !important;
  padding: 28px 0 !important;
  color: var(--amam-footer-text) !important;
}

.site-footer .footer-newsletter h1,
.site-footer .footer-newsletter h2,
.site-footer .footer-newsletter h3,
.site-footer .footer-newsletter h4,
.site-footer .footer-newsletter p {
  color: #fff !important;
}

.site-footer input[type="email"],
.site-footer input[type="text"],
.site-footer input[type="search"] {
  background: #fff !important;
  color: #111 !important;
  border: 1px solid #d5d9d9 !important;
  border-radius: 4px !important;
  min-height: 40px !important;
  padding: 10px 12px !important;
  box-shadow: none !important;
}

.site-footer button,
.site-footer input[type="submit"],
.site-footer .button {
  background: var(--amam-footer-accent) !important;
  color: #111 !important;
  border: 0 !important;
  border-radius: 4px !important;
  min-height: 40px !important;
  padding: 10px 16px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.site-footer button:hover,
.site-footer input[type="submit"]:hover,
.site-footer .button:hover {
  background: #f3a847 !important;
  color: #111 !important;
}

/* Defensive fix: mobile off-canvas menus should not appear as normal footer content */
body:not(.display-mobile-menu) #primary-mobile-nav,
body:not(.display-mobile-menu) .primary-mobile-nav,
body:not(.display-user-mobile) #primary-user-nav,
body:not(.display-user-mobile) .primary-user-nav,
body:not(.display-mobile-menu) #mf-category-mobile-nav {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: fixed !important;
  left: -520px !important;
  top: 0 !important;
  width: 475px !important;
  max-width: 88vw !important;
  height: 100vh !important;
  overflow: auto !important;
  z-index: -1 !important;
  transform: none !important;
}

body.display-mobile-menu #primary-mobile-nav,
body.display-mobile-menu .primary-mobile-nav,
body.display-mobile-menu #mf-category-mobile-nav,
body.display-user-mobile #primary-user-nav,
body.display-user-mobile .primary-user-nav {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 999999 !important;
}

/* Tablet */
@media (max-width: 1024px) {
  .site-footer .footer-layout .martfury-container,
  .site-footer .footer-layout .container,
  .site-footer .footer-layout .martfury-container-fluid {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .site-footer .footer-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 0;
  }

  .site-footer .footer-info .info-item {
    padding: 0 18px !important;
  }

  .site-footer .footer-info .info-item:nth-of-type(2n) {
    border-right: 0 !important;
  }

  .site-footer .footer-widgets,
  .site-footer .footer-widgets.columns-3,
  .site-footer .footer-widgets.columns-4,
  .site-footer .footer-widgets.columns-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 28px !important;
  }

  .site-footer .footer-bottom .footer-row,
  .site-footer .footer-bottom .row {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  .site-footer .footer-payments {
    justify-content: center !important;
    flex-wrap: wrap !important;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .amam-footer-backtop {
    padding: 14px 12px;
    font-size: 13px;
  }

  .site-footer .footer-content {
    padding: 32px 0 28px !important;
  }

  .site-footer .footer-info {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-bottom: 24px !important;
    margin-bottom: 24px !important;
  }

  .site-footer .footer-info .info-item,
  .site-footer .footer-info .info-item:first-child,
  .site-footer .footer-info .info-item:last-of-type {
    padding: 0 !important;
    border-right: 0 !important;
  }

  .site-footer .footer-widgets,
  .site-footer .footer-widgets.columns-2,
  .site-footer .footer-widgets.columns-3,
  .site-footer .footer-widgets.columns-4,
  .site-footer .footer-widgets.columns-5 {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .site-footer .widget-title,
  .site-footer .footer-widgets .widget-title,
  .site-footer .footer-sidebar:first-child .widget-title {
    font-size: 15px !important;
    margin-bottom: 10px !important;
  }

  .site-footer p,
  .site-footer .textwidget,
  .site-footer a,
  .site-footer .footer-widgets a,
  .site-footer .footer-links a {
    font-size: 13px !important;
  }

  .site-footer .footer-bottom {
    padding: 18px 18px !important;
  }

  .site-footer .footer-payments {
    gap: 8px !important;
  }

  .site-footer .footer-payments .text {
    width: 100%;
    white-space: normal;
  }

  .site-footer .footer-payments img,
  .site-footer .payments img {
    max-height: 26px !important;
    padding: 4px 7px !important;
  }
}
