/* v0.9.0 DemeWebsolutions Marketplace Styles
   
   This file contains marketplace-specific styles.
   Works alongside avada.css for unified design.
   
   CSS Load Order:
   1. avada.css (Avada theme overrides + design tokens)
   2. marketplace-styles.css (this file - marketplace components)
   3. cookiejar-pro-landing-style.css (landing page specific)
*/

/* =========================
   Marketplace Variables (inherits from avada.css :root)
   ========================= */
:root{
  --page-max:1600px;
  --gap:24px;
  --card-radius:14px;
  --card-shadow:0 8px 28px rgba(16,16,24,0.06);
  --bg:#fff;
  --surface:#f9f9fb;
  --text:#101517;
  --card-pad:18px;
  --accent:#008ed6;
  --badge-bg:rgba(0,142,214,0.07);
  --badge-border:rgba(0,142,214,0.14);
}
.container{max-width:var(--page-max);margin:0 auto;padding:32px var(--gap);box-sizing:border-box}
@media (max-width:720px){
  .container{padding:20px 16px}
}
.market-grid{display:grid;grid-template-columns:320px 1fr;gap:calc(var(--gap)*1.25);align-items:start;margin-top:28px}
@media (max-width:1100px){.market-grid{grid-template-columns:1fr}}
.filters{padding:20px;border-radius:var(--card-radius);background:rgba(255,255,255,0.95);box-shadow:var(--card-shadow)}
.product-grid{display:grid;gap:22px;grid-template-columns:repeat(3,1fr)}
@media (max-width:1100px){.product-grid{grid-template-columns:repeat(2,1fr)}}
@media (max-width:720px){.product-grid{grid-template-columns:1fr}}
.product-card{
  background:var(--bg);
  border-radius:var(--card-radius);
  overflow:hidden;
  box-shadow:var(--card-shadow);
  display:flex;
  flex-direction:column;
  position:relative;
}
.product-media{
  aspect-ratio:1/1;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg,#fff,#f8f9fa);
  padding:16px;
  border-radius:12px;
  margin:12px;
  margin-left:0;
  box-shadow:0 4px 16px rgba(0,0,0,0.08);
}
a.product-media,
a.product-media.product-link{
  padding:16px;
  margin:12px;
  margin-left:0;
}
.product-media img{
  max-width:100%;
  max-height:100%;
  width:auto;
  height:auto;
  object-fit:contain;
  display:block;
  background:transparent;
}

