/* Frontend styles for My Package plugin */

/* Search Form */
.my-package-search {
    margin-bottom: 30px;
}
.my-package-search h2 {
    font-size: 20px; /* Decreased from 24px */
    margin-bottom: 15px;
    color: #1a3c6d; /* Match package button color */
}
.search-form-group {
    position: relative;
    width: 100%; /* Full width */
    box-sizing: border-box;
}
#package_search {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}
.search-suggestions.show {
    display: block;
}
.search-suggestion {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}
.search-suggestion:last-child {
    border-bottom: none;
}
.search-suggestion:hover {
    background: #f5f5f5;
}
.search-suggestion .package-type {
    color: #666;
    font-size: 0.9em;
    margin-left: 5px;
}
.my-package-search-form {
    width: 100%; /* Ensure form takes full width */
    box-sizing: border-box;
}

/* Package Grid */
.package-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.package-card {
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
    flex: 1 1 250px; /* Minimum 250px, grow to fill space */
    max-width: calc(33.333% - 14px); /* Adjusted for 3 columns with gap */
    box-sizing: border-box;
}
.package-image-wrapper {
    width: 100%;
    height: 150px;
    overflow: hidden;
}
.package-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.package-content {
    padding: 15px;
}
.package-title {
    font-size: 25px;
    margin: 0 0 10px;
    font-weight: 600;
}
.package-subtitle {
    font-size: 18px;
    color: #666;
    margin: 0 0 10px;
}
.package-price {
    margin: 10px 0;
}
.final-price {
    font-size: 22px;
    font-weight: bold;
    color: #1a3c6d;
}
.sale-price {
    font-size: 18px;
    color: #C70039;
    text-decoration: line-through;
    margin-left: 10px;
}
.discount-percentage {
    font-size: 14px;
    color: #fff;
    margin-left: 10px;
    background: #1a3c6d;
    padding: 2px 6px;
    border-radius: 3px;
}
.no-price {
    font-size: 14px;
    color: #999;
}
.package-button {
    display: inline-block;
    width: auto;
    padding: 10px 20px;
    background: #1a3c6d;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: none;
    text-align: center;
}
.package-button:hover {
    color: #fff;
    background: #1a3c6d;
}
.package-button:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}

/* Package Details */
.my-package-details-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}
.package-details-card {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.package-image-wrapper {
    width: 100%;
    max-width: 300px;
    height: 200px;
    overflow: hidden;
}
.package-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.package-details-content {
    flex: 1;
    min-width: 300px;
}
.package-title {
    font-size: 25px;
    font-weight: 600;
    margin: 0 0 10px;
    color: #333;
}
.package-tests-count {
    font-size: 16px;
    color: #666;
    margin: 0 0 10px;
}
.package-price {
    margin: 10px 0;
}
.final-price {
    font-size: 24px;
    font-weight: bold;
    color: #1a3c6d;
}
.sale-price {
    font-size: 18px;
    color: #C70039;
    text-decoration: line-through;
    margin-left: 10px;
}
.discount-percentage {
    font-size: 14px;
    color: #fff;
    margin-left: 10px;
    background: #1a3c6d;
    padding: 2px 6px;
    border-radius: 3px;
}
.no-price {
    font-size: 14px;
    color: #999;
}
.my-package-details-container .package-button {
    display: block;
    width: 100%;
    padding: 10px 20px;
    background: #1a3c6d;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: none;
    text-align: center;
}
.my-package-details-container .package-button:hover {
    color: #fff;
    background: #1a3c6d;
}
.my-package-details-container .package-button:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}
.package-includes {
    margin: 20px 0;
}
.package-includes h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}
.package-includes ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.package-includes li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}
.package-includes li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #1a3c6d;
    font-size: 18px;
    line-height: 1;
}
.package-type {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}
.package-subtitle {
    font-size: 18px;
    color: #666;
    margin: 0 0 10px;
}
.package-description {
    margin-top: 20px;
}
.package-description h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

/* Responsive Adjustments for Package Details */
@media (max-width: 768px) {
    .package-details-card {
        flex-direction: column;
    }
    .package-image-wrapper {
        max-width: 100%;
        height: 250px;
    }
    .package-details-content {
        min-width: 100%;
    }
}

/* Checkout Page */
.my-package-checkout-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.my-package-checkout-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.my-package-cart-section {
    flex: 2 1 300px;
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #ddd;
}
.my-package-form-section {
    flex: 1 1 200px;
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #ddd;
}
.my-package-cart-table {
    overflow-x: auto;
}
.my-package-cart-table table {
    width: 100%;
    border-collapse: collapse;
}
.my-package-cart-table th, .my-package-cart-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}
.my-package-cart-table th {
    background: #f5f5f5;
}
.cart-item-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
}
.cart-total-label, .cart-total {
    font-weight: bold;
}
.add-more {
    margin-top: 20px;
}
.remove-item {
    color: #e91e63;
    text-decoration: none;
}
.remove-item:hover {
    text-decoration: underline;
}
.my-package-checkout-form .form-group {
    margin-bottom: 15px;
}
.my-package-checkout-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}
.my-package-checkout-form input[type="text"],
.my-package-checkout-form input[type="email"],
.my-package-checkout-form input[type="tel"],
.my-package-checkout-form input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}
.my-package-checkout-form .required {
    color: #e91e63;
}
.form-group.has-error input {
    border-color: #e91e63;
}
.payment-methods {
    margin: 20px 0;
}
.payment-option {
    margin-bottom: 10px;
}
.form-submit {
    margin-top: 20px;
}
.form-submit button {
    background: #1a3c6d;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    text-transform: uppercase;
    transition: none;
}
.form-submit button:hover {
    color: #fff;
    background: #1a3c6d;
}
.my-package-alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}
.my-package-alert-success {
    background: #dff0d8;
    color: #3c763d;
}
.my-package-alert-warning {
    background: #fcf8e3;
    color: #8a6d3b;
}
.my-package-alert-error {
    background: #f2dede;
    color: #a94442;
}
.debug-info {
    margin-top: 20px;
}
.debug-content {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
}

