:root {
  --kala-night: #11120f;
  --kala-ivory: #f0ebe0;
  --kala-rust: #7c2f32;
  --kala-gold: #b79a66;
  --kala-line: rgba(19, 20, 17, .16);
}

.kala-front-editor {
  margin: 0 0 40px;
  padding: 34px;
  border: 1px solid #e5ddd2;
  border-radius: 20px;
  background: #fffdf9;
  box-shadow: 0 18px 50px rgba(52, 35, 24, .08);
  color: #2c211a;
}
.kala-front-editor header span { color: #a84f32; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.kala-front-editor header h2 { margin: 8px 0 4px; font-family: Georgia, serif; font-size: 34px; }
.kala-front-editor header p { margin: 0 0 26px; color: #75675e; }
.kala-front-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.kala-front-grid label { display: flex; flex-direction: column; gap: 8px; font-weight: 700; }
.kala-front-grid .wide { grid-column: 1 / -1; }
.kala-front-grid input,
.kala-front-grid select,
.kala-front-grid textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #d9cec2;
  border-radius: 10px;
  background: #fff;
  font: inherit;
}
.kala-front-file { padding: 18px; border: 1px dashed #cdbbaa; border-radius: 12px; background: #f9f4ed; }
.kala-front-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.kala-front-actions button {
  padding: 13px 20px;
  border: 1px solid #9c432b;
  border-radius: 999px;
  background: transparent;
  color: #8e3c28;
  font-weight: 800;
  cursor: pointer;
}
.kala-front-actions .primary { background: #9c432b; color: #fff; }
.kala-front-notice { margin: 0 0 20px; padding: 12px 15px; border-radius: 10px; font-weight: 700; }
.kala-front-notice.success { background: #e8f5eb; color: #256b35; }
.kala-front-notice.error { background: #fae8e5; color: #9b3026; }
.kala-score-editor .woocommerce-MyAccount-content > p { display: none; }
.kala-score-editor .woocommerce-MyAccount-navigation li { display: none; }
.kala-score-editor .woocommerce-MyAccount-navigation li.is-active,
.kala-score-editor .woocommerce-MyAccount-navigation li:last-child { display: block; }

/* Carrito y pago sin la cabecera del tema anterior */
body.kala-commerce-clean .site-header,
body.kala-commerce-clean #masthead,
body.kala-commerce-clean .main-header-bar,
body.kala-commerce-clean .ast-above-header-wrap,
body.kala-commerce-clean .ast-below-header-wrap {
  display: none !important;
}

body.kala-commerce-clean .site-content {
  padding-top: clamp(28px, 5vw, 72px);
}

body.kala-commerce-clean #colophon,
body.kala-commerce-clean .site-footer,
body.kala-commerce-clean .footer-widget-area,
body.kala-commerce-clean .footer-adv-overlay {
  display: none !important;
}

.kala-commerce-footer {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  align-items: end;
  gap: clamp(24px, 4vw, 70px);
  margin-top: clamp(55px, 8vw, 110px);
  padding: 38px clamp(22px, 6vw, 90px);
  border-top: 1px solid rgba(19, 20, 17, .14);
  background: #171713;
  color: #f4efe4;
}

.kala-commerce-footer-brand {
  display: grid;
  gap: 8px;
}

.kala-commerce-footer-brand span {
  color: #c69c74;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .18em;
}

.kala-commerce-footer-brand strong {
  font-family: Georgia, serif;
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 400;
}

.kala-commerce-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.kala-commerce-footer nav a {
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(244, 239, 228, .32);
  color: #f4efe4;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.kala-commerce-footer nav a:hover {
  border-color: #c69c74;
  color: #c69c74;
}

.kala-commerce-footer > p {
  margin: 0;
  color: rgba(244, 239, 228, .6);
  font-size: 10px;
  white-space: nowrap;
}

.kala-store-return {
  margin: 0 0 30px;
}

.kala-store-return a {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  padding: 13px 19px 13px 15px;
  border: 1px solid rgba(124, 47, 50, .24);
  border-radius: 999px;
  background: #fffdf9;
  box-shadow: 0 10px 26px rgba(52, 35, 24, .08);
  color: #2c211a;
  text-decoration: none !important;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.kala-store-return a > span:first-child {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--kala-rust);
  color: #fff;
  font-size: 20px;
}

.kala-store-return a > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kala-store-return small {
  color: var(--kala-rust);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .16em;
}

.kala-store-return strong {
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 400;
}

.kala-store-return a:hover {
  border-color: var(--kala-rust);
  box-shadow: 0 14px 32px rgba(52, 35, 24, .13);
  transform: translateY(-2px);
}

@media (max-width: 700px) {
  .kala-commerce-footer {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .kala-commerce-footer > p {
    white-space: normal;
  }
  .kala-front-editor { padding: 22px; }
  .kala-front-grid { grid-template-columns: 1fr; }
  .kala-front-grid .wide { grid-column: auto; }
  .kala-front-actions { flex-direction: column; }
}

body.toplevel_page_kalamusic-partituras #wpcontent {
  padding-left: 0;
}

.kala-wrap {
  min-height: calc(100vh - 32px);
  margin: 0;
  padding: 52px clamp(24px, 5vw, 82px) 80px;
  background: var(--kala-ivory);
  color: var(--kala-night);
}

.kala-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 46px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--kala-line);
}

.kala-header span,
.kala-card-title span,
.kala-user span {
  color: var(--kala-rust);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .17em;
}

.kala-header h1 {
  margin: 8px 0 5px;
  font-family: Georgia, serif;
  font-size: clamp(48px, 6vw, 82px);
  font-weight: 400;
  letter-spacing: -.055em;
  line-height: .9;
}

.kala-header p {
  margin: 15px 0 0;
  color: #6e695f;
  font-family: Georgia, serif;
  font-size: 17px;
}

.kala-user {
  display: grid;
  min-width: 210px;
  gap: 7px;
  text-align: right;
}

.kala-user a {
  color: #777267;
  font-size: 11px;
}

.kala-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .55fr);
  gap: 28px;
  align-items: start;
}

.kala-form-card,
.kala-library {
  padding: clamp(25px, 3.2vw, 48px);
  border: 1px solid var(--kala-line);
  background: rgba(255, 255, 255, .42);
}

.kala-library {
  position: sticky;
  top: 46px;
}

.kala-card-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 38px;
}

