/* Vistaprint-Style Customization Page */

.customizer-wrapper {
    display: flex;
    height: calc(100vh - 80px);
    background-color: #f5f5f5;
}

/* Left Sidebar */
.customizer-sidebar {
    width: 320px;
    background-color: var(--primary-white);
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-section {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section h3 {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-black);
    margin-bottom: 15px;
}

/* Product List */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    background-color: var(--primary-white);
}

.product-item:hover {
    border-color: var(--primary-red);
    background-color: rgba(204, 0, 0, 0.05);
}

.product-item.active {
    border-color: var(--primary-red);
    background-color: rgba(204, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(204, 0, 0, 0.2);
}

.product-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.product-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-black);
    margin-bottom: 4px;
}

.product-info .price {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-red);
}

/* Tool Buttons */
.tool-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background-color: var(--primary-black);
    color: var(--primary-white);
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tool-btn:hover {
    background-color: var(--primary-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tool-btn i {
    font-size: 16px;
}

/* Color Grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.color-swatch.active {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.3);
}

.color-swatch.active::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-white);
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

/* Size Buttons */
.size-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.size-btn {
    padding: 10px;
    background-color: var(--primary-white);
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.size-btn:hover {
    border-color: var(--primary-red);
    background-color: rgba(204, 0, 0, 0.05);
}

.size-btn.active {
    border-color: var(--primary-red);
    background-color: var(--primary-red);
    color: var(--primary-white);
}

/* Quantity Control */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    background-color: var(--primary-black);
    color: var(--primary-white);
    border: none;
    border-radius: 4px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.qty-btn:hover {
    background-color: var(--primary-red);
}

#quantity {
    flex: 1;
    height: 40px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
}

/* Main Preview Area */
.customizer-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    position: relative;
}

/* View Controls */
.view-controls {
    display: flex;
    gap: 10px;
    padding: 20px;
    background-color: var(--primary-white);
    border-bottom: 1px solid #e0e0e0;
}

.view-btn {
    flex: 1;
    padding: 12px 20px;
    background-color: var(--primary-white);
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.view-btn:hover {
    border-color: var(--primary-red);
    background-color: rgba(204, 0, 0, 0.05);
}

.view-btn.active {
    border-color: var(--primary-red);
    background-color: var(--primary-red);
    color: var(--primary-white);
}

/* Canvas Wrapper */
.canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #fafafa;
    position: relative;
}

.canvas-container {
    position: relative;
    cursor: crosshair;
}

#product-canvas {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* Zoom Lens */
.zoom-lens {
    position: absolute;
    border: 3px solid var(--primary-red);
    width: 150px;
    height: 150px;
    pointer-events: none;
    display: none;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(204, 0, 0, 0.5);
    z-index: 10;
}

/* Zoom Result Window */
.zoom-result {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    height: 400px;
    border: 3px solid var(--primary-red);
    background-color: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: none;
    z-index: 1000;
    border-radius: 8px;
}

.zoom-result::before {
    content: "🔍 Zoomed View";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--primary-black);
    color: white;
    padding: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    z-index: 1;
}

.zoom-result canvas {
    position: absolute;
    top: 40px;
    left: 0;
}

/* Canvas Controls */
.canvas-controls {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background-color: var(--primary-white);
    border-top: 1px solid #e0e0e0;
    justify-content: center;
}

.canvas-ctrl-btn {
    width: 44px;
    height: 44px;
    background-color: var(--primary-black);
    color: var(--primary-white);
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-ctrl-btn:hover {
    background-color: var(--primary-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.canvas-ctrl-btn:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .customizer-sidebar {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .customizer-wrapper {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .customizer-sidebar {
        width: 100%;
        height: auto;
        max-height: none;
        order: 2;
        padding: 15px;
    }

    .customizer-main {
        height: 70vh;
        min-height: 500px;
        order: 1;
    }

    .canvas-wrapper {
        padding: 10px;
        min-height: 400px;
    }

    .canvas-container {
        width: 100% !important;
        height: 100% !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #product-canvas {
        max-width: 95vw !important;
        max-height: 60vh !important;
        width: auto !important;
        height: auto !important;
    }

    .sidebar-section {
        padding: 12px;
        margin-bottom: 10px;
    }

    .sidebar-section h3 {
        font-size: 1rem;
    }

    .product-options {
        flex-wrap: wrap;
        gap: 8px;
    }

    .product-option {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .size-buttons {
        flex-wrap: wrap;
        gap: 6px;
    }

    .size-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-width: 45px;
    }

    .tool-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }

    .tool-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }

    .color-swatches {
        gap: 8px;
    }

    .color-swatch {
        width: 35px;
        height: 35px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .action-buttons .btn {
        width: 100%;
    }

    .canvas-controls {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px;
    }

    .canvas-ctrl-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .view-buttons {
        gap: 8px;
    }

    .view-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .product-color-picker {
        padding: 10px;
    }

    .color-option {
        width: 35px;
        height: 35px;
        margin: 4px;
    }

    .price-display {
        font-size: 1.3rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .customizer-main {
        height: 65vh;
        min-height: 450px;
    }

    .canvas-wrapper {
        padding: 5px;
        min-height: 380px;
    }

    #product-canvas {
        max-width: 98vw !important;
        max-height: 55vh !important;
    }

    .customizer-sidebar {
        padding: 10px;
    }

    .sidebar-section {
        padding: 10px;
    }

    .tool-btn {
        flex: 1 1 100%;
    }

    .product-option {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .size-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
        min-width: 40px;
    }

    .color-swatch {
        width: 30px;
        height: 30px;
    }

    .color-option {
        width: 30px;
        height: 30px;
        margin: 3px;
    }

    .canvas-ctrl-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .view-controls {
        padding: 10px;
    }

    .view-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Scrollbar Styling */
.customizer-sidebar::-webkit-scrollbar {
    width: 8px;
}

.customizer-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.customizer-sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.customizer-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-red);
}