.plans-row{display:flex;gap:8px;padding:12px;background:transparent}
a.plans-row,
a.plans-row.product-link{
  padding:12px;
  padding-left:0;
}
.plan-col{flex:1;background:#fff;padding:10px;border-radius:8px;box-shadow:0 1px 4px rgba(0,0,0,0.05);transition:border-color .15s ease,box-shadow .15s ease;border:1px solid transparent;cursor:pointer}
.plan-col:hover{
  border-color:rgba(0,142,214,0.3);
  box-shadow:0 2px 6px rgba(0,0,0,0.06);
}
.plan-col.active{
  border-color:rgba(0,142,214,0.6);
  box-shadow:0 4px 10px rgba(0,0,0,0.08);
}
.demewebsolutions-proprietary-wrapper .plan-col {
  width: 100%;
  text-align: center;
}
.plan-disclaimer{
  font-size:11px;
  color:#6b6b6b;
  text-align:center;
  padding:4px 12px 0;
  line-height:1.3;
  font-style:italic;
}
.plan-select{
  width:100%;
  margin-bottom:12px;
  min-height:44px;
  height:auto;
  padding:10px 40px 10px 12px;
  border-radius:12px;
  background:#ffffff;
  box-shadow:0 8px 20px rgba(0,0,0,0.08);
  font-size:14px;
  line-height:1.2;
  color:#151515;
  border:1px solid rgba(0,0,0,0.08);
  -webkit-appearance:none;
  -moz-appearance:none;
  appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><path fill='%23000000' fill-opacity='0.45' d='M7 10l5 5 5-5z'/></svg>");
  background-repeat:no-repeat;
  background-position:calc(100% - 14px) center;
  background-size:18px 18px;
  box-sizing:border-box;
  font-family:Inter,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  transition:border-color .15s ease,box-shadow .15s ease;
  text-align:center;
  text-overflow:ellipsis;
  white-space:normal;
  overflow:visible;
}
.plan-select option{
  text-align:center;
  white-space:normal;
  padding:8px;
}
@media (max-width:720px){
  .plan-select{
    font-size:14px;
    padding:10px 40px 10px 12px;
    min-height:44px;
    text-align:center;
    white-space:normal;
    overflow:visible;
  }
  .plan-select option{
    text-align:center;
    white-space:normal;
    padding:6px;
  }
}
.plan-select:hover{
  border-color:rgba(0,142,214,0.6);
  box-shadow:0 4px 10px rgba(0,0,0,0.08);
}
.plan-select:focus{
  outline:none;
  border-color:#008ed6;
  box-shadow:0 0 0 3px rgba(0,142,214,0.1);
}
.plan-select-help{
  font-size:12px;
  color:#6b6b6b;
  text-align:center;
  padding:6px 12px 0;
  line-height:1.4;
}
.trial-badge,
.dw-trial{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  background:var(--badge-bg);
  color:var(--accent);
  font-weight:700;
  font-size:13px;
  border:1px solid var(--badge-border);
  margin-left:20%;
}
@media (max-width:720px){
  .trial-badge,
  .dw-trial{
    margin-left:0;
    width:100%;
    justify-content:center;
    margin-bottom:8px;
  }
}
/* When only 1 or 2 plan columns visible, ensure proper flex distribution */
.plans-row .plan-col[style*="display: none"] + .plan-col:not([style*="display: none"]){
  flex:1;
}
.plan-label{font-weight:600;font-size:13px;color:#333}
.plan-price{font-size:15px;font-weight:600;color:#111;margin-top:4px}

.product-body{padding:var(--card-pad)}
.product-title{font-weight:600;font-size:15px;margin:0 0 6px;display:block}

/* Clickable card links */
.product-link{
  display:block;
  text-decoration:none;
  color:inherit;
  cursor:pointer;
  transition:opacity 0.15s ease;
}
.product-link:hover{
  opacity:0.92;
}
a.product-media{
  display:flex;
  padding-right:16px;
  margin-left:0;
}
a.plans-row{
  display:flex;
  padding-left:0;
}
a.product-body{
  display:block;
}
.product-card:hover{
  box-shadow:0 12px 32px rgba(16,16,24,0.1);
}

/* Primary button style for View */
.btn.primary{
  background:var(--accent);
  color:#fff;
}
.btn.primary:hover{
  background:#0077b9;
}

.product-footer{
  padding:12px var(--card-pad);
  border-top:1px solid rgba(0,0,0,0.05);
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:10px;
}

.product-actions{display:flex;gap:10px;flex-wrap:wrap}
.product-actions .btn.add-to-cart,
.product-actions .btn.primary {
  margin-left: 0;
  width: 100%;
  text-align: center;
}
@media (max-width:720px){
  .product-actions{
    flex-direction:column;
    gap:8px;
    width:100%;
  }
  .product-actions .btn.add-to-cart,
  .product-actions .btn.primary{
    margin-left:0;
    width:100%;
  }
}
.btn{
  background:var(--accent);
  color:#fff;
  padding:9px 14px;
  border-radius:8px;
  border:0;
  cursor:pointer;
  font-weight:600;
  font-size:14px;
  transition:background .15s;
}
.btn:hover{background:#0077b9}
.btn.ghost{
  background:transparent;
  color:var(--text);
  border:1px solid rgba(0,0,0,0.08);
}
.btn.ghost:hover{color:var(--accent);border-color:var(--accent)}

.bundle-badge{
  position:absolute;
  top:10px;
  right:10px;
  background:linear-gradient(135deg,#084b74,#008ed6);
  color:#fff;
  font-size:12px;
  font-weight:600;
  padding:6px 10px;
  border-radius:8px;
  box-shadow:0 4px 12px rgba(0,0,0,0.25);
  letter-spacing:.5px;
}
.tier-add.btn.ghost{
  background:rgba(0,142,214,0.06);
  color:#008ed6;
  border:1px solid rgba(0,142,214,0.20);
}
.tier-add.btn.ghost:hover{background:#008ed6;color:#fff}

#Demewebsolutions-proprietary-software{
  position:fixed;
  right:20px;
  bottom:20px;
  z-index:120;
  min-width:220px;
  max-width:360px;
  display:none;
  padding:12px 14px;
  border-radius:10px;
  background:rgba(0,0,0,0.85);
  color:#fff;
  font-weight:600;
  box-shadow:0 6px 28px rgba(0,0,0,0.25);
}

/* =========================
   Avada Theme Overrides
   ========================= */

/* Wrapper isolation and specificity boost */
.demewebsolutions-proprietary-wrapper,
.demewebsolutions-proprietary-wrapper.dws-marketplace-wrapper {
  position:relative;
  width:100%;
  max-width:100%;
  /* Create a new stacking/context to avoid blend issues */
  isolation:isolate;
}

/* Prevent Avada column wrappers from forcing full width or distortion */
.demewebsolutions-proprietary-wrapper .fusion-column-wrapper.product-card,
.demewebsolutions-proprietary-wrapper .product-card.fusion-column-wrapper {
  width:auto;
  max-width:100%;
}

/* Harden media container inside proprietary wrapper - 1:1 Square with Shadow Box */
.demewebsolutions-proprietary-wrapper .product-card .product-media {
  position:relative;
  aspect-ratio:1/1;
  width:100%;
  height:auto;
  min-height:unset;
  max-height:none;
  background:linear-gradient(180deg,#ffffff,#f8f9fa);
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  margin:12px;
  margin-left:0;
  box-shadow:0 4px 16px rgba(0,0,0,0.08);
  overflow:visible;
}
.demewebsolutions-proprietary-wrapper .product-card a.product-media,
.demewebsolutions-proprietary-wrapper .product-card a.product-media.product-link{
  margin-left:0;
}

/* Reset / neutralize theme image rules - ensure images fit within square */
.demewebsolutions-proprietary-wrapper .product-card .product-media img {
  all:unset;
  display:block;
  width:auto;
  height:auto;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  background:transparent;
  transition:transform .25s ease;
}

/* Hover subtle scale */
.demewebsolutions-proprietary-wrapper .product-card:hover .product-media img {
  transform:scale(1.03);
}

/* Override any inline width/height Avada may inject */
.demewebsolutions-proprietary-wrapper .product-card .product-media img[style] {
  width:auto;
  height:auto;
  max-width:100%;
  max-height:100%;
}

/* Figure resets */
.demewebsolutions-proprietary-wrapper .product-card figure,
.demewebsolutions-proprietary-wrapper .product-card figure img {
  margin:0;
  padding:0;
  border:0;
}

/* Tier buttons consistency inside wrapper */
.demewebsolutions-proprietary-wrapper .tier-add.btn.ghost {
  font-weight:600;
}

/* Responsive adjustments - maintain 1:1 square */
@media (max-width:820px){
  .demewebsolutions-proprietary-wrapper .product-card{grid-template-columns:1fr}
  .demewebsolutions-proprietary-wrapper .product-card .product-media{
    aspect-ratio:1/1;
    max-width:280px;
    margin:12px auto;
  }
}
@media (max-width:720px){
  .demewebsolutions-proprietary-wrapper .product-card .product-media{
    max-width:100%;
    margin:8px 0;
  }
  .demewebsolutions-proprietary-wrapper .product-title.fusion-responsive-typography-calculated {
    font-size: 14px;
    line-height: 1.3;
  }
}

/* =========================
   Comprehensive Avada Theme Overrides
   ========================= */

/* Override Avada container constraints */
.demewebsolutions-proprietary-wrapper .container,
.demewebsolutions-proprietary-wrapper .fusion-container,
.demewebsolutions-proprietary-wrapper .fusion-row {
  max-width: var(--page-max);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
  box-sizing: border-box;
}

/* Override Avada row/column spacing and flex behavior */
.demewebsolutions-proprietary-wrapper .fusion-row {
  display: block;
  margin-left: 0;
  margin-right: 0;
}

.demewebsolutions-proprietary-wrapper .fusion-column-wrapper,
.demewebsolutions-proprietary-wrapper .fusion-column {
  width: auto;
  float: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Preserve our grid layout */
.demewebsolutions-proprietary-wrapper .market-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: calc(var(--gap) * 1.25);
  align-items: start;
  margin-top: 28px;
}

.demewebsolutions-proprietary-wrapper .product-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(3, 1fr);
}

/* Override Avada responsive typography system */
.demewebsolutions-proprietary-wrapper .fusion-responsive-typography-calculated {
  font-size: inherit;
  line-height: inherit;
  font-weight: inherit;
}

.demewebsolutions-proprietary-wrapper .product-title.fusion-responsive-typography-calculated {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.demewebsolutions-proprietary-wrapper .dwsp-widget-title.fusion-responsive-typography-calculated {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

/* Override Avada button styles */
.demewebsolutions-proprietary-wrapper .btn,
.demewebsolutions-proprietary-wrapper button.btn,
.demewebsolutions-proprietary-wrapper a.btn {
  background: var(--accent);
  color: #fff;
  padding: 9px 14px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background .15s;
  text-decoration: none;
  display: inline-block;
  box-shadow: none;
  text-transform: none;
  letter-spacing: normal;
}

.demewebsolutions-proprietary-wrapper .btn:hover,
.demewebsolutions-proprietary-wrapper button.btn:hover,
.demewebsolutions-proprietary-wrapper a.btn:hover {
  background: #0077b9;
  color: #fff;
  transform: none;
}

.demewebsolutions-proprietary-wrapper .btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(0,0,0,0.08);
}

.demewebsolutions-proprietary-wrapper .btn.ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: transparent;
}

/* Override Avada spacing utilities */
.demewebsolutions-proprietary-wrapper [class*="fusion-spacing-"],
.demewebsolutions-proprietary-wrapper [class*="fusion-margin-"],
.demewebsolutions-proprietary-wrapper [class*="fusion-padding-"] {
  margin: 0;
  padding: 0;
}

/* Override Avada widget styles */
.demewebsolutions-proprietary-wrapper .dwsp-widget,
.demewebsolutions-proprietary-wrapper .filters .widget {
  margin-bottom: 20px;
  padding: 0;
}

.demewebsolutions-proprietary-wrapper .dwsp-widget:last-child,
.demewebsolutions-proprietary-wrapper .filters .widget:last-child {
  margin-bottom: 0;
}

/* Override Avada link styles */
.demewebsolutions-proprietary-wrapper .product-title,
.demewebsolutions-proprietary-wrapper .product-title a {
  color: #008ed6;
  text-decoration: none;
  transition: color .15s;
}

.demewebsolutions-proprietary-wrapper .product-title:hover,
.demewebsolutions-proprietary-wrapper .product-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Override Avada image lazy loading and sizing */
.demewebsolutions-proprietary-wrapper .product-media img.lazy,
.demewebsolutions-proprietary-wrapper .product-media img[data-lazy],
.demewebsolutions-proprietary-wrapper .product-media img.fusion-lazy-load {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

/* Override Avada animation classes */
.demewebsolutions-proprietary-wrapper [class*="fusion-animated"],
.demewebsolutions-proprietary-wrapper [data-animation] {
  animation: none;
  opacity: 1;
  transform: none;
}

/* Override Avada visibility classes */
.demewebsolutions-proprietary-wrapper [class*="fusion-hidden"],
.demewebsolutions-proprietary-wrapper [class*="fusion-visible"] {
  display: inherit;
  visibility: inherit;
}

/* Override Avada clearfix */
.demewebsolutions-proprietary-wrapper .fusion-clearfix::before,
.demewebsolutions-proprietary-wrapper .fusion-clearfix::after {
  display: none;
}

/* Responsive: Override Avada breakpoints */
@media (max-width: 1100px) {
  .demewebsolutions-proprietary-wrapper .market-grid {
    grid-template-columns: 1fr;
  }
  
  .demewebsolutions-proprietary-wrapper .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .demewebsolutions-proprietary-wrapper .fusion-column-wrapper,
  .demewebsolutions-proprietary-wrapper .fusion-column {
    width: 100%;
    float: none;
  }
}

@media (max-width: 720px) {
  .demewebsolutions-proprietary-wrapper .product-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .demewebsolutions-proprietary-wrapper .product-card {
    padding: 12px;
  }
  .demewebsolutions-proprietary-wrapper .product-footer {
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
  }
  .demewebsolutions-proprietary-wrapper .plans-row {
    flex-direction: column;
    gap: 8px;
    padding: 8px;
  }
  .demewebsolutions-proprietary-wrapper .plan-col {
    width: 100%;
    text-align: center;
  }
  .demewebsolutions-proprietary-wrapper .product-body {
    padding: 12px;
  }
  .demewebsolutions-proprietary-wrapper .plan-select-help {
    font-size: 11px;
    padding: 4px 8px 0;
  }
}

/* Override Avada z-index stacking */
.demewebsolutions-proprietary-wrapper {
  z-index: 1;
  position: relative;
}

.demewebsolutions-proprietary-wrapper .bundle-badge {
  z-index: 10;
}

#Demewebsolutions-proprietary-software {
  z-index: 120;
}

/* Override Avada box-shadow utilities */
.demewebsolutions-proprietary-wrapper [class*="fusion-shadow"] {
  box-shadow: var(--card-shadow);
}

/* Override Avada border-radius utilities */
.demewebsolutions-proprietary-wrapper .product-card {
  border-radius: var(--card-radius);
}

/* Override Avada background utilities */
.demewebsolutions-proprietary-wrapper [class*="fusion-bg-"] {
  background: inherit;
}

/* Ensure proper display for flex containers */
.demewebsolutions-proprietary-wrapper .plans-row,
.demewebsolutions-proprietary-wrapper .product-footer,
.demewebsolutions-proprietary-wrapper .product-actions {
  display: flex;
}
.demewebsolutions-proprietary-wrapper a.plans-row,
.demewebsolutions-proprietary-wrapper a.plans-row.product-link{
  padding-left:0;
}

/* Override Avada text alignment utilities */
.demewebsolutions-proprietary-wrapper [class*="fusion-text-"] {
  text-align: inherit;
}

/* Override Avada default width constraints (width: 100%, max-width: 100%) */
.demewebsolutions-proprietary-wrapper .product-card,
.demewebsolutions-proprietary-wrapper .product-media,
.demewebsolutions-proprietary-wrapper .product-body,
.demewebsolutions-proprietary-wrapper .product-footer,
.demewebsolutions-proprietary-wrapper .plans-row,
.demewebsolutions-proprietary-wrapper .plan-col,
.demewebsolutions-proprietary-wrapper .filters,
.demewebsolutions-proprietary-wrapper .results {
  width: auto;
  max-width: 100%;
}
.demewebsolutions-proprietary-wrapper .fusion-column-wrapper.product-card,
.demewebsolutions-proprietary-wrapper .product-card.fusion-column-wrapper {
  width: auto;
  max-width: 100%;
  border-radius: 12px;
}

/* Override Avada default gray text color (#8c8c8c) */
.demewebsolutions-proprietary-wrapper .product-title,
.demewebsolutions-proprietary-wrapper .product-title a {
  color: #008ed6;
}

.demewebsolutions-proprietary-wrapper .plan-label {
  color: #333;
}

.demewebsolutions-proprietary-wrapper .plan-price {
  color: #111;
}

.demewebsolutions-proprietary-wrapper .product-title,
.demewebsolutions-proprietary-wrapper .product-title a {
  color: var(--text);
}

/* Ensure container respects max-width but allows content to flow */
.demewebsolutions-proprietary-wrapper .container {
  width: 100%;
  max-width: var(--page-max);
}