.kala-card-title h2 {
  margin: 7px 0 0;
  font-family: Georgia, serif;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -.035em;
}

.kala-card-title > a {
  padding-bottom: 4px;
  border-bottom: 1px solid;
  color: inherit;
  font-size: 11px;
  text-decoration: none;
}

.kala-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.kala-field {
  margin-bottom: 25px;
}

.kala-coupon-card {
  margin: 34px 0 30px;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid rgba(124, 47, 50, .22);
  background:
    radial-gradient(circle at 100% 0, rgba(183, 154, 102, .18), transparent 34%),
    rgba(255, 253, 249, .78);
}

.kala-coupon-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--kala-line);
}

.kala-coupon-heading span {
  color: var(--kala-rust);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .17em;
}

.kala-coupon-heading h3 {
  margin: 7px 0 0;
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 400;
}

.kala-coupon-heading p {
  max-width: 220px;
  margin: 0;
  color: #716a60;
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.kala-field label,
.kala-resources legend {
  display: block;
  margin-bottom: 9px;
  color: #625e55;
  font-size: 11px;
  font-weight: 600;
}

.kala-field label b {
  color: var(--kala-rust);
}

.kala-field input,
.kala-field select,
.kala-field textarea {
  width: 100%;
  max-width: none;
  padding: 13px 14px;
  border: 1px solid var(--kala-line);
  border-radius: 0;
  background: rgba(255, 255, 255, .62);
  box-shadow: none;
}

.kala-field-wide > input {
  padding: 15px 0;
  border-width: 0 0 1px;
  background: transparent;
  font-family: Georgia, serif;
  font-size: 27px;
}

.kala-uploads {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin: 8px 0 30px;
}

.kala-upload {
  display: flex;
  min-height: 205px;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px;
  border: 1px dashed rgba(19, 20, 17, .28);
  background: rgba(255, 255, 255, .28);
}

.kala-upload.has-file {
  border-style: solid;
  border-color: var(--kala-gold);
  background: rgba(183, 154, 102, .08);
}

.kala-upload .dashicons {
  width: auto;
  height: auto;
  margin-bottom: 18px;
  color: var(--kala-rust);
  font-size: 29px;
}

.kala-upload strong {
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 400;
}

.kala-upload small {
  min-height: 35px;
  margin: 6px 0 10px;
  color: #7b766c;
  font-size: 10px;
  line-height: 1.45;
}

.kala-file-name {
  width: 100%;
  min-height: 27px;
  overflow: hidden;
  color: var(--kala-rust);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kala-upload .button {
  margin-top: auto;
}

.kala-remove-media {
  margin-top: 8px;
  color: #8b3b3e !important;
  font-size: 10px !important;
}

.kala-resources {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.kala-resources label input {
  position: absolute;
  opacity: 0;
}

.kala-resources label span {
  display: block;
  padding: 10px 17px;
  border: 1px solid var(--kala-line);
  border-radius: 100px;
  cursor: pointer;
}

.kala-resources label input:checked + span {
  border-color: var(--kala-night);
  background: var(--kala-night);
  color: white;
}

.kala-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 38px;
  padding-top: 25px;
  border-top: 1px solid var(--kala-line);
}

.kala-actions .button {
  min-height: 44px;
  padding: 5px 21px;
  border-radius: 0;
}

.kala-actions .kala-primary {
  border-color: var(--kala-rust);
  background: var(--kala-rust);
}

.kala-product-list article {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--kala-line);
}

.kala-thumb {
  display: grid;
  width: 58px;
  height: 72px;
  place-items: center;
  overflow: hidden;
  background: #d8d1c4;
  color: var(--kala-rust);
}

.kala-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kala-product-list article > div:nth-child(2) {
  display: grid;
  gap: 5px;
}

.kala-product-list article span {
  color: var(--kala-rust);
  font-size: 8px;
  letter-spacing: .13em;
}

.kala-product-list article strong {
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.1;
}

.kala-product-list article small {
  color: #716c62;
}

.kala-product-actions {
  display: grid;
  gap: 7px;
  justify-items: end;
}

.kala-product-actions a {
  min-width: 70px;
  padding: 7px 11px;
  border: 1px solid rgba(19, 20, 17, .18);
  color: inherit;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.kala-product-actions .edit {
  border-color: var(--kala-rust);
  background: var(--kala-rust);
  color: #fff;
}

.kala-product-actions .delete {
  color: #8b342d;
}

.kala-product-actions .delete:hover {
  border-color: #8b342d;
  background: #8b342d;
  color: #fff;
}

.kala-empty {
  display: grid;
  min-height: 330px;
  place-content: center;
  padding: 25px;
  text-align: center;
}

.kala-empty > span {
  color: var(--kala-rust);
  font-size: 40px;
}

.kala-empty strong {
  margin-top: 14px;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 400;
}

.kala-empty p {
  max-width: 240px;
  color: #777267;
}

@media (max-width: 1050px) {
  .kala-layout {
    grid-template-columns: 1fr;
  }

  .kala-library {
    position: static;
  }
}

@media (max-width: 680px) {
  .kala-wrap {
    padding: 32px 15px 60px;
  }

  .kala-header {
    align-items: start;
    flex-direction: column;
  }

  .kala-user {
    text-align: left;
  }

  .kala-form-card,
  .kala-library {
    padding: 23px 18px;
  }

  .kala-fields,
  .kala-uploads {
    grid-template-columns: 1fr;
  }

  .kala-upload {
    min-height: 175px;
  }

  .kala-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
}

/* Experiencia editorial independiente en Mi cuenta */
.kala-score-editor .site-header,
.kala-score-editor #masthead,
.kala-score-editor .main-header-bar,
.kala-score-editor .ast-above-header-wrap,
.kala-score-editor .ast-below-header-wrap {
  display: none !important;
}

.kala-score-editor .site-content {
  padding-top: 36px;
  background:
    radial-gradient(circle at 10% 0, rgba(154, 68, 43, .08), transparent 28%),
    #f4f0e9;
}

.kala-score-editor .entry-header,
.kala-score-editor .woocommerce > h2,
.kala-score-editor .woocommerce-MyAccount-content > p {
  display: none !important;
}

.kala-score-editor .woocommerce {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.kala-score-editor .woocommerce-MyAccount-navigation {
  width: auto !important;
  padding: 12px;
  border: 1px solid #e1d8cd;
  border-radius: 18px;
  background: #fffdf9;
  box-shadow: 0 14px 36px rgba(48, 31, 20, .07);
}

.kala-score-editor .woocommerce-MyAccount-navigation ul {
  margin: 0;
}

.kala-score-editor .woocommerce-MyAccount-navigation li a {
  display: block;
  padding: 13px 15px;
  border-radius: 10px;
  color: #4b3b31;
  font-weight: 750;
  text-decoration: none;
}

.kala-score-editor .woocommerce-MyAccount-navigation li.is-active a {
  background: #9c432b;
  color: #fff;
}

.kala-score-editor .woocommerce-MyAccount-content {
  float: none !important;
  width: auto !important;
}

.kala-front-editor {
  padding: 0;
  overflow: hidden;
  border-color: #ded3c6;
  border-radius: 24px;
}

.kala-front-editor > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding: 34px 38px 30px;
  background: #241d19;
  color: #fff;
}

.kala-front-editor > header h2 {
  color: #fff;
  font-size: clamp(30px, 4vw, 46px);
}

.kala-front-editor > header p {
  margin-bottom: 0;
  color: #cfc4bb;
}

.kala-editor-badge {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #e8ddd5;
  font-size: 12px;
  font-weight: 750;
}

.kala-editor-badge i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #75c78a;
  box-shadow: 0 0 0 4px rgba(117,199,138,.12);
}

.kala-front-editor form {
  padding: 34px 38px 38px;
}

.kala-section-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 4px 0 20px;
  padding-bottom: 13px;
  border-bottom: 1px solid #e9e0d7;
}

