/* WooCommerce Product Personalization - Frontend Editor Styles */

#wcpp-editor-modal.wcpp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#wcpp-editor-modal .wcpp-modal-content {
    background: #ffffff;
    width: 98vw;
    height: 95vh;
    max-width: none;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

#wcpp-editor-modal .wcpp-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
}

#wcpp-editor-modal .wcpp-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

#wcpp-editor-modal .wcpp-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s;
}

#wcpp-editor-modal .wcpp-modal-close:hover {
    color: #ef4444;
}

#wcpp-editor-modal .wcpp-modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#wcpp-editor-modal .wcpp-controls {
    width: 320px;
    padding: 24px;
    border-right: 1px solid #e5e7eb;
    background: #ffffff;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

#wcpp-editor-modal .wcpp-control-group h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

#wcpp-editor-modal .wcpp-control-group input[type="file"],
#wcpp-editor-modal .wcpp-control-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
}

#wcpp-editor-modal .wcpp-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

#wcpp-editor-modal .wcpp-btn:hover {
    background-color: #e5e7eb;
}

#wcpp-editor-modal .wcpp-btn-primary {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

#wcpp-editor-modal .wcpp-btn-primary:hover {
    background-color: #1d4ed8;
}

#wcpp-editor-modal .wcpp-canvas-container {
    flex: 1;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* No scrollbars ever */
    padding: 0;
    position: relative;
}

/* Ensure the canvas wrappers stay centered and white */
#wcpp-editor-modal .canvas-container {
    margin: 0 auto;
    box-shadow: none;
    background: #ffffff;
}


#wcpp-editor-modal .wcpp-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    background: #f9fafb;
    gap: 12px;
}

.wcpp-loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #374151;
    z-index: 10;
}

.wcpp-progress-container {
    width: 200px;
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    margin-top: 10px;
    overflow: hidden;
}

.wcpp-progress-bar {
    width: 0%;
    height: 100%;
    background: #2563eb;
    transition: width 0.2s;
}

.wcpp-progress-text {
    margin-top: 5px;
    font-size: 12px;
}

@media (max-width: 768px) {
    #wcpp-editor-modal .wcpp-modal-body {
        flex-direction: column-reverse;
    }
    #wcpp-editor-modal .wcpp-controls {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-top: 1px solid #e5e7eb;
    }
    #wcpp-editor-modal .wcpp-canvas-container {
        padding: 20px;
    }
}

/* Canva-style Sidebar Layout */
#wcpp-editor-modal .wcpp-sidebar-nav {
    width: 76px;
    min-width: 76px;
    background-color: #111827;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 0;
    gap: 8px;
    z-index: 10;
    box-sizing: border-box;
    flex-shrink: 0;
    height: 100%;
}

#wcpp-editor-modal .wcpp-nav-btn {
    width: 66px;
    height: 60px;
    padding: 6px 2px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #9ca3af;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

#wcpp-editor-modal .wcpp-nav-btn:hover {
    color: #ffffff;
    background-color: #1f2937;
}

#wcpp-editor-modal .wcpp-nav-btn.active {
    color: #ffffff;
    background-color: #374151;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

#wcpp-editor-modal .wcpp-nav-btn svg {
    width: 22px;
    height: 22px;
    display: block;
    margin: 0 auto;
    stroke: currentColor;
    flex-shrink: 0;
}

#wcpp-editor-modal .wcpp-nav-btn span {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.1;
    text-align: center;
    display: block;
    white-space: nowrap;
    color: inherit;
}

#wcpp-editor-modal .wcpp-sidebar-panels {
    width: 320px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    z-index: 5;
    overflow-y: auto;
}

#wcpp-editor-modal .wcpp-panel {
    display: none;
    padding: 24px;
    flex-direction: column;
    gap: 20px;
}

#wcpp-editor-modal .wcpp-panel.active {
    display: flex;
}

#wcpp-editor-modal .wcpp-panel h3 {
    margin: 0;
    font-size: 16px;
    color: #111827;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

/* Uploads & Grids */
.wcpp-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.wcpp-gallery-item {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.wcpp-gallery-item:hover {
    border-color: #2563eb;
}

/* Text Presets */
.wcpp-text-presets {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wcpp-text-preset {
    width: 100%;
    padding: 15px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    color: #111827;
    transition: background 0.2s;
}
.wcpp-text-preset:hover {
    background: #e5e7eb;
}

/* Shapes Preview */
.wcpp-shape-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.wcpp-shape-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.shape-preview {
    background: #374151;
}
.shape-rect { width: 40px; height: 40px; }
.shape-circle { width: 40px; height: 40px; border-radius: 50%; }
.shape-triangle { 
    width: 0; height: 0; 
    border-left: 20px solid transparent; 
    border-right: 20px solid transparent; 
    border-bottom: 40px solid #374151; 
    background: transparent;
}

/* Layers List */
.wcpp-layers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wcpp-layer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}
.wcpp-layer-actions {
    display: flex;
    gap: 4px;
}
.wcpp-layer-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
}
.wcpp-layer-btn:hover {
    background: #e5e7eb;
    color: #111827;
}
.wcpp-layer-btn.delete:hover {
    color: #ef4444;
}


