/* eSIM table */

/* Vendor Logo Positioning */
.vendor-logo-tab-wrapper {
    position: absolute;
    top: -35px;
    right: 0;
    background: white;
    padding: 0.25em 0.5em;
    z-index: 10;
    border: 1px solid #ccc;
    border-bottom: none;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.vendor-logo-tab {
    max-height: 35px;
    display: block;
    margin: 0 auto;
}

/* General Styles */
.esim-header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.esim-header-controls label {
    font-size: 18px; 
}

.esim-header-controls .dropdown-wrapper {
  display: flex;
  align-items: center; 
  gap: 10px; 
}

.esim-header-controls .dropdown-wrapper select {
    width: 13ch; /* Approx 13 characters wide */
  }

.multi-country-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.multi-country-toggle .switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}

.multi-country-toggle .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.multi-country-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 50px;
}

.multi-country-toggle .slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    border-radius: 50%;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
}

.multi-country-toggle input:checked + .slider {
    background-color: var(--global-palette1);
}

.multi-country-toggle input:checked + .slider:before {
    transform: translateX(14px);
}

.multi-country-toggle .toggle-label {
    font-size: 14px;
    color: #333;
}

/* Dropdown Styles */
#esim-vendor-select {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: white;
    width: 13ch; 
    max-width: 100%;
}

/* Vendor Tables */
.vendor-table {
    position: relative;
    padding-top: 0.6em;
}

/* Tables within each vendor's section */
.esim-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 16px;   
}

.esim-table th,
.esim-table td {

  border-right: none;
  padding: 10px;
  text-align: center; 
  vertical-align: middle;
}

.esim-table th {
    background-color: #f4f4f4;
}

.esim-table th:last-child,
.esim-table td:last-child {
  border-right: none;
}

/* Default border for rows */
.esim-table tr {
  border-bottom: 1px solid #ddd;
}

/* Remove bottom gridline when sub-row is visible */
.esim-table tr.has-sub-row-visible {
  border-bottom: none !important;
}

/* Add a bottom gridline for rows with data-multi="1", but only if sub-row is not visible */
.esim-table tr[data-multi="1"]:not(.has-sub-row-visible) {
  border-bottom: 1px solid #ccc !important; /* Or the appropriate border color */
}

/* Remove the top gridline from sub-rows */
.esim-table .mobile-sub-row {
  border-top: none !important;
}

/* Collapse spacing between main row and sub-row */
.esim-table .mobile-sub-row {
  padding-top: 0 !important;
  line-height: 1.2; 
}

.esim-table .mobile-sub-row td {
  padding-top: 4px !important;
  padding-bottom: 10px !important;
}

/* Hide sub-rows by default */
tr.mobile-sub-row {
  display: none;
  font-size: 14px; /* slightly smaller than the main row */
}



/* Button Styles */
.buy-esim-btn {
    display: inline-block;
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    text-align: center;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    box-sizing: border-box;
    border: none;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
}

.buy-esim-btn svg {
    display: inline;
    vertical-align: middle;
    margin-left: 0.4em;
    white-space: nowrap;
}

.buy-esim-btn span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.price-button {
  display: inline-block;
  width: 80px; /* Adjust based on your longest expected price */
  text-align: center;
  padding: 6px 0;
  background-color: #718096;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s ease;
  box-sizing: border-box;
}

.price-button:hover {
  background-color: #4A5568;
  color: #fff;	
}

.price-button:focus {
  color: #fff;	
}

.price-button:visited {
  color: #fff;
}

/* Table Styling for Multi-Country Slider */
.multi-country-table {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.multi-country-table .esim-table {
    width: auto;
    min-width: 300px;
}

.multi-country-table .esim-table td,
.multi-country-table .esim-table th {
    text-align: left;
}

/* Mobile Layout Adjustments */
@media (max-width: 768px) {
    .esim-header-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .multi-country-toggle {
        margin-bottom: 15px;
    }

    #esim-vendor-select {
        width: 100%;
        flex: 1;
    }

    .multi-country-table {
        flex-direction: column;
    }

    .multi-country-table .esim-table {
        width: 100%;
    }

    .dropdown-wrapper {
        width: 100%;
    }

    .esim-table {
        table-layout: fixed;
    }
	
	.esim-table tr:not(.mobile-sub-row) th:nth-child(2),
	.esim-table tr:not(.mobile-sub-row) td:nth-child(2) {
		display: none;
	}

    /* Emoji in the new first column (td:first-child) */
    .esim-table tr td:first-child,
    .esim-table tr th:first-child {
        width: 1px;
        min-width: 1px;
        max-width: 1px;
        position: relative;
        padding: 0;
        visibility: visible;
		padding-right: 10px;
    }
	
    .esim-table tr.has-sub-row-visible {
        border-bottom: none !important;
    }

	tr.mobile-sub-row.show-on-mobile {
		display: table-row;
	}

	
    .mobile-product-name {
        font-size: 12px;
        padding-left: 15px;
        color: #555;
    }

    .esim-table td,
    .esim-table th {
        font-size: 14px;
    }
}


  .esim-header-controls .dropdown-wrapper select {
    flex-grow: 1;
    width: 100%;
  }

.esim-table-wrapper {
	padding-bottom: 32px;
}

.esim-table td:first-child {
    text-align: right;
    min-width: 3.5ch;
    padding-right: 4px;
    white-space: nowrap;
}

.esim-table td.mobile-product-name {
	text-align: center;
}

@media (min-width: 768px) {
  .esim-table th:first-child,
  .esim-table td:first-child {
    display: none;
  }
  
   .esim-table td.product-name::before {
    content: attr(data-icon);
    margin-right: 4px;
    display: inline-block;
    vertical-align: middle;
	font-size: 20px;
  }
}

 