@charset "UTF-8";
/*
 * Custom Label Maker — Designer Styles
 * Developed by Mariano de Iriondo <mariano@gorilion.com> — Gorilion
 *
 * Dos variables inyectadas dinámicamente por el plugin (wp_add_inline_style):
 *   --bl-primary    Color principal: botones, bordes activos, headings
 *   --bl-secondary  Color neutro:    pasos inactivos/completados del wizard
 *
 * Todo lo demás (font-family, font-size base, link colors, button shape)
 * lo hereda del theme activo para no verse descolocado.
 */

:root {
  --bl-primary:   #99293e;
  --bl-secondary: #e6dbc5;
  --sw-anchor-default-primary-color: var(--bl-secondary) !important;
  --sw-anchor-active-primary-color:  var(--bl-primary)   !important;
  --sw-anchor-done-primary-color:    var(--bl-secondary) !important;
  --sw-progress-color:               var(--bl-primary)   !important;
}

/* ──────────────────────────────────────────────
   SmartWizard overrides
────────────────────────────────────────────── */
#smartwizard .tab-content {
  height: unset !important;
}

/* Wizard step text: auto-contrast based on background color */
#smartwizard .nav-link {
  color: var(--bl-secondary-text) !important;
}
#smartwizard .nav-link.active {
  color: var(--bl-primary-text) !important;
}
#smartwizard .nav-link.done {
  color: var(--bl-secondary-text) !important;
}

/* The step number bubble inherits the same contrast logic */
#smartwizard .nav-link.done .num,
#smartwizard .nav-link.active .num {
  color: var(--bl-primary-text) !important;
}
#smartwizard .nav-link .num {
  color: var(--bl-secondary-text) !important;
}

.hidden {
  display: none;
}

.disabled {
  pointer-events: none;
  filter: grayscale(1);
}

/* ──────────────────────────────────────────────
   Mobile notice
────────────────────────────────────────────── */
.bl-mobile-notice {
  display: none;
}

@media (max-width: 768px) {
  .bl-mobile-notice {
    display: block;
    padding: 24px;
    text-align: center;
  }

  #smartwizard {
    display: none;
  }
}

/* ──────────────────────────────────────────────
   Step 1 — Product grid
────────────────────────────────────────────── */
#smartwizard .bottle-loop {
  display: grid;
  padding: 32px 0 24px;
  gap: 20px;
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  #smartwizard .bottle-loop {
    grid-template-columns: repeat(2, 1fr);
  }
}

.bottle-loop .entry {
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s ease;
}

.bottle-loop .entry:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
}

/* Fixed-height image area — all cards same height */
.bottle-loop .entry .image {
  width: 100%;
  height: 210px;
  background: #f6f6f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 16px;
  box-sizing: border-box;
}

.bottle-loop .entry img {
  max-height: 178px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ──────────────────────────────────────────────
   Step 2 — Label grid
────────────────────────────────────────────── */
.label-loop {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.label-loop .label-entry {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  position: relative;
  padding: 16px;
  flex-basis: calc(25% - 32px);
}

.label-loop .label-entry img {
  max-height: 250px;
  border: 3px solid transparent;
  transition: border-color 0.2s ease-in-out;
}

#smartwizard .label-select {
  order: 3;
}

#smartwizard .label-select:hover img {
  border-color: var(--bl-primary);
}

/* ──────────────────────────────────────────────
   Hover border (shared selection indicator)
────────────────────────────────────────────── */
#smartwizard .hover-border {
  position: absolute;
  inset: 0;
  border: 3px solid var(--bl-primary);
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  opacity: 0;
}

.label-entry.active .hover-border,
.entry.active .hover-border,
#smartwizard .label-entry .label-select:hover + .hover-border,
#smartwizard .entry:hover .hover-border {
  opacity: 1 !important;
}

/* ──────────────────────────────────────────────
   Product card info
────────────────────────────────────────────── */
#smartwizard .price,
#smartwizard p,
#smartwizard .product-content,
#smartwizard .product-title {
  margin-bottom: 8px;
}

#smartwizard .label-name {
  line-height: 0.9;
}

/* Titles inherit font-family from theme; only set relative size */
#smartwizard .label-name,
#smartwizard .product-title {
  font-size: 1.05em;
  text-transform: uppercase;
  line-height: 1.3;
  margin-bottom: 6px;
}

#smartwizard .entry .pricing {
  display: flex;
  flex-direction: column;
}