.wcpp-gallery-item-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    cursor: pointer;
    background: #f3f4f6;
}

.wcpp-gallery-item-wrapper:hover {
    border-color: #2563eb;
}

.wcpp-gallery-item-wrapper img.wcpp-gallery-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.wcpp-upload-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.85);
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    z-index: 10;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.wcpp-gallery-item-wrapper:hover .wcpp-upload-delete-btn {
    opacity: 1;
    transform: scale(1);
}

.wcpp-upload-delete-btn:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    transform: scale(1.15) !important;
}


.wcpp-gallery-item-uploading {
    width: 100%;
    height: 100%;
    background: #e5e7eb;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #6b7280;
    padding: 10px;
    box-sizing: border-box;
}

.wcpp-gallery-item-uploading .wcpp-mini-progress-container {
    width: 100%;
    height: 6px;
    background: #d1d5db;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.wcpp-gallery-item-uploading .wcpp-mini-progress-bar {
    width: 0%;
    height: 100%;
    background: #2563eb;
    transition: width 0.2s;
}


.wcpp-colors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.wcpp-bg-color-btn {
    aspect-ratio: 1;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-size: 10px;
    transition: transform 0.1s;
}
.wcpp-bg-color-btn:hover {
    transform: scale(1.05);
}

/* ==========================================================================
   Modern Professional Cart & Order Personalization Card
   ========================================================================== */

/* Remove clumsy WooCommerce definition list layout for WCPP items */
.woocommerce-cart-form dl.variation dt.variation-CustomizedDesign,
.woocommerce-checkout dl.variation dt.variation-CustomizedDesign,
dt.variation-CustomizedDesign {
    display: none !important;
}

.woocommerce-cart-form dl.variation dd.variation-CustomizedDesign,
.woocommerce-checkout dl.variation dd.variation-CustomizedDesign,
dd.variation-CustomizedDesign {
    float: none !important;
    clear: both !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

.woocommerce-cart-form dl.variation dd.variation-CustomizedDesign p,
.woocommerce-checkout dl.variation dd.variation-CustomizedDesign p,
dd.variation-CustomizedDesign p {
    margin: 0 !important;
    padding: 0 !important;
}

/* Cart Customization Card */
.wcpp-cart-custom-card {
    margin-top: 8px;
    margin-bottom: 4px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: inline-block;
    width: auto;
    max-width: 280px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.wcpp-cart-custom-card:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.wcpp-cart-custom-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.wcpp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #0369a1;
    background: #e0f2fe;
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.wcpp-view-link {
    font-size: 11px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
    white-space: nowrap;
}

.wcpp-view-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.wcpp-thumb-link {
    display: block;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.wcpp-thumb-link:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.wcpp-cart-thumb {
    width: 100%;
    height: auto;
    max-height: 64px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

/* Canva-style Effects Cards & Action Bar */
.wcpp-canva-effects-grid .wcpp-canva-style-card,
.wcpp-canva-shape-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    outline: none;
}
.wcpp-canva-effects-grid .wcpp-canva-style-card:hover,
.wcpp-canva-shape-card:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}
.wcpp-canva-effects-grid .wcpp-canva-style-card.active,
.wcpp-canva-shape-card.active {
    border-color: #7d2ae8 !important;
    background: #fbf7ff !important;
}
.wcpp-canva-effects-grid .wcpp-canva-style-card span,
.wcpp-canva-shape-card span {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
}
.wcpp-canva-effects-grid .wcpp-canva-style-card.active span,
.wcpp-canva-shape-card.active span {
    color: #7d2ae8 !important;
}

/* Top Action Bar Buttons */
.wcpp-bar-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1e293b;
    padding: 0;
    transition: all 0.15s;
    outline: none;
}
.wcpp-bar-btn:hover {
    background: #f1f5f9;
}
.wcpp-bar-btn.active {
    background: #7d2ae8 !important;
    border-color: #7d2ae8 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(125, 42, 232, 0.35);
}
.wcpp-bar-btn.active svg {
    stroke: #ffffff !important;
}
.wcpp-bar-btn-labeled {
    height: 32px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #334155;
    padding: 0 10px;
    transition: all 0.15s;
    outline: none;
}
.wcpp-bar-btn-labeled:hover {
    background: #f1f5f9;
}
.wcpp-bar-btn-labeled.active-accent {
    background: #fbf7ff;
    border-color: #d8b4fe;
    color: #7d2ae8;
}
.wcpp-default-style-btn:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

.wcpp-filter-preset {
    transition: all 0.15s ease;
}
.wcpp-filter-preset:hover {
    border-color: #a855f7 !important;
    background: #faf5ff !important;
}
.wcpp-filter-preset.active {
    background: #f3e8ff !important;
    border-color: #7d2ae8 !important;
    color: #7d2ae8 !important;
    font-weight: 700 !important;
}