/* Table View for [my_package_test] */
.my-package-table-list {
    margin-bottom: 30px;
}
.my-package-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}
.my-package-table th,
.my-package-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}
.my-package-table th {
    background: #f5f5f5;
    font-weight: bold;
}
.my-package-table td {
    vertical-align: middle;
}
.my-package-table .package-button {
    padding: 8px 16px;
    font-size: 14px;
}

/* Pagination */
.pagination {
    margin-top: 20px;
    text-align: center;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    color: #1a3c6d;
}
.pagination a:hover {
    background: #f5f5f5;
}
.pagination .current {
    background: #1a3c6d;
    color: #fff;
    border-color: #1a3c6d;
}

/* Responsive Styles for Checkout Page */
@media (max-width: 768px) {
    .package-details-card {
        flex-direction: column;
    }
    .package-image-wrapper {
        max-width: 100%;
        height: 250px;
    }
    .package-details-content {
        min-width: 100%;
    }
    .my-package-checkout-container {
        padding: 15px;
    }
    .my-package-checkout-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    .my-package-cart-section, .my-package-form-section {
        padding: 15px;
    }
    .my-package-cart-table th, .my-package-cart-table td {
        padding: 8px;
        font-size: 13px;
    }
    .cart-item-image {
        width: 40px;
        height: 40px;
    }
    .my-package-checkout-form input[type="text"],
    .my-package-checkout-form input[type="email"],
    .my-package-checkout-form input[type="tel"],
    .my-package-checkout-form input[type="file"] {
        padding: 8px;
        font-size: 13px;
    }
    .my-package-checkout-form label {
        font-size: 13px;
    }
    .form-submit button {
        padding: 8px 16px;
        font-size: 14px;
    }
    .my-package-alert {
        padding: 10px;
        font-size: 13px;
    }
    .add-more {
        margin-top: 15px;
    }
}

@media (max-width: 480px) {
    .my-package-checkout-container {
        padding: 10px;
    }
    .my-package-checkout-grid {
        gap: 10px;
    }
    .my-package-cart-section, .my-package-form-section {
        padding: 10px;
    }
    .my-package-cart-table th, .my-package-cart-table td {
        padding: 6px;
        font-size: 12px;
    }
    .cart-item-image {
        width: 30px;
        height: 30px;
    }
    .my-package-checkout-form input[type="text"],
    .my-package-checkout-form input[type="email"],
    .my-package-checkout-form input[type="tel"],
    .my-package-checkout-form input[type="file"] {
        padding: 6px;
        font-size: 12px;
    }
    .my-package-checkout-form label {
        font-size: 12px;
    }
    .form-submit button {
        padding: 6px 12px;
        font-size: 13px;
    }
    .my-package-alert {
        padding: 8px;
        font-size: 12px;
    }
    .my-package-search h2 {
        font-size: 18px;
    }
    #package_search {
        padding: 10px;
        font-size: 14px;
    }
}

/* Responsive Styles for Package Grid */
@media (max-width: 600px) {
    .package-grid {
        flex-direction: column; /* Stack cards vertically */
        gap: 15px;
    }
    .package-card {
        flex: 1 1 100%; /* Full width */
        max-width: 100%; /* Override 33.333% */
        margin: 0; /* Remove any inherited margins */
    }
    .package-image-wrapper {
        height: 200px; /* Larger image for better visibility */
    }
    .package-title {
        font-size: 20px; /* Smaller for mobile */
    }
    .package-subtitle {
        font-size: 16px;
    }
    .final-price {
        font-size: 20px;
    }
    .sale-price {
        font-size: 16px;
        margin-left: 5px;
    }
    .discount-percentage {
        font-size: 12px;
        margin-left: 5px;
    }
    .package-button {
        width: 100%; /* Full-width button */
        padding: 12px; /* Larger padding for touch */
        font-size: 14px;
    }
    .package-content {
        padding: 10px; /* Reduced padding */
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .package-grid {
        gap: 15px;
    }
    .package-card {
        flex: 1 1 calc(50% - 10px); /* Two columns */
        max-width: calc(50% - 10px); /* Adjusted for gap */
    }
    .package-title {
        font-size: 22px;
    }
    .package-subtitle {
        font-size: 17px;
    }
    .final-price {
        font-size: 21px;
    }
    .sale-price {
        font-size: 17px;
    }
    .package-button {
        padding: 10px 15px;
        font-size: 14px;
    }
}