/* ========================================
   FENIXLAB PRODUCT DESIGNER - CLEAN LAYOUT
   - Container friendly (no max-width)
   - 65/35 grid
   - Button groups: 2 + 3 inline
======================================== */

/* Wrapper: always stay inside parent container */
.flpd-wrap{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;

  margin: 16px 0;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid #eee;
  background:#fff;
  box-shadow: 0 12px 28px rgba(0,0,0,.05);
}

/* Header */
.flpd-title{
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 6px;
}

.flpd-sub{
  font-size: 14px;
  opacity: .65;
  margin-bottom: 14px;
}

/* Main grid: 65/35 */
.flpd-grid{
  display: grid;
  grid-template-columns: 65% 35%;
  gap: 22px;
  align-items: start;
}

@media (max-width: 980px){
  .flpd-grid{
    grid-template-columns: 1fr;
  }
}

/* Left/Right columns */
.flpd-left, .flpd-right{
  min-width: 0; /* prevents overflow in grid */
}

/* RIGHT: sticky but safe */
.flpd-right{
  position: sticky;
  top: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Buttons area */
.flpd-controls{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

/* Group rows */
.flpd-controls-row{
  display: grid;
  gap: 10px;
}

.flpd-controls-row.top{
  grid-template-columns: 1fr 1fr;  /* Logo + Metin */
}

.flpd-controls-row.bottom{
  grid-template-columns: 1fr 1fr 1fr; /* Ortala + Sil + Sıfırla */
}

@media (max-width: 520px){
  .flpd-controls-row.top{
    grid-template-columns: 1fr;
  }
  .flpd-controls-row.bottom{
    grid-template-columns: 1fr;
  }
}

/* Button style (compact, icon friendly) */
.flpd-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  width: 100%;
  height: 42px;

  padding: 0 12px !important;
  border-radius: 14px !important;
  border: 1px solid #e6e6e6 !important;

  background: #fff !important;
  color: #111 !important;

  font-size: 13px !important;
  font-weight: 800 !important;

  cursor: pointer;
  transition: all .18s ease;
}

.flpd-btn svg{
  width: 14px;
  height: 14px;
}

.flpd-btn:hover{
  background: #111 !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.flpd-btn.danger{
  border-color: #e53935 !important;
  color: #e53935 !important;
}

.flpd-btn.danger:hover{
  background: #e53935 !important;
  color: #fff !important;
}

/* Canvas card */
.flpd-canvas-box{
  border: 1px solid #eee;
  border-radius: 18px;
  padding: 14px;
  background: #fafafa;
}

#flpd-canvas{
  width: 100%;
  height: auto;
  display: block;

  border-radius: 14px;
  border: 1px solid #f1f1f1;
  background: #fff;
}

.flpd-hint{
  font-size: 12px;
  opacity: .6;
  margin-top: 10px;
}

/* Approve */
.flpd-check{
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #eee;
  border-radius: 16px;
  background: #fcfcfc;
  font-weight: 600;
}

/* Right panel titles */
.flpd-preview-title{
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 8px;
}

/* Mockup */
.flpd-preview-box{
  border: 1px solid #eee;
  border-radius: 18px;
  padding: 14px;
  background: #fff;
}

.flpd-mockup{
  position: relative;
  overflow: hidden;
  border-radius: 14px;

  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#flpd-mockup-img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
}

#flpd-overlay{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  width: 60%;
  height: auto;

  opacity: .95;
  pointer-events: none;
  mix-blend-mode: multiply;
  filter: contrast(1.05);
}

/* 3D box */
.flpd-3d-box{
  border: 1px solid #eee;
  border-radius: 18px;
  padding: 14px;
  background: #fff;
}

.flpd-3d{
  width: 100%;
  height: 210px;
  border-radius: 14px;
  background: #111;
  overflow: hidden;
}

/* Cart bar */
.flpd-cartbar{
  padding: 14px;
  border-radius: 18px;
  background: #111;
  box-shadow: 0 18px 34px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flpd-cartbar .quantity{
  margin: 0 !important;
}

.flpd-cartbar input.qty{
  height: 44px !important;
  border-radius: 14px !important;
  border: 1px solid #e6e6e6 !important;
  padding: 0 12px !important;
}

.flpd-cartbar button.single_add_to_cart_button{
  height: 46px !important;
  border-radius: 14px !important;
  border: none !important;

  background: #fff !important;
  color: #111 !important;

  font-weight: 900 !important;
  font-size: 14px !important;

  transition: all .18s ease;
}

.flpd-cartbar button.single_add_to_cart_button:hover{
  background: #f5f5f5 !important;
  transform: translateY(-1px);
}

/* Mobile: disable sticky for right to avoid weird jumps */
@media (max-width: 980px){
  .flpd-right{
    position: relative;
    top: auto;
  }
}

/* Hide 3D mockup section (temporarily) */
.flpd-3d-box,
.flpd-3d,
#flpd-3d{
  display:none !important;
}

/* Hide the 3D title ONLY if it exists right above 3D box */
.flpd-preview-title + .flpd-3d-box{
  display:none !important;
}


/* =========================================
   FIX 1: Remove black background behind cart
   (theme/elementor wrappers override)
========================================= */

/* Our cartbar must be white always */
#flpd-cartbar,
.flpd-cartbar{
  background:#fff !important;
  border:1px solid #eee !important;
  box-shadow: 0 12px 26px rgba(0,0,0,.08) !important;
}

/* Sometimes theme adds black bg to parents of button/qty */
#flpd-cartbar *{
  background-color: transparent;
}

/* Force button wrapper backgrounds off */
#flpd-cartbar .quantity,
#flpd-cartbar .single_add_to_cart_button,
#flpd-cartbar button,
#flpd-cartbar form,
#flpd-cartbar .woocommerce-variation-add-to-cart,
#flpd-cartbar .woocommerce-variation-add-to-cart-enabled,
#flpd-cartbar .woocommerce-variation-add-to-cart-disabled{
  background: transparent !important;
  box-shadow: none !important;
}

/* Keep actual add-to-cart button black (nice) */
#flpd-cartbar button.single_add_to_cart_button{
  background:#111 !important;
  color:#fff !important;
}

/* =========================================
   FIX 2: Mobile layout + canvas scaling
========================================= */
@media (max-width: 980px){

  .flpd-wrap{
    padding: 12px !important;
    border-radius: 14px !important;
  }

  .flpd-grid{
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .flpd-controls-row.top{
    grid-template-columns: 1fr !important;
  }
  .flpd-controls-row.bottom{
    grid-template-columns: 1fr 1fr 1fr !important;
  }
}

@media (max-width: 520px){

  /* reduce overall height feel */
  .flpd-canvas-box{
    padding: 10px !important;
    border-radius: 14px !important;
  }

  /* Canvas should never overflow screen */
  #flpd-canvas{
    width: 100% !important;
    height: auto !important;
    max-height: 52vh !important; /* KEY: keep inside screen */
  }

  /* Preview also smaller on mobile */
  .flpd-mockup{
    min-height: 180px !important;
  }

  /* Cartbar tighter */
  .flpd-cartbar{
    padding: 10px !important;
    gap: 8px !important;
  }

  /* Qty + button stack if needed */
  .flpd-cartbar{
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .flpd-cartbar input.qty{
    width: 100% !important;
  }
}