/* Form styling */
.codcheckout-form-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif !important;
    max-width: 600px !important;
    margin: 20px auto !important;
    padding: 30px !important;
    background-color: #ffffff !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
}

.codcheckout-form {
    margin: 0 !important;
    padding: 0 !important;
}

.codcheckout-form label {
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
    color: #333333 !important;
    font-size: 14px !important;
}

.codcheckout-form .required {
    color: #e2401c !important;
}

.codcheckout-form .woocommerce-input-wrapper {
    display: block !important;
    width: 100% !important;
}

.codcheckout-form .form-row {
    padding: 0 !important;
}

.codcheckout-form .form-row-first,
.codcheckout-form .form-row-last {
    width: 48% !important;
    float: left !important;
}

.codcheckout-form .form-row-last {
    float: right !important;
}

.codcheckout-form input[type="text"],
.codcheckout-form input[type="email"],
.codcheckout-form input[type="tel"],
.codcheckout-form input[type="password"],
.codcheckout-form select,
.codcheckout-form textarea {
    width: 100% !important;
    padding: 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background-color: #f8f8f8 !important;
    font-size: 14px !important;
    color: #333333 !important;
    transition: border-color 0.3s ease, background-color 0.3s ease !important;
}

.codcheckout-form input[type="text"]:focus,
.codcheckout-form input[type="email"]:focus,
.codcheckout-form input[type="tel"]:focus,
.codcheckout-form input[type="password"]:focus,
.codcheckout-form select:focus,
.codcheckout-form textarea:focus {
    border-color: #0073aa !important;
    background-color: #ffffff !important;
    outline: none !important;
}

.codcheckout-form .button {
    width: 100% !important;
    padding: 15px 20px !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: background-color 0.3s ease, transform 0.1s ease !important;
}

.codcheckout-form .button:hover {
    transform: translateY(-1px) !important;
}

.codcheckout-form .button:active {
    transform: translateY(1px) !important;
}

.codcheckout-popup-trigger{
    margin-top: 15px !important;
}

.codcheckout-terms-conditions {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
}

.codcheckout-terms-conditions label {
    display: inline-block !important;
    margin-left: 5px !important;
    font-weight: normal !important;
}

.codcheckout-form input[type="checkbox"] {
    margin-right: 5px !important;
}

/* COD Checkout Form Message Styling*/
.codcheckout-cart-message {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.codcheckout-cart-message .button {
    margin: 10px 5px;
}

/* Sticky Bar styling */
.codcheckout-sticky-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background-color: #ffffff !important;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important;
    z-index: 9999 !important;
    transition: transform 0.3s ease-in-out !important;
    transform: translateY(100%) !important;
    padding: 15px !important;
}

.codcheckout-sticky-bar.visible {
    transform: translateY(0) !important;
}

.codcheckout-sticky-bar-content {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
}

.codcheckout-product-info {
    display: flex !important;
    align-items: center !important;
    flex: 1 !important;
    min-width: 0 !important; /* Allows text to truncate */
}

.codcheckout-product-info h3 {
    margin: 0 15px 0 0 !important;
    font-size: 16px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 50% !important;
}

.codcheckout-product-info .price {
    font-weight: bold !important;
    white-space: nowrap !important;
    margin-left: auto !important;
}

.codcheckout-sticky-button {
    padding: 10px 20px !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    transition: opacity 0.3s ease !important;
    margin-left: 15px !important;
    white-space: nowrap !important;
}

.codcheckout-sticky-button:hover {
    opacity: 0.9 !important;
}

/* Thank You Page Styling */
.codcheckout-thank-you-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

.codcheckout-order-summary {
    width: 100%;
    border-collapse: collapse;
}

.codcheckout-order-summary th,
.codcheckout-order-summary td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.codcheckout-order-summary thead {
    background-color: #f8f8f8;
}

.codcheckout-order-summary tfoot {
    font-weight: bold;
}

