/* Layout principal */
.customizer-left-col {
    position: relative;
}
.customizer-right-col {
    position: sticky;
    top: 20px;
    align-self: flex-start;
}
@media (max-width: 991.98px) {
    .customizer-right-col {
        position: relative;
        top: 0;
    }
}

/* Canvas */
.customizer-canvas-container {
    position: relative;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}
.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.canvas-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 8px;
}
.canvas-loading-overlay.show {
    display: flex;
}
.canvas-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #FFE23B;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.product-base-image {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
}
.canvas-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 10 !important;
}
#fabricCanvas {
    position: absolute;
    top: 0;
    left: 0;
}

/* Tabs de diseño (legacy) */
.design-tabs .nav-link {
    color: #495057;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 10px 16px;
    font-weight: 500;
}
.design-tabs .nav-link:hover {
    border-color: #dee2e6;
    color: #2E2E2E;
}
.design-tabs .nav-link.active {
    color: #2E2E2E;
    border-color: #FFE23B;
    background: transparent;
}
.design-tabs .nav-link i {
    font-size: 1.1rem;
}
.tab-content-design {
    min-height: 180px;
}

/* Galería de diseños */
.design-gallery {
    max-height: 200px;
    overflow-y: auto;
}
.design-item {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 4px;
    transition: all 0.2s;
    position: relative;
}
.design-item:hover, .design-item.active {
    border-color: #FFE23B;
}
.design-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}
.design-item .btn-delete-design {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 50%;
    font-size: 10px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}
.design-item:hover .btn-delete-design {
    display: flex;
}
.public-design {
    opacity: 0.9;
}
.public-design:hover {
    opacity: 1;
}

/* Selectores de color y talla */
.color-option {
    cursor: pointer;
}
.color-swatch {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.color-swatch:hover {
    transform: scale(1.1);
    border-color: #adb5bd;
}
input[name="variant_color"]:checked + .color-swatch {
    border-color: #FFE23B;
    box-shadow: 0 0 0 2px rgba(255, 226, 59, 0.5);
    transform: scale(1.1);
}
.size-btn-custom {
    min-width: 44px;
    font-weight: 500;
    border-radius: 6px;
    padding: 6px 10px;
}
.btn-check:checked + .size-btn-custom,
.btn-check:checked + .btn-outline-secondary {
    background-color: #FFE23B !important;
    border-color: #FFE23B !important;
    color: #2E2E2E !important;
}
.btn-check:checked + .btn-outline-primary {
    background-color: #FFE23B !important;
    border-color: #FFE23B !important;
    color: #2E2E2E !important;
}

/* Checkbox */
.form-check-input:checked {
    background-color: #FFE23B;
    border-color: #FFE23B;
}
.form-check-input:focus {
    border-color: #FFE23B;
    box-shadow: 0 0 0 0.2rem rgba(255, 226, 59, 0.25);
}

/* Botón Agregar al Carrito */
.btn-add-to-cart {
    background-color: #e9ecef;
    border-color: #e9ecef;
    color: #6c757d;
    transition: all 0.3s ease;
}
.btn-add-to-cart:disabled {
    background-color: #e9ecef;
    border-color: #e9ecef;
    color: #6c757d;
    opacity: 1;
}
.btn-add-to-cart:not(:disabled) {
    background-color: #FFE23B;
    border-color: #FFE23B;
    color: #2E2E2E;
}
.btn-add-to-cart:not(:disabled):hover {
    background-color: #f5d526;
    border-color: #f5d526;
    color: #2E2E2E;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 226, 59, 0.4);
}

/* AI Tab styling */
.ai-tab-content {
    background: linear-gradient(135deg, rgba(255, 226, 59, 0.1) 0%, rgba(255, 215, 0, 0.15) 100%);
    border-radius: 8px;
    padding: 15px;
    position: relative;
}
.ai-tab-content .form-control:focus,
.ai-tab-content .form-select:focus {
    border-color: #FFE23B;
    box-shadow: 0 0 0 2px rgba(255, 226, 59, 0.25);
}
.btn-generate-ai {
    background: #FFE23B;
    border: none;
    color: #2E2E2E;
    font-weight: 600;
}
.btn-generate-ai:hover {
    background: #ffd700;
    color: #2E2E2E;
}

/* AI Generating Overlay */
.ai-generating-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
    color: #2E2E2E;
}
.ai-generating-overlay .spinner-border {
    color: #FFE23B !important;
    width: 3rem;
    height: 3rem;
}
.ai-generating-overlay p {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0;
}
.ai-generating-overlay small {
    color: #6c757d;
}

/* Style Cards */
.style-cards-container {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 12px;
}
.style-card {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}
.style-card:hover {
    border-color: #ffd700;
    background: #fffef5;
}
.style-card.selected {
    border-color: #FFE23B;
    background: linear-gradient(135deg, rgba(255, 226, 59, 0.15) 0%, rgba(255, 215, 0, 0.1) 100%);
    box-shadow: 0 2px 8px rgba(255, 226, 59, 0.3);
}
.style-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.style-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #6c757d;
}
.style-card.selected .style-card-icon {
    background: #FFE23B;
    color: #2E2E2E;
}
.style-card-preview {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #dee2e6;
}
.style-card-info {
    flex: 1;
    min-width: 0;
}
.style-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}
.style-card-desc {
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.style-card-examples {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}
.style-card.selected .style-card-examples {
    display: block;
}
.style-example-img {
    width: 55px;
    height: 55px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #dee2e6;
    transition: all 0.2s;
}
.style-example-img:hover {
    transform: scale(1.1);
    border-color: #FFE23B;
}
.style-card-no-style {
    background: #f8f9fa;
}
.style-card-no-style .style-card-icon {
    background: #e9ecef;
}

/* Price card */
.price-card {
    background: #f8f9fa;
    border-radius: 8px;
}
