/**
 * Printess Editor - Frontend Styles
 */

/* Customize button */
.printess-button-container {
    margin: 10px 0;
}

.printess-customize-btn {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
}

.printess-customize-btn svg {
    flex-shrink: 0;
}

/* Editor container - fullscreen overlay */
.printess-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    background: #fff;
}

#printess-editor-wrapper {
    width: 100%;
    height: 100%;
}

#printess-editor-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* When editor is active, hide everything else */
body.printess-editor-active {
    overflow: hidden;
}

body.printess-editor-active > *:not(.printess-container):not(.printess-overlay) {
    /* Don't hide, let the fixed overlay cover them */
}

/* Loading overlay */
.printess-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.92);
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.printess-overlay-content {
    text-align: center;
}

.printess-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid #e9ecef;
    border-top-color: #2fb5d2;
    border-radius: 50%;
    animation: printess-spin 0.8s linear infinite;
}

@keyframes printess-spin {
    to {
        transform: rotate(360deg);
    }
}

.printess-overlay-content p {
    font-size: 16px;
    color: #495057;
    margin: 0;
}

/* Thumbnail preview */
.printess-thumbnail-preview {
    margin: 15px 0;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #f8f9fa;
    display: inline-block;
    text-align: center;
}

.printess-thumbnail-preview img {
    max-width: 200px;
    max-height: 200px;
    display: block;
    margin: 0 auto 10px;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

#printess-edit-design-btn {
    font-size: 13px;
}

/* Order customization display */
.printess-order-customizations {
    margin: 20px 0;
}

.printess-order-customizations h4 {
    margin-bottom: 15px;
}

.printess-order-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.printess-order-item {
    text-align: center;
    max-width: 180px;
}

.printess-order-thumb img {
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.printess-order-item-name {
    margin-top: 8px;
    font-size: 13px;
    color: #495057;
}

/* Cart thumbnail adjustments */
.product-line-grid .product-line-grid-left img[src*="printess"],
.cart-item img[src*="printess"] {
    object-fit: contain !important;
}
