.product-detail-container {
    padding: 30px 0;
}

.product-detail-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 30px;
}

/* Product Header */
.product-header {
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    text-align: center;
}

.product-title {
    font-size: 32px;
    color: var(--theme-text-primary, #333);
    margin: 0;
    font-weight: 600;
}

.product-item-code {
    font-size: 24px;
    color: var(--theme-text-primary, #333);
    margin: 0;
    font-weight: 600;
}

/* Product Content Layout */
.product-content {
    display: flex;
    gap: 40px;
}

.product-images {
    flex: 0 0 45%;
}

.product-info {
    flex: 0 0 50%;
}

/* Image Slider */
.image-slider {
    position: relative;
    max-width: 100%;
}

.main-image {
    margin-bottom: 20px;
    border-radius: 4px;
    overflow: hidden;
}

.main-image img {
    width: 100%;
    height: auto;
    display: block;
    cursor: default;
    max-height: 260px;
    object-fit: contain;
    border-radius: 0.5rem;
    background: #f8f9fa;
}

/* Remove any zoom/loader effects on image hover */
.main-image img:hover {
    cursor: default;
}

/* Disable any drift zoom functionality */
.drift-zoom-pane {
    display: none !important;
}

.drift-bounding-box {
    display: none !important;
}

.thumbnail-slider {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-top: 10px;
}

.thumbnail {
    flex: 0 0 80px;
    height: 80px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.thumbnail.active, .thumbnail:hover {
    border-color: var(--theme-primary, #007bff);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.25rem;
}


/* Product Sections */
.product-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.product-section:last-child {
    border-bottom: none;
}

.product-section h3 {
    font-size: 18px;
    color: var(--theme-text-primary, #333);
    margin-bottom: 15px;
    font-weight: 600;
}

/* Description */
.description-content {
    color: var(--theme-text-secondary, #666);
    line-height: 1.6;
}

/* Category Info */
.category-info {
    color: #666;
}

.category-name, .subcategory-name {
    color: var(--theme-primary, #007bff);
}

/* Attributes */
.attributes-list {
    display: grid;
    gap: 10px;
}

.attribute-item {
    display: flex;
    gap: 10px;
    align-items: center;
}

.attribute-label {
    font-weight: 600; 
    color: var(--theme-text-primary, #555);
}

.attribute-value {
    color: var(--theme-text-secondary, #666);
    background-color: #d4edda; 
    padding: 2px 5px; 
    border-radius: 4px; 
    margin-right: 2px; 
    display: inline-block;
}

/* Product Details */
.product-details {
    display: grid;
    gap: 15px;
}

.detail-item {
    display: flex;
    gap: 8px; 
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}
.cart-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--theme-text-primary, #555);
    font-weight: 600;
}

.detail-value {
    color: var(--theme-text-secondary, #666);
}

.price-item {
    margin-top: 10px;
}

.price {
    font-size: 24px;
    color: var(--theme-text-primary, #28a745);
    font-weight: 600;
}

.price-item .price {
  font-size: 1.25rem;
  color: #28a745;
  font-weight: bold;
}

/* Cart Section */
.cart-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.add-to-cart-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quantity-cart-wrapper {
    display: flex;
    width: 70%;
    gap: 16px; /* Optional: space between the two fields */
}

.quantity-group {
    flex: 0 0 185px;
}

.quantity-group input {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

.add-to-cart-btn {
    width: 70% !important;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--theme-primary, #28a745);
    color: var(--theme-btn-primary-text, white);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    min-width: 180px;
    margin-top: 1rem;
}

.add-to-cart-btn:hover {
    background: var(--theme-btn-primary-hover-bg, #218838);
}

.panel-heading {
    color: var(--theme-text-primary, #333);
    font-weight: 400;
    text-align: left;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.product-card {
  transition: box-shadow 0.2s, transform 0.2s;
  border-radius: 0.75rem;
  background: #fff;
  position: relative;
}
.product-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  transform: translateY(-4px) scale(1.02);
}
.variation-image-slider img {
  border-radius: 0.75rem 0.75rem 0 0;
}

.variation-details-table {
  margin-top: 2rem;
}

.button-align-center {
    align-self: center !important;
    margin-top: 20px;
}


/* Responsive Design */
@media (max-width: 991px) {
    .product-content {
        flex-direction: column;
    }

    .product-images,
    .product-info {
        flex: 0 0 100%;
    }
}

@media (max-width: 576px) {
    .product-detail-box {
        padding: 15px;
    }

    .quantity-cart-wrapper {
        flex-direction: column;
    }

    .quantity-group {
        flex: 0 0 100%;
    }
}

/* Responsive Popup Styles */
@media (max-width: 767.98px) {
    #variationDetailModal .modal-dialog {
        margin: 0 !important;
        width: 100%;
        max-width: 100%;
        height: 100%;
    }

    #variationDetailModal .modal-content {
        height: 100%;
        border-radius: 0;
        overflow-y: auto;
    }

    #variationDetailModal .modal-body {
        padding: 1rem;
    }
    
    #variationDetailModal .modal-body .row {
        flex-direction: column;
    }
    
    #variationDetailModal .modal-body .col-md-5,
    #variationDetailModal .modal-body .col-md-7 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

    #variationDetailModal .close-btn {
        position: absolute;
        top: 10px;
        right: 15px;
        font-size: 24px;
        font-weight: bold;
        color: #000;
        background: none;
        border: none;
        z-index: 1050; /* Ensure it's above other content */
    }

    #variationDetailModal .carousel-item img {
        max-height: 250px; /* Increased height for better view on mobile */
    }

    #variationDetailModal .form-control,
    #variationDetailModal .add-to-cart-btn {
        width: 100% !important;
    }

    #variationDetailModal .variation-details-table {
        overflow-x: auto;
        display: block;
        width: 100%;
    }
    
    #variationDetailModal .variation-details-table table {
        width: 100%;
    }

    #variationDetailModal .product-section {
        padding: 1rem;
        border-bottom: none;
    }
}

@media (max-width: 999.98px) {
    #variationDetailModal.modal.fade .modal-dialog {
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        transform: none !important;
    }

    #variationDetailModal .modal-content {
        height: 100% !important;
        border-radius: 0 !important;
        overflow-y: auto !important;
    }

    #variationDetailModal .modal-body .row {
        flex-direction: column;
    }

    #variationDetailModal .modal-body .col-md-5,
    #variationDetailModal .modal-body .col-md-7 {
        width: 100%;
        max-width: 100%;
        flex: 1 0 100%;
    }
}

