/* Modal Bottom Sheet Overlay */
.dx-modal-bottomsheet {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.dx-modal-bottomsheet.active {
    display: block;
}

.dx-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dx-popup-close {
    position: absolute;
    top: 10px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: auto;
    height: auto;
    padding: 8px 20px;
    border: none;
    background: none;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 100002;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.2s ease, transform 0.2s ease;
}

.dx-popup-close:hover {
    background: none;
    transform: translateX(-50%) translateY(-2px);
}

.dx-close-text {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.dx-close-icon-detail {
    width: 24px;
    height: 24px;
    color: #ffffff;
}

.dx-modal-bottomsheet.active .dx-popup-close {
    opacity: 1;
}

.dx-close-icon-top {
    width: 20px;
    height: 20px;
    color: #ffffff;
}

.dx-modal-bottomsheet.active .dx-modal-overlay {
    opacity: 1;
}

/* Modal Sheet - FULL WIDTH */
.dx-modal-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 95vh;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.dx-modal-bottomsheet.active .dx-modal-sheet {
    transform: translateY(0);
}


/* 
.dx-modal-close {
    width: 36px;
    height: 36px;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
} 
*/


.dx-close-icon {
    width: 28px;
    height: 28px;
    color: #ffffff;
}

/* Modal Content */
.dx-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Loading State */
.dx-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.dx-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: dx-spin 0.8s linear infinite;
}

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

.dx-modal-loading p {
    margin: 0;
    color: #718096;
    font-size: 16px;
}

/* Error State */
.dx-modal-error {
    text-align: center;
    padding: 60px 20px;
}

.dx-error-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    color: #e53e3e;
}

.dx-error-message {
    margin: 0 0 24px 0;
    font-size: 16px;
    color: #e53e3e;
}

.dx-btn-retry {
    background: #667eea;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* Layout Structure */
.dx-modal-top-section {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    margin-bottom: 32px;
}

.dx-book-gallery {
    flex: 1;
    min-width: 300px;
    margin-bottom: 0 !important;
}

.dx-book-detail-right {
    flex: 1;
    min-width: 300px;
}

/* Gallery Styles */
.dx-gallery-main {
    position: relative;
    width: 100%;
    height: 320px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dx-no-image-placeholder {
    text-align: center;
    color: #a0aec0;
}

.dx-placeholder-icon {
    width: 72px;
    height: 72px;
    display: block;
    margin-bottom: 8px;
    opacity: 0.5;
    color: #a0aec0;
}

.dx-no-image-placeholder p {
    margin: 0;
    font-size: 14px;
}

.dx-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

.dx-main-image.show {
    display: block;
}

/* Gallery Thumbnails */
.dx-gallery-thumbs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: thin;
}

.dx-gallery-thumbs::-webkit-scrollbar {
    height: 6px;
}

.dx-gallery-thumbs::-webkit-scrollbar-track {
    background: #edf2f7;
    border-radius: 3px;
}

.dx-gallery-thumbs::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.dx-gallery-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    background: #f7fafc;
}

.dx-gallery-thumb:hover {
    border-color: #cbd5e0;
}

.dx-gallery-thumb.active {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.dx-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dx-gallery-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #cbd5e0;
}

/* Book Info & Meta List */
.dx-book-title-detail {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: #1a202c;
}

.dx-book-meta-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.dx-meta-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf2f7;
}

.dx-meta-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dx-meta-label {
    font-size: 12px;
    color: #718096;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.dx-meta-value {
    font-size: 16px;
    color: #2d3748;
    font-weight: 600;
}

.dx-meta-price-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
    border-bottom: none;
}

.dx-meta-price-row .dx-meta-value {
    font-size: 24px;
    color: #000000 !important;
    font-weight: 700;
}

/* Stock Section */
.dx-book-stock {
    margin: 0 !important;
    margin-top: 20px !important;
    padding: 16px;
    background: #fff5f5;
    border-radius: 12px;
    border: 1px solid #fed7d7;
}

.dx-stock-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.dx-stock-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dx-stock-label {
    font-size: 12px;
    color: #718096;
    font-weight: 600;
    text-transform: uppercase;
}

.dx-stock-value {
    font-size: 18px;
    color: #2d3748;
    font-weight: 700;
}

.dx-stock-status {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
}

.dx-stock-status.in-stock {
    background: #c6f6d5;
    color: #22543d;
}

.dx-stock-status.out-of-stock {
    background: #fed7d7;
    color: #9b2c2c;
}

/* Description */
.dx-book-description {
    width: 100%;
    padding-top: 32px;
    border-top: 2px solid #edf2f7;
    margin-top: 20px;
}

.dx-section-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
}

.dx-description-content {
    line-height: 1.7;
    color: #4a5568;
    font-size: 15px;
}

.dx-description-content p {
    margin: 0 0 12px 0;
}

.dx-description-content p:last-child {
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .dx-modal-sheet {
        max-height: 85vh; 
    }

    .dx-modal-top-section {
        flex-direction: column;
        gap: 24px;
    }

    .dx-book-gallery,
    .dx-book-detail-right {
        width: 100%;
        min-width: 0;
    }
}

/* Modal Footer */
.dx-modal-footer {
    padding: 15px 20px;
    border-top: 2px solid #000000;
    background: #ffffff;
    display: flex;
    gap: 15px;
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
}

.dx-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #000000;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dx-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Wishlist Button */
.dx-btn-wishlist-modal {
    background: transparent;
    color: #000000;
    border: 2px solid #000000;
}

.dx-btn-wishlist-modal:hover:not(:disabled) {
    background: #000000;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.dx-btn-wishlist-modal.in-wishlist {
    background: #e53e3e;
    color: #ffffff;
    border-color: #e53e3e;
}

.dx-btn-wishlist-modal.in-wishlist:hover {
    background: #c53030;
    border-color: #c53030;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229, 62, 62, 0.3);
}

.dx-wishlist-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dx-wishlist-icon svg {
    display: block;
}

/* Buy Button */
.dx-btn-buy-modal {
    background: #000000;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid #000000;
}

.dx-btn-buy-modal:hover:not(:disabled) {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    transform: translateY(-3px);
    background: #ffffff;
    color: #000000;
}

.dx-btn-buy-modal.in-stock {
    background: #000000;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid #000000;
}

.dx-btn-buy-modal.in-stock:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.dx-btn-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Notification Styles */
.dx-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 100000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 300px;
}

.dx-notification-success {
    background: #38a169;
}

.dx-notification-error {
    background: #e53e3e;
}

.dx-notification-info {
    background: #3182ce;
}



@media (max-width: 480px) {
    .dx-modal-content {
        padding: 16px;
    }

    .dx-gallery-main {
        height: 260px;
    }

    .dx-book-title-detail {
        font-size: 20px;
    }

    .dx-modal-footer {
        padding: 12px 16px;
    }

    .dx-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}
