.bottleModeling {
    min-height: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 24px;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 45%, #ecfeff 100%);
}

.bottleModeling * {
    box-sizing: border-box;
}

.bottleModeling .bd-container {
    max-width: 1400px;
    margin: 0 auto;
}

.bottleModeling .bd-header {
    margin-bottom: 16px;
}

.bottleModeling .bd-title {
    font-size: 28px;
    line-height: 1.2;
    margin: 0 0 6px 0;
    font-weight: 800;
    color: #0f172a;
}

.bottleModeling .bd-subtitle {
    margin: 0;
    font-size: 14px;
    color: #475569;
}

.bottleModeling .bd-top-bar,
.bottleModeling .bd-preview-card,
.bottleModeling .bd-control-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 26px rgba(2, 6, 23, 0.08);
}

.bottleModeling .bd-top-bar {
    padding: 16px;
    margin-bottom: 16px;
}

.bottleModeling .bd-selection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.bottleModeling .bd-selection-group .bd-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #334155;
    margin-bottom: 10px;
}

.bottleModeling .bd-button-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.bottleModeling .bd-btn {
    appearance: none;
    border: 1px solid transparent;
    background: #f1f5f9;
    color: #334155;
    border-radius: 12px;
    padding: 12px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease, border-color .12s ease;
    line-height: 1.1;
    min-height: 44px;
    user-select: none;
}

.bottleModeling .bd-btn:hover {
    background: #e2e8f0;
}

.bottleModeling .bd-btn:active {
    transform: translateY(1px);
}

.bottleModeling .bd-btn.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.25);
}

.bottleModeling .bd-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.bottleModeling .bd-main-grid {
    display: grid;
    grid-template-columns: minmax(520px, 1fr) minmax(360px, 420px);
    gap: 16px;
    align-items: start;
}

.bottleModeling .bd-preview-card {
    padding: 14px;
    height: calc(100vh - 280px);
    min-height: 520px;
    max-height: 640px;
}

.bottleModeling .bd-preview-card { height: 100%; }