/* Custom Modal Styles */
.product-detail-modal {
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.product-detail-modal-dialog {
    max-width: 800px;
    margin: 1.75rem auto;
}

.product-detail-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0,0,0,.2);
    border-radius: 0.3rem;
    outline: 0;
}

.product-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem 1rem;
    border-bottom: 1px solid #dee2e6;
}

.product-detail-title {
    margin-bottom: 0;
    line-height: 1.5;
    font-size: 1.25rem;
}

.product-detail-close-btn {
    padding: 1rem 1rem;
    margin: -1rem -1rem -1rem auto;
    background-color: transparent;
    border: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: .5;
    cursor: pointer;
}

.product-detail-close-btn:hover {
    opacity: .75;
}

.product-detail-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

.product-detail-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.product-detail-col-left,
.product-detail-col-right {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    background-color: #fff;
}

.product-detail-col-left {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
}
.product-detail-col-right {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
}

.product-detail-section {
    margin-bottom: 1rem;
}

.product-detail-cart-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.product-detail-table-wrapper {
    margin-top: 1.5rem;
    width: 100%;
    overflow-x: auto;
}

/* Responsive Styles for Custom Modal */
@media (max-width: 999.98px) {
    .product-detail-modal-dialog {
        margin: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
    }

    .product-detail-modal-content {
        height: 100%;
        border-radius: 0;
        overflow-y: auto;
    }

    .product-detail-row {
        flex-direction: column;
    }

    .product-detail-col-left,
    .product-detail-col-right {
        max-width: 100%;
    }
}
