/**
 * Artlook Ecommerce Modal Styles
 * 
 * Default styling for the EcommerceModal system.
 * Developers can override these styles in their own CSS.
 */

/* Modal Container */
.ecommerce-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    pointer-events: none;
}

.ecommerce-modal.ecommerce-modal-open {
    pointer-events: auto;
}

/* Modal Overlay */
.ecommerce-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 9998;
}

.ecommerce-modal-open .ecommerce-modal-overlay {
    opacity: 1;
}

/* Modal Panel */
.ecommerce-modal-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    background: #ffffff;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease;
}

/* Right-side panel (default) */
.ecommerce-modal-right .ecommerce-modal-panel {
    right: 0;
    transform: translateX(100%);
}

.ecommerce-modal-right.ecommerce-modal-open .ecommerce-modal-panel {
    transform: translateX(0);
}

/* Left-side panel */
.ecommerce-modal-left .ecommerce-modal-panel {
    left: 0;
    transform: translateX(-100%);
}

.ecommerce-modal-left.ecommerce-modal-open .ecommerce-modal-panel {
    transform: translateX(0);
}

/* Modal Header */
.ecommerce-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    background: transparent;
}

.ecommerce-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: inherit;
    color: inherit;
}

/* Modal Body */
.ecommerce-modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: inherit;
    color: inherit;
    line-height: inherit;
}

.ecommerce-modal-content {
    padding: 1.5rem;
}

/* Inherit host site styling */
.ecommerce-modal-panel {
    font-family: inherit;
    color: inherit;
}

.ecommerce-modal-panel * {
    font-family: inherit;
}

/* Modal Header Toolbar Container */
.ecommerce-modal-header > div:last-child {
    display: flex !important;
    gap: 5px !important;
    align-items: center !important;
    flex-direction: row !important;
    height: 30px !important;
}

/* Close Button */
.ecommerce-modal-close,
.ecommerce-panel-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    line-height: 1;
    transition: color 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.ecommerce-modal-close:hover,
.ecommerce-panel-close:hover {
    color: #666;
}

/* Toolbar Icons */
.ecommerce-toolbar-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.15s ease;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    position: relative;
}

.ecommerce-toolbar-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.ecommerce-toolbar-icon svg {
    display: block;
    vertical-align: middle;
}

.ecommerce-panel-close {
    line-height: 1 !important;
    vertical-align: middle;
}

/* Notification Fallback */
.ecommerce-notification-fallback {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ecommerce-notification-fallback.show {
    opacity: 1;
    transform: translateY(0);
}

.ecommerce-notification-fallback.error {
    background: #dc3545;
}

/* Responsive */
@media (max-width: 768px) {
    .ecommerce-modal-panel {
        width: 100% !important;
        max-width: 100% !important;
    }
}
