/* PDF Viewer Styles */
.book-preview-modal .modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.pdf-viewer-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    background: #f5f5f5;
}

.pdf-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.loading-bar {
    width: 80%;
    max-width: 400px;
    background: #f0f0f0;
    border-radius: 20px;
    height: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--primary-color, #4CAF50);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 20px;
}

.progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    line-height: 20px;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pdf-viewer-container {
        padding: 10px;
    }
    
    .loading-bar {
        height: 16px;
    }
    
    .progress-text {
        font-size: 10px;
        line-height: 16px;
    }
}

/* Book Details Container */
.bookshop-custom-fields-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

/* Book Details Grid */
.bookshop-details-grid {
    margin: var(--wp--preset--spacing--40) 0;
    padding: var(--wp--preset--spacing--40);
    background: var(--wp--preset--color--white);
    border-radius: var(--rounded-corners-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.grid-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.grid-cell {
    background: #ffffff;
    padding: 10px;
    border-radius: 6px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #eee;
}

.grid-cell:hover {
    transform: translateY(-2px);
    box-shadow: var(--wp--preset--shadow--natural);
    background: var(--wp--preset--color--white);
}

.cell-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 12px;
    margin-bottom: 4px;
}

.cell-label svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--primary-color);
}

.cell-value {
    color: black;
    font-size: 12px !important;
}

.cell-value a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.cell-value a:hover {
    color: var(--fs-experimental-link-color-hover);
    text-decoration: underline;
}

.grid-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--color-headers-background, #F4F4F4);
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.grid-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--wp--preset--shadow--natural);
    background: white;
}

.grid-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--primary-color);
}

.grid-item-label {
    font-weight: 600;
    color: var(--fs-experimental-link-color);
    margin-right: 0.5rem;
    white-space: nowrap;
}

.grid-item-value {
    color: var(--fs-experimental-link-color);
    flex-grow: 1;
}

.grid-item-value a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.grid-item-value a:hover {
    color: var(--fs-experimental-link-color-hover);
    text-decoration: underline;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .bookshop-details-grid {
        padding: var(--wp--preset--spacing--30);
    }
    
    .grid-row {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--wp--preset--spacing--30);
    }
    
    .grid-cell {
        padding: var(--wp--preset--spacing--20);
    }
}

@media screen and (max-width: 480px) {
    .grid-row {
        grid-template-columns: 1fr;
    }
    
    .grid-cell {
        padding: var(--wp--preset--spacing--20);
    }
}

