/* ====================================================
   GLOBAL RESET & THEME VARS
==================================================== */
:root {
  --clr-bg: #eef2ff; /* fondo lila muy claro */
  --clr-panel: #ffffff;
  --clr-border: #d9def3;
  --clr-primary: #6366f1; /* indigo */
  --clr-primary-dark: #000000;
  --clr-accent: #dc3545; /* rojo */
  --clr-accent-dark: #bb2d3b;
  --clr-accent-g: #dfdada;
  --radius: 0.7rem;
  --shadow: 0 6px 20px rgba(1, 22, 51, 0.3);
  --transition: all 0.25s ease-in-out;
  --gap: 1.25rem;
}

/*******************************************************
  RESET & TYPOGRAPHY
*******************************************************/
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", Arial, Helvetica, sans-serif;
  background: var(--clr-bg);
  color: #212529;
}

/*******************************************************
  HEADER
*******************************************************/
.header-modelado {
  background: var(--clr-accent-g);
  border-bottom: 1px solid var(--clr-border);
  padding: 0.9rem 0;
}

.container-title.modelado {
  display: flex;
  justify-content: center; /* centra el título */
}

.title-modelado span {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--clr-primary-dark);
  text-transform: uppercase;
  letter-spacing: 1px;}

/*******************************************************
  PRODUCT SELECTOR (dulces)
*******************************************************/
#product-selecc {
  background: var(--clr-panel);
  padding: 1rem 0;
  border-bottom: 1px solid var(--clr-border);
  position: sticky; /* permanece visible al hacer scroll */
  top: 0;
  z-index: 30;
}

.product-vector {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap);
}

.col-select-product {
  flex: 0 1 180px;
  text-align: center;
}

.col-select-product .btn {
  padding: 0;
  border: none;
}

.col-select-product img {
  max-width: 180px;
  filter: brightness(0.95);
  transition: var(--transition);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.col-select-product img:hover,
.col-select-product img:focus {
  transform: scale(1.18);
  filter: brightness(1);
}

.col-select-product.selected img {
  outline: 3px solid var(--clr-primary);
}

/*******************************************************
  MAIN LAYOUT (left / center / right)
*******************************************************/
.pre-view {
  display: flex;
  flex-wrap: nowrap;
  min-height: 80vh;
}

/* ---------- LEFT PANEL ---------- */
.container-color {
    width: 100%;
}
.box-color-file {
  width: 15%;
  background: var(--clr-accent-g);
  border-right: 1px solid var(--clr-primary-dark);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.box-color-file-title span {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.6rem;
  display: inline-block;
  white-space: nowrap;
  color: var(--clr-primary-dark);
}

/* Color picker */
.form-control-color {
  width: 100%;
  height: 3rem;
  padding: 0.25rem;
  border-radius: var(--radius);
}

/* File upload */
.input-group form,
.logo-up {
  width:100%;
}
.input-file {
  display: none;
}

.input-file-button,
.custom-btn-fileLoad {
  width: 100%;
  display: inline-block;
  background: var(--clr-accent);
  border: 1px solid var(--clr-border);
  color: #ffffff;
  padding: 0.75rem 1.2rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  transition: var(--transition);
}
.custom-btn-fileLoad {
  background: #838383;
  border: 1px solid white;
}

.input-file-button:hover,
.custom-btn-fileLoad:hover,
.input-file-button:active,
.custom-btn-fileLoad:active {
  background: var(--clr-accent-dark);
}

.input-file-name {
  display: block;
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: #6c757d;
}

.btns {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 1rem;
}

/* ---------- CANVAS PANEL ---------- */
.canva {
  width: 70%;
  background: #f1f5ff; /* tono azulado claro */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.8rem 0;
}

.product-preview,
#product-preview {
  width: 100%;
  max-width: 720px;
  aspect-ratio: 1 / 1;
  background: var(--clr-panel);
  border: 2px dashed var(--clr-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  overflow: hidden;
}

#tarp {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- RIGHT PANEL ---------- */
#controls {
  width: 15%;
  background: var(--clr-accent-g);
  border-left: 1px solid var(--clr-primary-dark);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

#controls .box-texture select {
  margin-top: 0.5rem;
  border-radius: var(--radius);
}

.btns_controls label {
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
  color: #495057;
}

.container-btns {
  margin-top: var(--gap);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.container-btns .btn {
  width: 100%;
  background: var(--clr-accent);
  border-color: var(--clr-accent-dark);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
}

.container-btns .btn:hover {
  background: var(--clr-accent-dark);
  border-color: var(--clr-accent-dark);
}

/*******************************************************
  KEEP BUTTONS VISIBLE ON TALL SCREENS
*******************************************************/
@media (min-height: 768px) {
  .container-btns {
    margin-top: auto;
    margin-bottom: 1.5rem;
  }
}

/*******************************************************
  UNIVERSAL BUTTON BASE
*******************************************************/
.btn {
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

/*******************************************************
  RESPONSIVE
*******************************************************/
@media (max-width: 1300px) {
  .box-color-file,
  #controls {
    padding: 1rem 0.5rem;
  }

}
@media (max-width: 991.98px) {
  .pre-view {
    flex-direction: column;
  }

  .box-color-file,
  .canva,
  #controls {
    width: 100%;
    min-width: 100%;
    border: none;
  }

  .canva {
    order: 1;
  }

  .container-btns {
    margin-top: var(--gap);
  }
}

@media (max-width: 575.98px) {
  .col-select-product {
    flex: 0 1 90px;
  }
  .col-select-product img {
    max-width: 120px;
  }
  .pre-view {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    grid-template-rows: auto auto;
  }
  .container.box-color-file {
    display: flex;
    min-width: 50%;
    grid-column: 1;
    grid-row: 1;
    height: 25vh;
    justify-content: space-around;
  }
  div#controls {
    min-width: 50%;
    grid-column: 2;
    grid-row: 1;
    height: 25vh;
    display: flex;
    justify-content: space-evenly;
  }
  .canva {
    order: 1;
    grid-column: 1/3;
    grid-row: 2;
  }
}