.bottleModeling .bd-preview-area {
    position: relative;
    isolation: isolate;
    height: 100%;
    min-height: 520px;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottleModeling .bd-preview-area.is-3d {
    display: block;
}

.bottleModeling .bd-preview-area.is-original{
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottleModeling .bd-preview-area.is-original img[data-el="bottleImage"]{
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    position: static !important;
}

.bottleModeling .bd-bottle-container {
    position: relative;
    z-index: 1;
}

.bottleModeling .bd-preview-3d-host {
    position: absolute;
    inset: 0;
    display: none;
    overflow: hidden;
    z-index: 2;
}

.bottleModeling .bd-preview-3d-host canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.bottleModeling .bd-preview-loading {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(2px);
    z-index: 30;
    pointer-events: none;
}

.bottleModeling .bd-preview-loading.is-active {
    display: flex;
}

.bottleModeling .bd-preview-loading__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.bottleModeling .bd-preview-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(0, 0, 0, 0.12);
    border-top-color: rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    animation: bdPreviewSpin 0.8s linear infinite;
}

.bottleModeling .bd-preview-loading__text {
    font-size: 14px;
    line-height: 1.2;
    color: #333;
    text-align: center;
}

@keyframes bdPreviewSpin {
    to {
        transform: rotate(360deg);
    }
}

.bottleModeling .bd-preview-area.is-original .bd-bottle-container{
    width: 100% !important;
    height: 100% !important;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottleModeling #bottleImage {
    position: absolute;
    top: 0;
    left: 0;
}

.bottleModeling .bd-tag-container {
    position: absolute;
    left: 0;
}

.bottleModeling .bd-label-layer {
    position: absolute;
    top: 0;
}

.bottleModeling .bd-label-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.bottleModeling .bd-label-bg {
    position: absolute;
    inset: 0;
    border-radius: 4px;
    background: #2e6cf6;
}

.bottleModeling .bd-custom-label {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
}

.bottleModeling .bd-zoom-indicator {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 3;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(226, 232, 240, 1);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    box-shadow: 0 10px 18px rgba(2, 6, 23, .08);
}

.bottleModeling .bd-controls-col {
    height: calc(100vh - 280px);
    min-height: 520px;
    max-height: 640px;
    overflow-y: auto;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bottleModeling .bd-control-card {
    padding: 14px;
}

.bottleModeling .bd-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.bottleModeling .bd-card-title {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bottleModeling .bd-recommendation {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.bottleModeling .bd-icon {
    color: #0f172a;
}

.bottleModeling .bd-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 14px;
    transition: border-color .12s ease, background .12s ease;
    background: #ffffff;
}

.bottleModeling .bd-upload-area:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.bottleModeling .bd-upload-area.disabled {
    opacity: .55;
    background: #f8fafc;
    border-color: #e5e7eb;
    pointer-events: none;
}

.bottleModeling .bd-upload-label {
    display: block;
    text-align: center;
    cursor: pointer;
}

.bottleModeling .bd-upload-icon {
    display: block;
    margin: 0 auto 6px auto;
    color: #64748b;
}

.bottleModeling .bd-upload-text {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.bottleModeling .bd-upload-status {
    margin: 6px 0 0 0;
    font-size: 12px;
    font-weight: 800;
    color: #2563eb;
}

.bottleModeling [data-el="labelModeButtons"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.bottleModeling [data-el="labelModeButtons"] .bd-btn {
    min-height: 42px;
    text-align: center;
}

.bottleModeling .bd-btn-mode.active {
    background: #2563eb;
    color: #fff;
}

.bottleModeling .bd-zoom-controls {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bottleModeling .bd-slider-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bottleModeling .bd-slider-label {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
}

.bottleModeling .bd-slider {
    width: 100%;
    accent-color: #111827;
}

.bottleModeling .bd-color-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.bottleModeling .bd-color-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
}

.bottleModeling .bd-color-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.bottleModeling .bd-color-swatch {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    overflow: hidden;
}

.bottleModeling .bd-color-picker {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.bottleModeling .bd-color-preview {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    background: #2e6cf6;
    pointer-events: none;
}

.bottleModeling .bd-color-text {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #0f172a;
    outline: none;
}

.bottleModeling .bd-color-text:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.bottleModeling .bd-btn-add {
    background: #16a34a;
    color: #fff;
    border-color: transparent;
    padding: 8px 10px;
    min-height: 34px;
    border-radius: 10px;
    font-size: 12px;
}

.bottleModeling .bd-btn-add:hover {
    background: #15803d;
}

.bottleModeling .bd-text-lines {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.bottleModeling .bd-line-row {
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    gap: 10px;
    align-items: center;
}

.bottleModeling .bd-line-select {
    height: 36px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: #f1f5f9;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.bottleModeling .bm-previewCard,
.bottleModeling .bottleWrapper,
.bottleModeling .bottle,
.bottleModeling .bd-preview-card,
.bottleModeling .bd-bottle-container {
    overflow: visible !important;
}

.bottleModeling .bd-line-select.active {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.22);
}

.bottleModeling .bd-line-input {
    height: 36px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    padding: 0 10px;
    font-size: 12px;
    outline: none;
}

.bottleModeling .bd-line-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.bottleModeling .bd-line-remove {
    height: 36px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: #fee2e2;
    color: #dc2626;
    cursor: pointer;
    font-weight: 900;
}

.bottleModeling .bd-line-remove:hover {
    background: #fecaca;
}

.bottleModeling .bd-position-controls {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.bottleModeling .bd-position-label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: #334155;
    margin-bottom: 10px;
}

.bottleModeling .bd-position-grid {
    display: grid;
    grid-template-columns: 1fr 64px 1fr;
    gap: 10px;
    align-items: center;
}

.bottleModeling .bd-btn-position {
    height: 40px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f1f5f9;
    cursor: pointer;
}

.bottleModeling .bd-btn-position:hover {
    background: #e2e8f0;
}

.bottleModeling .bd-btn-reset {
    background: #e5e7eb;
    font-size: 12px;
    font-weight: 800;
}

.bottleModeling .bd-reset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.bottleModeling .bd-btn-reset-label {
    background: #f1f5f9;
    border: 1px solid #e5e7eb;
    color: #334155;
}

.bottleModeling .bd-btn-reset-all {
    background: #dc2626;
    color: #fff;
}

.bottleModeling .bd-btn-reset-all:hover {
    background: #b91c1c;
}

@media (max-width: 1100px) {
    .bottleModeling .bd-main-grid {
        grid-template-columns: 1fr;
    }

    .bottleModeling .bd-preview-card,
    .bottleModeling .bd-controls-col {
        height: auto;
        max-height: none;
    }

    .bottleModeling .bd-controls-col {
        overflow: visible;
        padding-right: 0;
    }
}

@media (max-width: 820px) {
    .bottleModeling {
        padding: 14px;
    }

    .bottleModeling .bd-selection-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .bottleModeling [data-el="labelModeButtons"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.bottleModeling .bm-testFace {
    border-radius: 0 !important;
}

.bottleModeling .bm-testLine {
    pointer-events: none;
}

.bd-btn {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.75);
  color: #0f172a;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 80ms ease,
    color 160ms ease;
  backdrop-filter: blur(6px);
}

.bd-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.bd-btn:active {
  transform: translateY(1px);
}

.bd-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18), 0 6px 18px rgba(15, 23, 42, 0.10);
  border-color: rgba(37, 99, 235, 0.35);
}

.bd-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.bd-button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.bd-selection-group .bd-button-grid,
.bd-control-card .bd-button-grid {
  padding: 10px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.035);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.bd-btn-select {
  background: rgba(255, 255, 255, 0.70);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: none;
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  min-height: 44px;
}

.bd-btn-select:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.14);
}

.bd-btn-select.active {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.10),
    0 0 0 4px rgba(37, 99, 235, 0.12);
  color: #0b1b3a;
}

.bd-btn-mode {
  text-align: center;
  min-height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.60);
}

.bd-btn-mode.active {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.10),
    0 0 0 4px rgba(37, 99, 235, 0.12);
}

.bd-btn-mode:disabled {
  background: rgba(248, 250, 252, 0.9);
  border-color: rgba(15, 23, 42, 0.06);
  color: rgba(15, 23, 42, 0.35);
}

.bd-btn-add {
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.18);
}

