/**
 * Custom Styles for Dream Cycles Template
 * Child Products Display
 */

/* Child Products Section */
.tf-product-info-child-products {    
    padding-bottom: 20px;    
}

.tf-product-info-child-products .title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 15px;
}

.child-products-list {
    display: flex;
    flex-direction: column;
    gap: 0px;
    margin-top: 15px;
}

.child-product-item {
    border-bottom: 1px dashed #686868;
    padding: 5px 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
    
}

.child-product-image {
        width: 50px;
    height: 50px;
    background-color: #f3f3f3;
    padding: 5px;
    border-radius: 5px;
}

.child-product-item:last-child {
    border-bottom: none;
}

.child-product-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background-color: #f0f0f0;
}

.child-product-item.out-of-stock {
    opacity: 0.6;
}

.child-product-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.child-product-info div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.child-product-details {
    /*flex: 1;*/
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
}

.child-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    min-width: 200px;
    flex: 1;
}

.child-product-name a {
    color: #222;
    text-decoration: none;
    transition: color 0.3s ease;
}

.child-product-name a:hover {
    color: #0066cc;
}

.child-product-model {
    font-size: 13px;
    color: #666;
    min-width: 120px;
}

.child-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    min-width: 100px;
}

.child-product-stock {
    font-size: 13px;
    min-width: 100px;
}

.child-product-stock .text-success {
    color: #28a745;
    font-weight: 600;
}

.child-product-stock .text-secondary {
    color: #6c757d;
}

.child-product-actions {
    flex-shrink: 0;
}

