/* Product Customize Page - Dark Theme */

.pyv-layout {
    background: #1a1a1a;
    color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* Top Section - Thumbnails and Upload */
.pyv-layout__top {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.pyv-section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    flex-basis: 100%;
}

.pyv-layout__thumbs {
    display: flex;
    gap: 12px;
    flex: 1;
}

.pyv-thumb {
    border: 2px solid #444;
    border-radius: 8px;
    padding: 10px;
    background: #2a2a2a;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    text-align: center;
    position: relative;
}

.pyv-thumb:hover {
    border-color: #9b59b6;
    transform: translateY(-2px);
}

.pyv-thumb.is-active {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}

.pyv-thumb .thumb-number {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #0073aa;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.pyv-thumb img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 8px;
    background: #1a1a1a;
}

.pyv-thumb .thumb-label {
    font-size: 11px;
    color: #ccc;
    display: block;
}

.pyv-thumb--empty {
    border-style: dashed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
    min-height: 120px;
}

.pyv-layout__upload {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pyv-layout__upload:hover {
    background: #005a87;
    transform: translateY(-2px);
}

/* Product Name Input */
.pyv-product-name {
    margin-bottom: 20px;
}

.pyv-product-name input {
    width: 100%;
    padding: 12px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
}

/* Body Section - Preview and Controls */
.pyv-layout__body {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

/* Preview Section */
.pyv-layout__preview-section {
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pyv-view-toggle {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-right: 20px;
}

.pyv-view-toggle button {
    background: #333;
    border: 1px solid #555;
    color: #fff;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pyv-view-toggle button.active {
    background: #0073aa;
    border-color: #0073aa;
}

.pyv-preview-wrapper {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px;
    align-items: center;
    width: 100%;
}

.pyv-view-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.view-thumb {
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #fff;
    font-size: 12px;
    transition: all 0.3s ease;
}

.view-thumb img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    border-radius: 4px;
}

.view-thumb span {
    font-size: 11px;
    color: #ccc;
}

.view-thumb--active,
.view-thumb:hover {
    border-color: #9b59b6;
    box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.3);
}

.pyv-preview-canvas {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    /* Keep a neutral background; T-shirt color is applied via image tint, not canvas bg */
    background: #1a1a1f;
}

/* Fabric.js canvas styling */
.pyv-preview-canvas canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
    display: block;
}

/* Printable Area Indicator */
.printable-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40%;
    height: 48%;
    border: 2px dashed rgba(155, 89, 182, 0.5);
    border-radius: 8px;
    pointer-events: none;
    z-index: 1;
    box-sizing: border-box;
}

.printable-area::before {
    content: 'Printable Area';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #9b59b6;
    background: #1a1a1a;
    padding: 2px 8px;
    border-radius: 3px;
}

/* Design Container (draggable and resizable) */
.design-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: auto;
    cursor: grab;
    z-index: 3;
    user-select: none;
    transition: cursor 0.2s;
}

.design-container:active {
    cursor: grabbing;
}

.preview-design {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
    object-fit: contain;
    user-select: none;
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #9b59b6;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: nwse-resize;
    z-index: 4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.resize-handle:hover {
    background: #8e44ad;
    transform: scale(1.2);
}

.resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 2px;
}

/* Controls Section */
.pyv-layout__controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pyv-control-section {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 20px;
}

.pyv-control-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #fff;
}

.pyv-control-group {
    margin-bottom: 15px;
}

.pyv-control-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #ccc;
}

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

.qty-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #555;
    background: #1a1a1a;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background: #2a2a2a;
}

.pyv-control-group input[type="number"],
.pyv-control-group input[type="text"] {
    width: 100%;
    padding: 10px;
    background: #1a1a1a;
    border: 1px solid #555;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
}

/* Design Size Controls */
.size-control-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.size-slider {
    flex: 1;
    height: 6px;
    background: #1a1a1a;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #9b59b6;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
}

.size-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #9b59b6;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
}

.size-value {
    min-width: 45px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #9b59b6;
}

.size-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.size-btn {
    flex: 1;
    padding: 8px 12px;
    background: #1a1a1a;
    border: 1px solid #555;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.size-btn:hover {
    background: #2a2a2a;
    border-color: #9b59b6;
}

.size-btn:active {
    transform: scale(0.95);
}

.control-help {
    font-size: 12px;
    color: #999;
    cursor: help;
    margin-left: 5px;
}

.help-text {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    line-height: 1.4;
}

/* Removed old checkbox-based view selector */

.pyv-size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.pyv-size-item {
    flex: 1;
    min-width: 50px;
    padding: 10px;
    background: #1a1a1a;
    border: 2px solid #555;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pyv-size-item:hover,
.pyv-size-item.selected {
    border-color: #0073aa;
    background: #0073aa;
}

.pyv-color-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.pyv-color-item {
    aspect-ratio: 1;
    border: 2px solid #555;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pyv-color-item:hover,
.pyv-color-item.selected {
    border-color: #fff;
    transform: scale(1.1);
}

.pyv-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.pyv-action-buttons button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pyv-btn-primary {
    background: #0073aa;
    color: #fff;
}

.pyv-btn-primary:hover {
    background: #005a87;
}

.pyv-btn-secondary {
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #555;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pyv-btn-secondary:hover {
    background: #333;
}

.pyv-btn-large {
    padding: 14px 24px;
    font-size: 16px;
}

/* Product Details Section */
.pyv-layout__summary {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 25px;
    margin-top: 24px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.pyv-layout__summary h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #fff;
}

.pyv-layout__summary p {
    line-height: 1.8;
    color: #ccc;
    font-size: 14px;
}

/* Similar Designs Section */
.similar-designs-section {
    margin-top: 40px;
    padding: 30px;
    background: #1a1a1a;
    border-radius: 12px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.similar-designs-section h3 {
    margin-bottom: 20px;
    color: #fff;
}

.similar-designs-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.similar-designs-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    flex: 1;
    padding: 10px 0;
}

.similar-design-item {
    min-width: 200px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.similar-design-item img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    margin: 10px 0;
}

.design-category {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.design-description {
    font-size: 12px;
    color: #ccc;
}

.carousel-nav {
    background: #2a2a2a;
    border: 1px solid #555;
    color: #fff;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-nav:hover {
    background: #333;
}

