/* The Popup (background) */

/* Capture Area */
.ksc-capture-area {
    position: relative;
    background: #ffffff;
    padding: 25px 20px 40px;
    font-family: Arial, Helvetica, sans-serif;
    color: #000;
    margin: 0 auto;
    box-sizing: border-box;
    /* FIX 1: Changed overflow-x and white-space to allow internal scrolling */
    overflow-x: hidden; 
    white-space: normal; 
}

/* Chart Title */
.ksc-chart-title {
    text-align: center;
    font-size: 20px;
    letter-spacing: 1.5px;
    margin: 0 0 20px;
    font-weight: 600;
}

/* Product Image */
.ksc-product-image {
    display: block;
    margin: 0 auto 20px;
    max-width: 180px;
    width: 100%;
    height: auto;
}

/* Table Wrapper */
.ksc-table-wrapper {
    /* FIX 2: Added overflow-x and adjusted margins to ensure scrolling works in popups */
    margin: 20px 0 50px 0; 
    overflow-x: auto;
    width: 100%;
    display: block;
}

/* Table Styling */
.ksc-capture-area table.kapsc-generated-table {
    width: max-content !important;
    min-width: 100% !important;
    border-collapse: collapse !important;
    font-size: 12px !important;
    font-family: Arial, Helvetica, sans-serif !important;
    color: #222;
}

.ksc-capture-area table.kapsc-generated-table th,
.ksc-capture-area table.kapsc-generated-table td {
    padding: 10px 12px !important;
    border: 1px solid #ccc !important;
    white-space: nowrap !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.ksc-capture-area table.kapsc-generated-table th {
    font-weight: 600 !important;
    background: #c2c2c2 !important;
    color: #333;
}

.ksc-capture-area table.kapsc-generated-table tbody tr:hover {
    background-color: #f1f1f1 !important;
}

/* Chart Description */
.ksc-chart-description {
    max-width: 85%;
    margin: 0 auto;
    font-size: 12px;
    line-height: 1.4;
    text-align: left;
    color: #333;
    white-space: normal;
}

/* Logo Image */
.ksc-logo-image {
    position: absolute;
    bottom: -6px;
    right: 15px;
    max-width: 70px;
    height: auto;
}

/* Final Image */
.ksc-final-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

div#ksc-capture-area{
	background: #eeeeee;
}

.kapsc-product-img {
    display: block;
    max-width: 300px;
    width: 100%;
    height: auto;
    margin: 20px auto;
    border-radius: 8px;    
}

.kapsc-chart-desc {
    text-align: center;
    font-weight: 600;
    font-size: 20px !important;
    color: #555;
    margin-top: 10px;
}

.kapsc_pop_btn{
	display: flex;
	width: 40%;
}
.kapsc_pop_btn img{
	width: 25%;
	text-align: center;
	margin-right: 10px;
}
.single_add_to_cart_button{
	margin-bottom: 20px;
}
.kapsc-popup-overlay{
	z-index: 999999;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	padding: 35px;
border: 0;
bottom: 0;
}
.popuptext {
    background-color: white;
    -webkit-transition: all 0.3s ease-out; 
    transition: all 0.3s ease-out; 
    -webkit-box-shadow: 0 0 18px 0 rgb(50 50 50 / 32%);
    box-shadow: 0 0 18px 0 rgb(50 50 50 / 32%);
    z-index: 9999999;
    padding: 25px 25px;
    position: absolute;
    left: 50%;
    width: 70%;
    display: none;
    border-radius: 5px;
    box-sizing: border-box;
    text-align: left;
    
    /* --- ADD THESE THREE LINES TO FIX ROW OVERFLOW --- */
    top: 50%;
    max-height: 90vh;    /* Prevents popup from exceeding 90% of screen height */
    overflow-y: auto;    /* Enables vertical scrolling for many rows */
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .popuptext {
        width: 90%; /* Adjust width for mobile screens */
    }
}

@media (max-width: 480px) {
    .popuptext {
        width: 100%; /* Full width for very small mobile screens */
    }
}

/* Popup Content */
.popup-content {
	width: 100%;
	box-sizing: border-box;
	font-size: 20px;
    text-align: center;
}

/* The Close Button */
.close {
	color: #aaaaaa;
	font-size: 28px;
	font-weight: bold;
	position: absolute;
	right: 13px;
	top: 0;
}

.close:hover,
.close:focus {
	color: #000;
	text-decoration: none;
	cursor: pointer;
}

.kapsc_field_length {
	width: 40%;
}

button.popup {
	color: darkgray;
	margin-bottom: 1%;
}
.kapsc-popup-overlay{
	max-width: 100%;
	min-width: 1%;
	min-height: 1%;
	max-height: 100%;
	top: 50%;
	position: fixed;
	box-sizing: border-box;
	overflow: auto!important;
	padding: 30px;
}

@keyframes fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateY(-100%);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes zoomIn {
	from {
		opacity: 0;
		transform: scale(0);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.kapsc_hid_OL.animate-fade .popuptext {
	animation: fadeIn 0.5s;
}

.kapsc_hid_OL.animate-slide .popuptext{
	animation: slideIn 0.5s;
}

.kapsc_hid_OL.animate-zoom .popuptext {
	animation: zoomIn 0.5s;
}

/* Animation for left */
@keyframes moveLeft {
	0% { transform: translateX(-50%); }
	50% { transform: translateX(-40%); }
	100% { transform: translateX(-50%); }
}

/* Animation for right */
@keyframes moveRight {
	0% { transform: translateX(-50%); }
	50% { transform: translateX(-60%); }
	100% { transform: translateX(-50%); }
}

/* Animation for center */
@keyframes moveCenter {
	0% { opacity: 0; }
	50% { transform: translateX(-50%); }
	100% { opacity: 1; }
}

.kapsc_hid_OL.animate-left .popuptext{
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	z-index: 1000;
	width: 50%!important;
	overflow-y: auto;
}
.kapsc_hid_OL.animate-right .popuptext {
	right: 0;
	position: fixed;
	left: 50%;
	top: 0;
	bottom: 0;
	z-index: 1000;
	width: 50%!important;
	overflow-y: auto;
}
.kapsc_hid_OL.animate-center .popuptext{
    position: fixed;
	top: 50%;
	right: 50%!important;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 1000;
}

@media screen and (max-width: 480px) {
}

@media screen and (max-width: 600px) {
	.responsive {
		overflow-x: auto;
	}
	table {
		width: 100% !important;
	}
	.alignright{
		margin-left: initial !important;
	}
	.popup-content {
		width: 100% !important;
	}
	.kapsc_pop_btn{
	    width: 50% !important;
    }
    .kapsc_hid_OL.animate-right .popuptext{
	    width: 100%!important;
    } 
}

div.responsive table thead th {
	background-color: white;
}