.kala-section-heading:not(:first-of-type) {
  margin-top: 34px;
}

.kala-section-heading b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f0ded4;
  color: #9c432b;
  font-size: 12px;
}

.kala-section-heading div {
  display: flex;
  flex-direction: column;
}

.kala-section-heading strong {
  color: #30251f;
  font-size: 17px;
}

.kala-section-heading small {
  color: #8b7d73;
  font-weight: 400;
}

.kala-file-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.kala-front-file {
  min-height: 150px;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: border-color .2s, background .2s, transform .2s;
}

.kala-front-file:hover {
  transform: translateY(-2px);
  border-color: #a95b43;
  background: #fffaf4;
}

.kala-front-file.required {
  border-color: #bd765f;
  background: #fff9f4;
}

.kala-front-file .dashicons {
  width: auto;
  height: auto;
  color: #9c432b;
  font-size: 30px;
}

.kala-front-file small {
  color: #8b7d73;
  font-weight: 400;
}

.kala-front-file input[type="file"] {
  margin-top: 8px;
  padding: 8px;
  background: #fff;
  font-size: 12px;
}

@media (max-width: 850px) {
  .kala-score-editor .woocommerce {
    grid-template-columns: 1fr;
  }
  .kala-score-editor .woocommerce-MyAccount-navigation ul {
    display: flex;
    gap: 8px;
  }
  .kala-front-editor > header,
  .kala-front-editor form {
    padding: 25px 22px;
  }
  .kala-editor-badge {
    display: none;
  }
}

