/* 
* Custom CSS for EbookStore
* This file contains all custom styles for the entire site
*/

/* ===== COMMON STYLES ===== */

:root{
    --primary-color: #0f8967;
}

/* Product Card Styles */
.product-card {
    border: 1px solid #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.product-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.product-header {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.product-header h3 {
    font-size: 16px;
    margin-bottom: 0;
    line-height: 1.4;
    height: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}

.product-header h3 a {
    color: #333;
}

.product-header .author {
    color: #6c757d;
    font-size: 13px;
    margin-bottom: 5px;
    display: block;
}

.card-image {
    position: relative;
    overflow: hidden;
    padding-top: 100%;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hover-contents {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.card-image:hover .hover-contents {
    opacity: 1;
}

.price-block {
    padding: 15px;
    display: flex;
    align-items: center;
}

.price {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

.price-old {
    font-size: 14px;
    color: #6c757d;
    text-decoration: line-through;
    margin-left: 10px;
}

.price-discount {
    background-color: var(--primary-color);
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 10px;
}

.rating-block {
    padding: 0 15px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.star_on {
    color: #ffc107;
}

/* ===== SHOP PAGE STYLES ===== */

/* Sidebar Styles */
.shop-sidebar {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.sidebar-widget {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-widget:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

/* Category Tree Styles */
.category-tree {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.category-tree-item {
    margin-bottom: 5px;
}

.category-header {
    display: flex;
    align-items: center;
    position: relative;
}

.toggle-icon, .toggle-icon-placeholder {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 5px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.toggle-icon i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.toggle-icon:not(.collapsed) i {
    transform: rotate(90deg);
}

.category-header a {
    color: #333;
    text-decoration: none;
    padding: 6px 0;
    display: block;
    flex-grow: 1;
    font-size: 14px;
    transition: all 0.3s ease;
    border-radius: 4px;
    padding-left: 5px;
}

.category-header a:hover {
    color: #0f8967;
}

.category-header a.active {
    color: #0f8967;
    font-weight: 600;
    background-color: rgba(15, 137, 103, 0.1);
    padding-left: 10px;
}

.category-children {
    list-style: none;
    padding-left: 25px;
    margin-top: 5px;
}

/* Price Range Slider */
.price-slider {
    height: 5px;
    position: relative;
    background: #e9ecef;
    border-radius: 5px;
}

.price-slider .ui-slider-range {
    position: absolute;
    background: var(--primary-color);
}

.price-slider .ui-slider-handle {
    height: 16px;
    width: 16px;
    background: #0f8967;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    position: absolute;
    top: -5px;
    margin-left: -8px;
}

.price-range-display {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* Shop Toolbar */
.shop-toolbar {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 30px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.product-view-mode {
    display: flex;
    align-items: center;
}

.product-view-mode a {
    height: 35px;
    width: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    color: #6c757d;
    border-radius: 3px;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.product-view-mode a.active,
.product-view-mode a:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.sorting-selection {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.sort-label {
    font-weight: 600;
    color: #333;
}

.nice-select {
    height: 35px;
    line-height: 33px;
    border-radius: 3px;
    border-color: #ced4da;
}

/* Sort Options Styles */
.sort-options {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.sort-title {
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.sort-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.form-check-inline {
    margin-right: 0;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 8px 15px;
    transition: all 0.3s ease;
}

.form-check-inline:hover {
    background-color: rgba(var(--primary-color-rgb), 0.05);
}
 

.form-check-label {
    cursor: pointer;
    font-size: 14px;
    margin-left: 5px;
}

.form-check-input.sort-radio:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-color-rgb), 0.25);
}

.form-check-inline.active {
    background-color: rgba(var(--primary-color-rgb), 0.1);
    border-color: var(--primary-color);
}

.product-showing {
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.product-showing p {
    margin-bottom: 0;
    font-size: 14px;
    color: #6c757d;
}

@media (max-width: 767px) {
    .sort-radio-group {
        flex-direction: column;
    }
    
    .form-check-inline {
        margin-right: 0;
        margin-bottom: 8px;
        width: 100%;
    }
}

/* List View */
.shop-product-wrap.list .product-card {
    display: flex;
    flex-direction: row;
}

.shop-product-wrap.list .col-lg-4 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
}

.shop-product-wrap.list .card-image {
    width: 250px;
    padding-top: 0;
    height: 250px;
    flex-shrink: 0;
}

.shop-product-wrap.list .product-card--body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.shop-product-wrap.list .product-header {
    padding: 20px;
}

.shop-product-wrap.list .product-header h3 {
    height: auto;
}

/* Pagination */
.pagination-block {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.25rem;
}

.page-item:first-child .page-link {
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}

.page-item:last-child .page-link {
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    margin-left: -1px;
    line-height: 1.25;
    color: var(--primary-color);
    background-color: #fff;
    border: 1px solid #dee2e6;
}

.page-link:hover {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ===== HOME PAGE STYLES ===== */

/* Feature Box Styles */
.feature-box {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
    height: 100%;
    transition: all 0.3s ease;
}

.feature-box:hover {
    transform: translateY(-5px);
}

.feature-box .icon {
    font-size: 2.5rem;
    color: var(--primary-color);
}

/* Category Box Enhancements */
.category-box {
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.category-box:hover {
    transform: translateY(-5px);
}

.category-list ul li a {
    transition: all 0.3s ease;
    color: var(--text-color);
}

.category-list ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

/* Testimonial Card Enhancements */
.testimonial-card {
    height: 100%;
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
}

.testimonial-image img, .default-avatar {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.default-avatar {
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #999;
    margin: 0 auto;
}

.testimonial-rating i {
    color: #ffc107;
}

/* FAQ Enhancements */
.accordion-button:not(.collapsed) {
    background-color: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
}

/* General Spacing */
.section-title {
    margin-bottom: 2rem;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .cta-form {
        margin-top: 1.5rem;
    }
}