.bd-btn-add:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.28);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}

.bd-btn-reset-all {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.18);
  color: #7f1d1d;
}

.bd-btn-reset-all:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.28);
}

.bd-btn-reset-label {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.10);
}

.bd-btn-position {
  background: rgba(15, 23, 42, 0.035);
  border-color: rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  min-height: 40px;
}

.bd-btn-position:hover {
  background: rgba(255, 255, 255, 0.95);
}

.bd-top-bar .bd-btn-select {
  padding: 12px 16px;
  border-radius: 16px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.bottleModeling [data-el="bottleSizeButtons"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.bottleModeling [data-el="bottleSizeButtons"] .bd-btn-select {
    padding: 10px 8px;
    min-height: 40px;
    font-size: 12px;
    text-align: center;
}

:root {
  --bd-line-h: 52px;
  --bd-line-r: 16px;
}

.bd-line-row{
  display:grid;
  grid-template-columns: 64px 1fr 56px;
  gap: 12px;
  align-items: center;
}

.bd-line-select{
  height: var(--bd-line-h);
  width: 64px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: var(--bd-line-r);
  padding: 0;
  line-height: 1;
}

.bd-line-input{
  height: var(--bd-line-h);
  border-radius: var(--bd-line-r);
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.bd-line-remove{
  height: var(--bd-line-h);
  width: 40px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: var(--bd-line-r);
  padding: 0;
}

.bd-line-select,
.bd-line-input,
.bd-line-remove{
  line-height: 1;
}

@media (max-width: 520px){
  :root { --bd-line-h: 48px; --bd-line-r: 14px; }
  .bd-line-row{ grid-template-columns: 56px 1fr 48px; }
  .bd-line-select{ width: 56px; }
  .bd-line-remove{ width: 48px; }
}

.bd-savebar,
.bottleModeling .botmod-actions {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding: 6px 0;
}

.bd-btn-save {
    height: 48px;
    padding: 0 24px;
    background: #16a34a;
    color: #ffffff;
    border-color: #15803d;
}

.bd-btn-save:hover {
    background: #15803d;
}

.bd-save-status {
    font-size: 13px;
    opacity: 0.85;
}

.bottleModeling .bd-qty-wrap,
.bottleModeling .botmod-qty {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 90px;
}

.bottleModeling .bd-qty-label {
    margin: 0;
    font-size: 11px;
}

.bottleModeling .bd-qty-input {
    height: 48px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    width: 100%;
}

.bottleModeling .bd-btn-add-basket {
    height: 48px;
    padding: 0 24px;
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
}

.bottleModeling .bd-btn-add-basket:hover {
    background: #1d4ed8;
}

.bottleModeling .bd-basket-status {
    font-size: 13px;
    color: #334155;
}

.bottleModeling .botmod-status {
    align-self: center;
    color: #777;
}

.bottleModeling .bd-basket-status a {
    color: #2563eb;
    text-decoration: underline;
}