.codcheckout-next-steps {
    margin-left: 20px;
}

/* Form Responsive styling */
@media (max-width: 768px) {
    .codcheckout-form-container {
        padding: 20px !important;
    }
    .codcheckout-form .form-row-first,
    .codcheckout-form .form-row-last {
        width: 100% !important;
        float: none !important;
    }
    .codcheckout-sticky-bar-content {
        flex-wrap: wrap !important;
    }

    .codcheckout-product-info {
        width: 100% !important;
        margin-bottom: 10px !important;
    }
    .codcheckout-product-info h3 {
        max-width: 70% !important;
    }

    .codcheckout-sticky-button {
        width: 100% !important;
        margin-left: 0 !important;
    }
}

/*new elements styling*/
.codcheckout-order-summary {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.codcheckout-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.codcheckout-summary-header h3 {
    margin: 0;
    font-size: 16px;
}

.codcheckout-summary-toggle {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
}

.codcheckout-summary-content {
    padding: 15px;
    display: none;
}

.codcheckout-order-summary.active .codcheckout-summary-content {
    display: block;
}

.codcheckout-summary-table {
    width: 100%;
    margin-bottom: 0;
}

.codcheckout-summary-table td {
    padding: 8px 0;
}

.codcheckout-summary-table td:last-child {
    text-align: right;
}

.codcheckout-summary-table tr.total {
    border-top: 1px solid #ddd;
    font-weight: bold;
}

/* Whatsapp Styling */
.codcheckout-whatsapp-widget {
    position: fixed;
    z-index: 9999;
    transition: all 0.3s ease;
}

.codcheckout-whatsapp-widget.bottom-right {
    bottom: 20px;
    right: 20px;
}

.codcheckout-whatsapp-widget.bottom-left {
    bottom: 20px;
    left: 20px;
}

.codcheckout-whatsapp-widget.top-right {
    top: 20px;
    right: 20px;
}

.codcheckout-whatsapp-widget.top-left {
    top: 20px;
    left: 20px;
}

.codcheckout-whatsapp-button {
    display: block;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.codcheckout-whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}

.codcheckout-whatsapp-button .whatsapp-icon {
    width: 35px;
    height: 35px;
    fill: white;
    margin: 12.5px;
}

.codcheckout-whatsapp-order {
    margin: 20px 0;
    text-align: center;
}

.codcheckout-whatsapp-order-button {
    background-color: #25D366 !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

.codcheckout-whatsapp-order-button:hover {
    background-color: #22c15e !important;
    transform: translateY(-1px) !important;
}

/*styling for compatibility with different themes, Remove it with caution*/
.woocommerce form .form-row{margin: 0px !important;}

/* Popup Modal Styles */
body.codcheckout-modal-open {
    overflow: hidden; /* Prevent background scroll when modal is open */
}

#codcheckout-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent black overlay */
    z-index: 10000; /* Ensure overlay is above other content */
    cursor: pointer;
}

#codcheckout-modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 650px; /* Max width for the modal */
    max-height: 90vh; /* Max height */
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 10001; /* Ensure modal is above overlay */
    overflow: hidden; /* Hide overflow initially */
}

#codcheckout-modal-content {
    padding: 30px;
    overflow-y: auto; /* Allow scrolling within the content */
    max-height: calc(90vh - 60px); /* Adjust max-height based on padding */
}

#codcheckout-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #aaa;
    cursor: pointer;
    padding: 5px;
}

#codcheckout-modal-close:hover {
    color: #333;
}

/* Adjust form styles within the modal if necessary */
#codcheckout-modal-content .codcheckout-form-container {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* Responsive adjustments for modal */
@media (max-width: 768px) {
    #codcheckout-modal-container {
        width: 95%;
        max-height: 85vh;
    }
    #codcheckout-modal-content {
        padding: 20px;
        max-height: calc(85vh - 50px);
    }
}
