/* DX Bookstore Frontend Styles - Adapted from Modal Design */

/* Main Container (replacing modal-sheet) */
.dx-book-container {
    max-width: 1000px;
    margin: 40px auto;
    background: white;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Content Wrapper */
.dx-book-content {
    padding: 32px;
}

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

.dx-book-gallery-section {
    flex: 1;
    min-width: 300px;
}

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

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

.dx-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

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

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

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

.dx-gallery-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    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;
}

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

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

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

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

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

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

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

.dx-meta-price-row .dx-meta-value {
    font-size: 36px;
    color: #000000;
    font-weight: 800;
}

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

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

.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: 20px;
    color: #2d3748;
    font-weight: 700;
}

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

.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: 40px;
    border-top: 2px solid #edf2f7;
    margin-top: 32px;
}

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

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

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

/* Footer Actions */
.dx-book-footer {
    padding: 24px 32px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    gap: 16px;
    align-items: center;
}

.dx-btn {
    flex: 1;
    padding: 16px 24px;
    border-radius: 12px;
    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;
    border: 2px solid transparent;
}

/* Wishlist Button */
.dx-btn-wishlist {
    background: white;
    color: #1a202c;
    border-color: #e2e8f0;
}

.dx-btn-wishlist:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
    transform: translateY(-2px);
}

.dx-btn-wishlist.in-wishlist {
    background: #fff5f5;
    color: #e53e3e;
    border-color: #fed7d7;
}

.dx-wishlist-icon {
    width: 20px;
    height: 20px;
}

/* Buy Button */
.dx-btn-buy {
    background: #1a202c;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dx-btn-buy:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    background: #000;
}

.dx-btn-buy:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #a0aec0;
}

/* 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;
}

/* Responsive */
@media (max-width: 768px) {
    .dx-book-container {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .dx-book-content {
        padding: 20px;
    }

    .dx-book-top-section {
        flex-direction: column;
        gap: 32px;
    }

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

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

    .dx-meta-price-row .dx-meta-value {
        font-size: 28px;
    }

    .dx-book-footer {
        padding: 16px 20px;
        position: sticky;
        bottom: 0;
        z-index: 100;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    }
}
