/* Shop Page Custom Styles */

.warranty_budge {
    background-color: #ff6f61;
}

.card-product .price-wrap .price {
    margin-right: 2px;
    color: var(--primary);
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Professional List View Styling */
.wrapper-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-product.style-list {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.card-product.style-list:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary, #ff6f61);
}

.card-product.style-list .card-product-wrapper {
    flex-shrink: 0;
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    height: 220px;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
}

.card-product.style-list .product-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #fafafa;
    padding: 15px;
}

.card-product.style-list .product-img .img-product {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.card-product.style-list:hover .product-img .img-product {
    transform: scale(1.05);
}

.card-product.style-list .card-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 15px;
    min-width: 0;
}

.card-product.style-list .info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-product.style-list .name-product {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.card-product.style-list .name-product:hover {
    color: var(--primary, #ff6f61);
}

.card-product.style-list .price-wrap {
    margin: 0;
}

.card-product.style-list .price-wrap .price {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary, #ff6f61);
}

.card-product.style-list .desc {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-product.style-list .warranty-badge {
    margin: 0;
}

.card-product.style-list .warranty-badge .badge {
    font-size: 12px;
    padding: 6px 12px;
}

.card-product.style-list .list-product-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.card-product.style-list .list-product-btn .tf-btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.card-product.style-list .list-product-btn .box-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.card-product.style-list .list-product-btn .box-icon:hover {
    border-color: var(--primary, #ff6f61);
    background: var(--primary, #ff6f61);
    color: #fff;
}

/* Responsive List View */
@media (max-width: 991px) {
    .card-product.style-list {
        gap: 15px;
        padding: 15px;
    }

    .card-product.style-list .card-product-wrapper {
        width: 180px;
        min-width: 180px;
        max-width: 180px;
        height: 180px;
    }

    .card-product.style-list .name-product {
        font-size: 16px;
    }

    .card-product.style-list .price-wrap .price {
        font-size: 20px;
    }
}

@media (max-width: 767px) {
    .wrapper-list {
        gap: 15px;
    }

    .card-product.style-list {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .card-product.style-list .card-product-wrapper {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        height: 250px;
    }

    .card-product.style-list .card-product-info {
        width: 100%;
        gap: 12px;
    }

    .card-product.style-list .info-list {
        gap: 8px;
    }

    .card-product.style-list .name-product {
        font-size: 16px;
    }

    .card-product.style-list .price-wrap .price {
        font-size: 20px;
    }

    .card-product.style-list .list-product-btn {
        width: 100%;
        flex-wrap: wrap;
    }

    .card-product.style-list .list-product-btn .tf-btn {
        flex: 1;
        min-width: 140px;
    }
}

@media (max-width: 575px) {
    .card-product.style-list {
        padding: 12px;
    }

    .card-product.style-list .card-product-wrapper {
        height: 200px;
    }

    .card-product.style-list .name-product {
        font-size: 15px;
    }

    .card-product.style-list .price-wrap .price {
        font-size: 18px;
    }

    .card-product.style-list .desc {
        font-size: 13px;
    }

    .card-product.style-list .list-product-btn {
        flex-direction: column;
        width: 100%;
    }

    .card-product.style-list .list-product-btn .tf-btn {
        width: 100%;
    }

    .card-product.style-list .list-product-btn .box-icon {
        width: 100%;
        height: 40px;
    }
}

/* Professional Grid Layout Improvements */
.wrapper-shop.wrapper-grid.tf-grid-layout.tf-col-4 {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 15px !important;
}

/* Product Card Improvements */
.card-product.grid.card-product-size {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-product.grid.card-product-size:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary, #ff6f61);
}

.card-product.grid .card-product-wrapper {
    position: relative;
    padding: 8px;
    background: #fafafa;
    height: 200px;
    max-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-product.grid .product-img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 184px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-product.grid .product-img .img-product {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.card-product.grid:hover .product-img .img-product {
    transform: scale(1.05);
}

.card-product.grid .card-product-info {
    padding: 10px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-product.grid .name-product {
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 5px;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 36px;
}

.card-product.grid .price-wrap {
    margin-bottom: 6px;
}

.card-product.grid .price-wrap .price {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary, #ff6f61);
}

.card-product.grid .warranty-badge {
    margin-bottom: 6px;
}

.card-product.grid .warranty-badge .badge {
    font-size: 11px;
    padding: 4px 8px;
}

/* Responsive Grid Layout */
@media (min-width: 1400px) {
    .wrapper-shop.wrapper-grid.tf-grid-layout.tf-col-4 {
        grid-template-columns: repeat(6, 1fr) !important;
    }
}

@media (max-width: 1399px) and (min-width: 1200px) {
    .wrapper-shop.wrapper-grid.tf-grid-layout.tf-col-4 {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

@media (max-width: 1199px) and (min-width: 992px) {
    .wrapper-shop.wrapper-grid.tf-grid-layout.tf-col-4 {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 991px) and (min-width: 768px) {
    .wrapper-shop.wrapper-grid.tf-grid-layout.tf-col-4 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 767px) {
    .wrapper-shop.wrapper-grid.tf-grid-layout.tf-col-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .card-product.grid .card-product-wrapper {
        height: 160px;
        max-height: 160px;
        padding: 6px;
    }

    .card-product.grid .product-img {
        height: 100%;
        max-height: 148px;
    }

    .card-product.grid .card-product-info {
        padding: 8px 10px;
    }

    .card-product.grid .name-product {
        font-size: 13px;
        min-height: 32px;
        margin-bottom: 4px;
    }

    .card-product.grid .price-wrap {
        margin-bottom: 4px;
    }

    .card-product.grid .price-wrap .price {
        font-size: 16px;
    }

    .card-product.grid .warranty-badge {
        margin-bottom: 4px;
    }
}

@media (max-width: 575px) {
    .wrapper-shop.wrapper-grid.tf-grid-layout.tf-col-4 {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

/* Quick View Modal - Image UI Fixes */
.modal-quick-view .modal-dialog {
    max-width: 1000px;
    margin: 20px auto;
    max-height: calc(100vh - 40px);
}

.modal-quick-view .modal-content {
    border-radius: 16px;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    position: relative;
}

.modal-quick-view .tf-product-media-wrap {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    min-height: 350px;
    position: relative;
}

.modal-quick-view .tf-product-media-wrap .swiper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.modal-quick-view .tf-product-media-wrap .swiper-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
}

.modal-quick-view .tf-product-media-wrap .swiper-slide {
    width: 100% !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.modal-quick-view .tf-product-media-wrap .item {
    width: 100%;
    max-width: 450px;
    height: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    margin: 0 auto;
}

.modal-quick-view .tf-product-media-wrap .item img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

.modal-quick-view .tf-product-info-wrap {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #fff;
}

.modal-quick-view .tf-product-info-wrap .tf-product-info-inner {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.modal-quick-view .tf-product-info-wrap .tf-product-heading {
    margin-bottom: 12px;
    padding-bottom: 0;
    border-bottom: none;
}

.modal-quick-view .tf-product-info-wrap .product-name {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 6px;
    color: #333;
}

.modal-quick-view .tf-product-info-wrap .product-tyre-type {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.modal-quick-view .tf-product-info-wrap .product-price {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-quick-view .tf-product-info-wrap .product-price .price-new {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary, #ff6f61);
    margin: 0;
}

.modal-quick-view .tf-product-info-wrap .product-price .price-old {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    margin: 0;
}

.modal-quick-view .tf-product-info-wrap .product-price .badge-sale {
    font-size: 12px;
    padding: 4px 8px;
    margin: 0;
}

.modal-quick-view .tf-product-info-wrap .text {
    font-size: 13px;
    line-height: 1.5;
    color: #666;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.5em * 3);
}

.modal-quick-view .tf-product-info-wrap .product-stock {
    margin-bottom: 8px;
    display: inline-block;
}

.modal-quick-view .tf-product-info-wrap .product-stock .stock {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    margin: 0;
}

.modal-quick-view .tf-product-info-wrap .product-warranty {
    margin-bottom: 8px;
    display: inline-block;
}

.modal-quick-view .tf-product-info-wrap .product-warranty .warranty_budge {
    font-size: 12px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.modal-quick-view .tf-product-info-wrap .tf-product-total-quantity {
    margin-bottom: 12px;
    margin-top: 12px;
}

.modal-quick-view .tf-product-info-wrap .tf-product-total-quantity .group-btn {
    margin-bottom: 8px;
}

.modal-quick-view .tf-product-info-wrap .view-details {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    font-size: 13px;
}

/* Swiper Navigation Buttons */
.modal-quick-view .swiper-button-prev,
.modal-quick-view .swiper-button-next {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
}

.modal-quick-view .swiper-button-prev:hover,
.modal-quick-view .swiper-button-next:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-quick-view .swiper-button-prev::after,
.modal-quick-view .swiper-button-next::after {
    font-size: 16px;
    color: #333;
    font-weight: 700;
}

/* Hide navigation buttons when only one image */
.modal-quick-view .swiper-button-prev[style*="display: none"],
.modal-quick-view .swiper-button-next[style*="display: none"],
.modal-quick-view .swiper-button-prev.hidden,
.modal-quick-view .swiper-button-next.hidden {
    display: none !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Additional fallback: Hide buttons when swiper has only one slide */
.modal-quick-view .tf-single-slide .swiper-wrapper:has(.swiper-slide:only-child) ~ .swiper-button-prev,
.modal-quick-view .tf-single-slide .swiper-wrapper:has(.swiper-slide:only-child) ~ .swiper-button-next {
    display: none !important;
}

/* Responsive Modal */
@media (max-width: 991px) {
    .modal-quick-view .modal-content {
        flex-direction: column;
    }

    .modal-quick-view .tf-product-media-wrap {
        flex: 0 0 100%;
        max-width: 100%;
        min-height: 250px;
        padding: 15px;
    }

    .modal-quick-view .tf-product-media-wrap .item {
        max-width: 100%;
        min-height: 220px;
        padding: 12px;
    }

    .modal-quick-view .tf-product-media-wrap .item img {
        max-height: 300px;
    }

    .modal-quick-view .tf-product-info-wrap {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .modal-quick-view .tf-product-info-wrap .tf-product-info-inner {
        padding: 15px;
        max-height: calc(100vh - 350px);
    }

    .modal-quick-view .tf-product-info-wrap .product-name {
        font-size: 18px;
        margin-bottom: 5px;
    }

    .modal-quick-view .tf-product-info-wrap .product-price .price-new {
        font-size: 22px;
    }
}

@media (max-width: 767px) {
    .modal-quick-view .modal-dialog {
        margin: 10px auto;
        max-width: 95%;
        max-height: calc(100vh - 20px);
    }

    .modal-quick-view .tf-product-media-wrap {
        padding: 12px;
        min-height: 200px;
    }

    .modal-quick-view .tf-product-media-wrap .item {
        min-height: 180px;
        padding: 10px;
    }

    .modal-quick-view .tf-product-media-wrap .item img {
        max-height: 250px;
    }

    .modal-quick-view .tf-product-info-wrap .tf-product-info-inner {
        padding: 12px;
        max-height: calc(100vh - 250px);
    }

    .modal-quick-view .tf-product-info-wrap .product-name {
        font-size: 18px;
        margin-bottom: 5px;
    }

    .modal-quick-view .tf-product-info-wrap .product-price .price-new {
        font-size: 20px;
    }

    .modal-quick-view .tf-product-info-wrap .text {
        font-size: 12px;
        margin-bottom: 8px;
    }
}

@media (max-width: 575px) {
    .modal-quick-view .tf-product-media-wrap {
        min-height: 180px;
        padding: 10px;
    }

    .modal-quick-view .tf-product-media-wrap .item {
        min-height: 160px;
        padding: 8px;
    }

    .modal-quick-view .tf-product-media-wrap .item img {
        max-height: 200px;
    }

    .modal-quick-view .tf-product-info-wrap .tf-product-info-inner {
        padding: 12px;
    }

    .modal-quick-view .tf-product-info-wrap .product-name {
        font-size: 16px;
    }

    .modal-quick-view .tf-product-info-wrap .product-price .price-new {
        font-size: 18px;
    }

    .modal-quick-view .swiper-button-prev,
    .modal-quick-view .swiper-button-next {
        width: 32px;
        height: 32px;
    }

    .modal-quick-view .swiper-button-prev::after,
    .modal-quick-view .swiper-button-next::after {
        font-size: 12px;
    }
}