.btn-add-child-to-cart,
.child-product-actions .btn-style-3 {
    padding: 6px 20px;
    margin: 4px 0;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #222;
    background: #222;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

.btn-add-child-to-cart:hover,
.child-product-actions .btn-style-3:hover {
    background: #000;
    border-color: #000;
}

.child-product-actions .btn-style-3 {
    background: #fff;
    color: #222;
}

.child-product-actions .btn-style-3:hover {
    background: #f8f8f8;
    border-color: #222;
}

/* Added to cart state */
.btn-add-child-to-cart.added-to-cart {
    background: #28a745;
    border-color: #28a745;
}

.btn-add-child-to-cart:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {

    .product-description-list-content {
        padding: 0 !important;
    }

    .child-product-item {
        padding: 10px;
    }

    .child-product-info {
        text-align: center;
        align-items: center;
        justify-content: center;
        flex-direction: row;
        gap: 8px;
    }
    
    .child-product-details {
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .child-product-info > .child-product-details {
        width: 100px;
    }

    .child-product-details-2 {
        flex-direction: column;
        justify-content: start;
        align-items: start !important;
        gap: 2px !important;
        text-align: left;
    }

    .child-product-details-2  > .child-product-details {
        align-items: start;
    }
    
    .child-product-name,
    .child-product-model,
    .child-product-price,
    .child-product-stock {
        min-width: auto;
        width: 100%;
    }

    .child-product-stock {
        white-space: nowrap;
    }
    
    .child-product-actions {
        width: auto;
    }
    
    .btn-add-child-to-cart,
    .child-product-actions .btn-style-3 {
        width: 100%;
        text-align: center;
    }

    .child-stock-price-outer {
        justify-content: space-between;
        width: 100%;
    }

    .child-stock-price-inner {
        flex-direction: column;
        gap: 0px !important;
    }
}

/* Fitment Information Styles */
.child-product-fitment-link {
    margin-top: 8px;
}

.btn-view-fitment {
    background: none;
    border: none;
    color: #0066cc;
    font-size: 13px;
    padding: 4px 0;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.btn-view-fitment:hover {
    color: #004a99;
    text-decoration: underline;
}

.btn-view-fitment i {
    font-size: 14px;
}

/* Fitment Modal Styles */
.modal-dialog.modal-lg {
    max-width: 800px;
}

#fitmentModal .modal-content {
    border-radius: 8px;
}

/* Product Info Section in Fitment Modal */
.tf-fitment-product-info {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.fitment-product-details {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.fitment-product-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fitment-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.fitment-product-main {
    flex: 1;
}

.fitment-product-name {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.fitment-product-price-stock {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 12px 0;
}

.fitment-price {
    font-size: 22px;
    font-weight: 700;
    color: #222;
}

.fitment-stock .badge {
    font-size: 12px;
    padding: 6px 12px;
    font-weight: 600;
}

.fitment-stock .bg-success {
    background-color: #28a745 !important;
}

.fitment-stock .bg-secondary {
    background-color: #6c757d !important;
}

.btn-fitment-add-to-cart {
    padding: 10px 30px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #222;
    background: #222;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

.btn-fitment-add-to-cart:hover {
    background: #000;
    border-color: #000;
    color: #fff;
}

.btn-fitment-add-to-cart.added-to-cart {
    background: #28a745;
    border-color: #28a745;
}

/* Fitment Table Section */
.tf-fitment-table-wrapper {
    padding: 20px;
}

.fitment-table-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin: 0 0 15px 0;
}

.tf-product-info-title {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.tf-product-info-title h5 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.tf-product-info-title .text-caption-1 {
    margin: 0;
    color: #666;
    font-size: 13px;
}

/* Fitment Table Styles */
.modal-content .table {
    margin: 0;
    font-size: 14px;
}

.modal-content .fitment-table {
    margin-bottom: 0;
}

.modal-content .table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-content .table thead th {
    font-weight: 600;
    color: #222;
    padding: 12px 15px;
    border-bottom: 2px solid #dee2e6;
}

.modal-content .table tbody td {
    padding: 10px 15px;
    vertical-align: middle;
}

.modal-content .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.modal-content .table tbody tr:hover {
    background-color: rgba(0, 102, 204, 0.05);
}

/* Responsive adjustments for fitment modal */
@media (max-width: 768px) {
    .modal-dialog.modal-lg {
        max-width: 95%;
        margin: 10px auto;
    }
    
    .fitment-product-details {
        flex-direction: column;
        gap: 15px;
    }
    
    .fitment-product-image {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }
    
    .fitment-product-name {
        font-size: 16px;
        text-align: center;
    }
    
    .fitment-product-price-stock {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .btn-fitment-add-to-cart {
        width: 100%;
        text-align: center;
    }
    
    .fitment-table-title {
        font-size: 14px;
    }
}

/* View Fitment Link Styles */
.view-fitment-link {
    display: inline-block;
    color: #0066cc !important;
    text-decoration: underline !important;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.2s ease;
    cursor: pointer;
}

.view-fitment-link:hover {
    color: #0052a3 !important;
    text-decoration: underline !important;
}

/* Fitment Modal Styles */
#fitment_modal .modal-content {
    max-width: 600px;
}

#fitment_modal .header {
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
}

#fitment_modal .demo-title {
    font-size: 18px;
    font-weight: 600;
    color: #222;
}

#fitment_modal .fitment-product-info h6 {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin: 0;
}

#fitment_modal #fitment-search {
    font-size: 14px;
}

#fitment_modal #fitment-search:focus {
    border-color: #0066cc;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

#fitment_modal .fitment-item {
    font-size: 14px;
    line-height: 1.4;
}

#fitment_modal #fitment-count {
    font-size: 13px;
    font-weight: 500;
}

/* Responsive adjustments for fitment modal */
@media (max-width: 768px) {
    #fitment_modal .modal-dialog {
        margin: 10px;
    }
    
    #fitment_modal .overflow-y-auto {
        max-height: 60vh !important;
    }
}

/* Overall Vehicle Search Styles */
.vehicle-fitment-search {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.vehicle-fitment-search input:focus {
    border-color: #0066cc !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Fitment Search Highlighting */
.child-product-item.fitment-highlighted {
    background-color: #e8f5e9 !important;
    border-left: 4px solid #28a745;
    padding-left: 11px !important;
    animation: highlightPulse 0.5s ease-in-out;
    order: -1; /* Helps with visual sorting */
}

.child-product-item.fitment-dimmed {
    transition: opacity 0.3s ease, transform 0.3s ease;
    order: 1; /* Helps with visual sorting */
}

@keyframes highlightPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.01); }
}

.child-product-item.fitment-highlighted:hover {
    background-color: #d4edda !important;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

#overall-search-results {
    min-height: 20px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