@media (max-width: 991px) {
    .grid-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media screen and (max-width: 768px) {
    .bookshop-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 575px) {
    .bookshop-details-grid {
        margin: 15px 0;
    }

    .grid-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .grid-cell {
        padding: 8px;
    }

    .cell-label {
        font-size: 11px;
        gap: 4px;
    }

    .cell-label svg {
        width: 12px;
        height: 12px;
    }

    .cell-value {
        font-size: 12px;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .grid-row {
        grid-template-columns: repeat(1, 1fr);
        gap: 8px;
    }
}

/* Ensure quantity and add to cart button are on the same row */
.woocommerce div.product form.cart {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}
.woocommerce div.product form.cart .quantity {
    margin-bottom: 0;
}
.woocommerce div.product form.cart button {
    margin-bottom: 0;
}


/* Book Details Table */
.bookshop-custom-fields-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.bookshop-custom-fields-table tr {
    transition: background-color 0.2s ease;
}

.bookshop-custom-fields-table tr:hover {
    background-color: #ffffff;
}

.bookshop-custom-fields-table td {
    padding: 8px 12px;
    vertical-align: top;
    line-height: 1.5;
}

.bookshop-custom-fields-table td:first-child {
    width: 120px;
    color: #666;
}

.bookshop-custom-fields-table td strong {
    font-weight: 500;
    color: #333;
}

/* Contributors */
.book-contributors {
    margin: 1em 0;
}

.contributor-type {
    font-weight: 600;
    color: #666;
    margin-right: 0.5em;
}

.contributor-list {
    display: inline;
    list-style: none;
    margin: 0;
    padding: 0;
}

.contributor-list li {
    display: inline;
}

.contributor-list li:after {
    content: ", ";
}

.contributor-list li:last-child:after {
    content: "";
}

.contributor-list a {
    color: #0073aa;
    text-decoration: none;
}

.contributor-list a:hover {
    color: #00a0d2;
    text-decoration: underline;
}


/* Stock Warning */
.stock-warning {
    margin: 1em 0;
    padding: 0.5em 1em;
    background: #fff5e6;
    border-left: 4px solid #ff9900;
    color: #664400;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .book-details th {
        width: 40%;
    }
}

@media screen and (max-width: 480px) {
    .book-details th,
    .book-details td {
        display: block;
        width: 100%;
    }
    
    .book-details th {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .book-details td {
        padding-top: 0.25em;
    }
}

/* Book Details Styles */
.book-details {
    margin: 2em 0;
    padding: 1em;
    background: #f9f9f9;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.book-details table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.book-details th,
.book-details td {
    padding: 0.5em;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.book-details th {
    width: 30%;
    color: #666;
    font-weight: 600;
}

.book-details td {
    color: #333;
}

.book-details tr:last-child th,
.book-details tr:last-child td {
    border-bottom: none;
}

/* Price styles removed - using theme defaults */

/* Best Seller Badge */
.best-seller-badge {
    display: inline-block;
    background-color: #ff9800;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

/* Brand Info */
.brand-info {
    display: block;
    margin: 0;
    padding: 10px 0;
    font-size: 0.85em;
    color: #666;
    border-bottom: 1px solid #eee;
}

.brand-label {
    font-weight: normal;
    color: #666;
}

.brand-info a {
    color: #515151;
    text-decoration: none;
    transition: color 0.2s ease;
    margin-left: 5px;
    font-weight: 500;
}

.brand-info a:hover {
    color: #000;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .bookshop-custom-fields-container {
        padding: 15px;
    }

    .bookshop-custom-fields-table td {
        padding: 6px 8px;
    }

    .bookshop-custom-fields-table td:first-child {
        width: 100px;
    }
}

@media (max-width: 480px) {
    .bookshop-custom-fields-table {
        display: block;
    }

    .bookshop-custom-fields-table tr {
        display: block;
        margin-bottom: 12px;
        border-bottom: 1px solid #e9ecef;
    }

    .bookshop-custom-fields-table tr:last-child {
        margin-bottom: 0;
        border-bottom: none;
    }

    .bookshop-custom-fields-table td {
        display: block;
        padding: 4px 0;
    }

    .bookshop-custom-fields-table td:first-child {
        width: auto;
        padding-bottom: 2px;
    }

    .bookshop-details-grid {
        margin: 15px 0;
    }
}

/* Hide duplicate elements */
.woocommerce div.product .woocommerce-product-rating,
.woocommerce div.product p.stock,
.woocommerce-product-details__short-description,
.woocommerce div.product .stock,
.woocommerce div.product p.stock,
.woocommerce-product-rating,
.product_meta,
.posted_in,
.product-delivery-info,
.woocommerce-product-rating:not(.custom-rating),
.stock:not(.stock-status),
.woocommerce div.product .summary p.stock,
.woocommerce-review-link,
.woocommerce-product-rating .star-rating,
.woocommerce-product-rating .woocommerce-review-link,
.flatsome-rating,
.flatsome-product-rating,
.woocommerce-product-rating:not(.custom-rating),
.product-ratings,
.product-stock,
.stock-status:not(.stock-status),
.stock:not(.stock-status),
.product-stock-status,
.stock-availability,
.availability,
.stock-info,
.stock-level,
.product-availability,
.woocommerce div.product .stock,
.woocommerce div.product p.stock,
.woocommerce div.product .stock-status:not(.stock-status),
.woocommerce div.product .stock:not(.stock-status),
.woocommerce div.product p.stock:not(.stock-status),
.woocommerce div.product .stock-info,
.woocommerce div.product .stock-level,
.woocommerce div.product .product-availability,
.woocommerce div.product .availability,
.woocommerce div.product .stock-availability,
.woocommerce div.product .product-stock-status,
.woocommerce div.product .product-stock,
.woocommerce div.product .stock-status:not(.stock-status-wrapper .stock-status),
.woocommerce div.product .stock:not(.stock-status-wrapper .stock-status),
.woocommerce div.product p.stock:not(.stock-status-wrapper .stock-status),
.woocommerce div.product .stock-info:not(.stock-status-wrapper .stock-status),
.woocommerce div.product .stock-level:not(.stock-status-wrapper .stock-status),
.woocommerce div.product .product-availability:not(.stock-status-wrapper .stock-status),
.woocommerce div.product .availability:not(.stock-status-wrapper .stock-status),
.woocommerce div.product .stock-availability:not(.stock-status-wrapper .stock-status),
.woocommerce div.product .product-stock-status:not(.stock-status-wrapper .stock-status),
.woocommerce div.product .product-stock:not(.stock-status-wrapper .stock-status),
.woocommerce div.product .stock-status:not(.stock-status-wrapper .stock-status),
.woocommerce div.product .stock:not(.stock-status-wrapper .stock-status),
.woocommerce div.product p.stock:not(.stock-status-wrapper .stock-status) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Only show our custom elements */
.stock-status-wrapper,
.stock-status-wrapper .stock-status {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    width: auto !important;
    position: static !important;
}

/* Stock Status */
.stock-status-wrapper {
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    width: fit-content;
}

.stock-status.in-stock {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.stock-status.low-stock {
    background-color: #ffebee;
    color: #d32f2f;
}

.stock-warning {
    color: #d32f2f;
    font-size: 13px;
    margin-top: 2px;
    font-weight: 500;
    display: block;
    width: 100%;
}

.stock-status .stock-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.stock-status.in-stock .stock-icon {
    color: #2e7d32;
}

.stock-status.low-stock .stock-icon {
    color: #d32f2f;
}

/* Product title and meta */
.product_title {
    margin-bottom: 8px !important;
    font-size: 24px !important;
    line-height: 1.3 !important;
}

.product-byline {
    margin-bottom: 10px;
}

/* Custom rating display */
.custom-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 15px 0;
}

.rating-stars {
    margin: 0 !important;
}

.rating-stars .star-rating {
    float: none !important;
    margin: 0 !important;
}

.rating-count {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

/* Rating Display */
.custom-rating {
    margin: 8px 0;
    text-align: left;
}

.rating-stars {
    display: inline-flex;
    align-items: center;
}

.rating-count {
    font-size: 14px;
    color: #666;
    display: inline-block;
}

.scroll-to-reviews {
    color: #2196F3;
    text-decoration: none;
    transition: color 0.2s ease;
}

.scroll-to-reviews:hover {
    color: #1976D2;
    text-decoration: underline;
}



/* Product Description */
.product-short-description {
    margin: 12px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.scroll-to-description {
    color: #2196F3;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
    font-weight: 500;
}

.scroll-to-description:hover {
    color: #1976D2;
    text-decoration: underline;
}



/* Make sure product image container is relative for absolute positioning */
.woocommerce-product-gallery {
    position: relative;
}

/* Animation for button appearance */
@keyframes buttonFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Make buttons inline */
.single_add_to_cart_button {
    margin-right: 0 !important;
}

form.cart {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Hide breadcrumbs in product info */
.product-info .breadcrumbs {
    display: none !important;
}