/* Info fills remaining card height after image */
#smartwizard .info {
  background: #fff;
  padding: 14px 16px 16px;
  flex: 1;
  text-align: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Truncate description to 2 lines */
#smartwizard .product-content {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.82em;
  color: #666;
  line-height: 1.4;
  margin-bottom: 8px;
}

/* Price */
#smartwizard .price {
  font-size: 0.92em;
  font-weight: 600;
  color: var(--bl-primary);
  margin-bottom: 10px;
}

/* Select button always at bottom of card */
#smartwizard .bottle-select {
  margin-top: auto;
  align-self: stretch;
  text-align: center;
}

/* ──────────────────────────────────────────────
   Step 3 — Canvas designer
────────────────────────────────────────────── */
#smartwizard .wine-label-maker {
  display: flex;
  align-items: flex-start;
  gap: 22px;
}

/* Canvas display dimensions are set dynamically by JS (resizeCanvas).
   Only the border is defined here; no fixed width/height. */
#smartwizard canvas {
  border: 1px solid #666;
  display: block;
}

/* ──────────────────────────────────────────────
   Bottle mockup preview (step 3)
────────────────────────────────────────────── */
#bl-bottle-preview-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.bl-preview-caption {
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
  margin: 0;
}

#bottle-preview {
  display: block;
  border: 1px solid #ddd;
}

.label-maker-sidebar {
  flex-grow: 1;
}

.controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.controls > * {
  width: 100%;
}

.text-input-wrapper,
.image-input-wrapper {
  background: rgba(255, 255, 255, 0.8);
  padding: 24px 18px;
}

.label-maker-sidebar .container {
  max-width: 365px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  gap: 16px;
  flex-direction: column;
}

/* Section headings inside the designer inherit font from theme */
#smartwizard .label-maker-heading {
  font-size: 1.3em;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: var(--bl-primary);
  border-bottom: 2px solid var(--bl-primary);
  padding-inline: 8px;
  padding-bottom: 8px;
}

/* ──────────────────────────────────────────────
   Buttons — inherit shape/font from theme,
   only enforce color and layout role
────────────────────────────────────────────── */
#smartwizard .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: unset;
}

#smartwizard .move-button {
  padding: 10px !important;
}

/* Override only background + text color; everything else from theme */
#smartwizard button,
#smartwizard a.button {
  background: var(--bl-primary);
  color: var(--bl-primary-text);
  border-color: var(--bl-primary);
  cursor: pointer;
  padding: 10px 22px !important;
}

#smartwizard button:hover,
#smartwizard a.button:hover {
  background: var(--bl-primary);
  opacity: 0.88;
}

#smartwizard .submission {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ──────────────────────────────────────────────
   Controls layout
────────────────────────────────────────────── */
#smartwizard .horizontal-container {
  display: flex;
  flex-direction: row;
  gap: 32px;
  align-items: center;
  width: 100%;
  justify-content: center;
}

.scaling {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
  grid-template-areas:
    "nil1 up   nil2"
    "left center right"
    "nil3 down  nil4";
}

#move-left    { grid-area: left;   }
#move-right   { grid-area: right;  }
#move-up      { grid-area: up;     }
#move-down    { grid-area: down;   }
#rotate-image { grid-area: center; }

#move-left,
#move-right,
#move-up,
#move-down {
  padding: 0;
}

.image-container {
  width: 100%;
  display: flex;
  justify-content: space-between;
}

.image-picker {
  display: flex;
  align-items: center;
  flex-direction: column;
}

/* ──────────────────────────────────────────────
   Text settings panel
────────────────────────────────────────────── */
#text-input {
  width: 100%;
}

#font-size {
  width: 8ch;
}

#smartwizard .text-settings {
  display: flex;
  width: 100%;
  justify-content: space-between;
}

#smartwizard .input-wrapper {
  display: flex;
  flex-direction: column;
}

.text-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}

/* ──────────────────────────────────────────────
   Form inputs — inherit font from theme
────────────────────────────────────────────── */
#smartwizard ::file-selector-button,
#smartwizard input[type="color"],
#smartwizard input[type="number"],
#smartwizard input[type="text"],
#smartwizard select {
  font-size: inherit;
  border-radius: 1px;
  border: solid 1px #ccc;
}

#smartwizard #quantity {
  width: 5ch;
  text-align: center;
}

/* Remove number input spinners */
#smartwizard input::-webkit-outer-spin-button,
#smartwizard input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#smartwizard input[type="number"] {
  -moz-appearance: textfield;
}