@media (max-width: 620px) {
  .kala-file-grid {
    grid-template-columns: 1fr;
  }
}

/* Neutraliza la maqueta lateral de WooCommerce/Astra para el editor */
body.kala-score-editor .site-content .ast-container,
body.kala-score-editor .site-content .site-main,
body.kala-score-editor .site-content article,
body.kala-score-editor .site-content .entry-content {
  width: 100% !important;
  max-width: 1280px !important;
}

body.kala-score-editor .site-content .ast-container {
  margin: 0 auto !important;
  padding: 28px 32px 70px !important;
}

body.kala-score-editor .entry-content > .woocommerce,
body.kala-score-editor .woocommerce {
  display: block !important;
  width: 100% !important;
  max-width: 1180px !important;
  margin: 0 auto !important;
}

body.kala-score-editor .woocommerce-MyAccount-navigation {
  display: none !important;
}

body.kala-score-editor .woocommerce-MyAccount-content {
  display: block !important;
  float: none !important;
  clear: both !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

body.kala-score-editor .kala-front-editor {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 1100px !important;
  min-width: 0 !important;
  margin: 0 auto 40px !important;
}

body.kala-score-editor .kala-front-editor form,
body.kala-score-editor .kala-front-grid,
body.kala-score-editor .kala-file-grid {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
}

.kala-editor-session {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.kala-editor-session > a {
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #fff !important;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none !important;
}

.kala-editor-session > a:hover {
  background: #fff;
  color: #241d19 !important;
}

@media (max-width: 700px) {
  body.kala-score-editor .site-content .ast-container {
    padding: 16px 12px 45px !important;
  }
  .kala-front-editor > header {
    flex-direction: column;
  }
  .kala-editor-session {
    width: 100%;
    justify-content: space-between;
  }
  .kala-coupon-heading {
    align-items: start;
    flex-direction: column;
  }
  .kala-coupon-heading p {
    max-width: none;
    text-align: left;
  }
}


/* Panel 1.8: campos de archivo adaptables */
.kala-uploads { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.kala-upload { min-width: 0; overflow: hidden; }
.kala-upload input[type="file"] { display: block; width: 100%; max-width: 100%; margin-top: 18px; overflow: hidden; font-size: 12px; }
.kala-gallery-upload { grid-column: 1 / -1; }
@media (max-width: 782px) {
  body.toplevel_page_kalamusic-partituras #wpcontent { padding-left: 0; }
  .kala-wrap { padding-inline: 16px; }
  .kala-layout { grid-template-columns: minmax(0, 1fr); }
  .kala-form-card, .kala-library { min-width: 0; }
  .kala-fields, .kala-uploads { grid-template-columns: minmax(0, 1fr); }
  .kala-gallery-upload { grid-column: auto; }
}