/* ──────────────────────────────────────────────
   Step 2 — Label filters (format + occasion)
────────────────────────────────────────────── */
.bl-label-filters {
  padding: 20px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bl-format-filter,
.bl-occasion-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bl-format-btn,
.bl-occasion-btn {
  padding: 6px 14px;
  border: 2px solid var(--bl-primary);
  background: transparent;
  color: var(--bl-primary);
  cursor: pointer;
  font-size: inherit;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

.bl-format-btn.active,
.bl-format-btn:hover,
.bl-occasion-btn.active,
.bl-occasion-btn:hover {
  background: var(--bl-primary);
  color: #fff;
}

/* Format badge on label cards */
.bl-format-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.bl-format-body { background: #e8f4fd; color: #1565c0; }
.bl-format-neck { background: #f3e5f5; color: #7b1fa2; }
.bl-format-back { background: #e8f5e9; color: #2e7d32; }

/* Bottle preview format badge */
#bl-label-format-badge {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #666;
  margin-top: 6px;
}

/* ──────────────────────────────────────────────
   Step 3 — Toolbar
────────────────────────────────────────────── */
.bl-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 16px;
}

.bl-toolbar-btn,
.bl-toolbar-btn:hover,
.bl-toolbar-btn:focus,
.bl-toolbar-btn:active,
.bl-toolbar-btn:disabled {
  font-weight: 700 !important;
  line-height: normal !important;
  letter-spacing: normal !important;
  padding: 6px 12px !important;
  background: #fff !important;
  color: var(--bl-primary) !important;
  border: 1px solid var(--bl-primary) !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  -moz-box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-filter: none !important;
  outline: none !important;
}

.bl-toolbar-btn::before,
.bl-toolbar-btn::after {
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  filter: none !important;
}

.bl-toolbar-btn:hover {
  background: var(--bl-secondary) !important;
  opacity: 1 !important;
}

.bl-toolbar-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ──────────────────────────────────────────────
   Collapsible panels
────────────────────────────────────────────── */
.bl-collapsible-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bl-collapsible-toggle:hover {
  opacity: 0.8;
}

.bl-chevron {
  margin-left: auto;
  transition: transform 0.2s;
}

/* ──────────────────────────────────────────────
   Saved designs drawer
────────────────────────────────────────────── */
.bl-saved-designs {
  margin-top: 24px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #ddd;
}

.bl-saved-designs h3 {
  margin: 0 0 12px;
  font-size: 1.1em;
  color: var(--bl-primary);
}

.bl-designs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bl-design-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  background: #fff;
}

.bl-design-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.9em;
}

.bl-design-card-info span {
  color: #888;
  font-size: 0.85em;
}

.bl-design-card-actions {
  display: flex;
  gap: 6px;
}

.bl-delete-btn {
  background: #dc3232 !important;
  border-color: #dc3232 !important;
  padding: 4px 8px !important;
}

/* ──────────────────────────────────────────────
   Corporate Mode header
────────────────────────────────────────────── */
.bl-corporate-header {
  text-align: center;
  padding: 28px 20px 8px;
}
.bl-corporate-header h2 {
  font-size: 1.6rem;
  color: var(--bl-primary);
  margin: 0 0 8px;
}
.bl-corporate-header p {
  color: #666;
  margin: 0;
}

/* ──────────────────────────────────────────────
   Rotate Device Overlay
────────────────────────────────────────────── */
.bl-rotate-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 999999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  padding: 24px;
}

.bl-rotate-overlay svg {
  color: var(--bl-primary, #99293e);
  overflow: visible;
}

.bl-rotate-phone {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: bl-rotate-phone-anim 2.5s ease-in-out infinite;
}

@keyframes bl-rotate-phone-anim {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(90deg); }
  75%  { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}

.bl-rotate-text {
  font-size: 1.1em;
  color: #333;
  max-width: 320px;
  margin: 0;
}

/* ──────────────────────────────────────────────
   Modals
────────────────────────────────────────────── */
.bl-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.bl-modal-box {
  background: #fff;
  padding: 32px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.bl-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent !important;
  border: none !important;
  color: #666 !important;
  font-size: 1.2em;
  cursor: pointer;
  line-height: 1;
}

/* ──────────────────────────────────────────────
   Print preview modal
────────────────────────────────────────────── */
.bl-print-modal-box {
  max-width: 95vw;
  width: auto;
  min-width: 320px;
}

#bl-print-canvas-wrap canvas {
  display: block;
  margin: 0 auto;
  border: 1px solid #ddd;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
