/* Birth List Search Form */
.cbl-search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cbl-main-title {
    font-size: 2.5em;
    font-weight: 400;
    color: #333;
    margin: 0 0 30px 0;
    text-align: left;
}

/* Hero Section with Card and Image */
.cbl-search-hero {
    display: flex;
    gap: 0;
    align-items: stretch;
    margin-bottom: 50px;
    position: relative;
}

.cbl-search-card {
    flex: 1;
    background: linear-gradient(135deg, #C8E6F5 0%, #7DB9DE 100%);
    clip-path: polygon(0 0, 95% 0, 100% 100%, 0 100%);
    padding: 60px 80px 60px 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.cbl-card-title {
    font-size: 2.5em;
    font-weight: 400;
    color: #5DADE2;
    margin: 0 0 30px 0;
    text-align: left;
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

.cbl-search-image {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-left: -40px;
    position: relative;
    z-index: 2;
}

.cbl-search-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cbl-search-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cbl-search-field {
    width: 100%;
    padding: 14px 18px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cbl-search-field::placeholder {
    color: #999;
}

.cbl-search-field:focus {
    outline: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.cbl-search-submit {
    padding: 14px 30px;
    border: 2px solid #D32F2F;
    background: #D32F2F;
    color: white;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.25);
    text-transform: none;
}

.cbl-search-submit:hover {
    background: #B71C1C;
    border-color: #B71C1C;
    box-shadow: 0 3px 8px rgba(211, 47, 47, 0.35);
}

.cbl-search-submit:active {
    transform: translateY(1px);
}

.cbl-help-section {
    margin-top: 20px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
}

.cbl-help-section h2 {
    color: #333;
    font-size: 1.6em;
    margin-bottom: 15px;
    font-weight: 500;
}

.cbl-help-section p {
    color: #555;
    font-size: 16px;
    line-height: 1.7;
    margin: 0;
}
.cbl-search-results ul {
    list-style: none;
    padding: 0;
}
.cbl-search-results li a {
    display: block;
    padding: 10px;
    border: 1px solid #eee;
    margin-bottom: 5px;
    text-decoration: none;
}
.cbl-search-results li a:hover {
    background: #f9f9f9;
}

/* Single Birth List View */
.cbl-product-list {
    list-style: none;
    padding: 0;
    margin: 2em 0;
}
.cbl-product-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #eee;
}
.cbl-product-item.purchased {
    opacity: 0.6;
    background-color: #f9f9f9;
}
.cbl-product-item.reserved .cbl-reserved-label {
    font-weight: bold;
    color: #8a6d3b;
    background: #fcf8e3;
    padding: 10px;
    border-radius: 4px;
    display: inline-block;
}
.cbl-item-image {
    width: 100px;
    flex-shrink: 0;
}
.cbl-item-image img {
    width: 100%;
    height: auto;
}
.cbl-item-details {
    flex-grow: 1;
}
.cbl-item-title {
    margin: 0 0 10px;
}
.cbl-item-action {
    width: 180px;
    text-align: center;
}
/* Make status badges consistent size */
.cbl-purchased-label,
.cbl-reserved-label {
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 130px;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 4px;
    box-sizing: border-box;
}
.cbl-purchased-label {
    color: #3c763d;
    background: #dff0d8;
}
.cbl-reserved-label {
    color: #8a6d3b;
    background: #fcf8e3;
}

/* Additional Gifts Section */
.cbl-additional-gifts {
    margin-top: 3em;
    padding-top: 2em;
}

.cbl-gift-option {
    margin-bottom: 2em;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
}

.cbl-gift-option h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.cbl-gift-option p {
    margin-bottom: 15px;
    color: #666;
}

/* Greeting Card Form */
.cbl-card-message {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
    font-family: inherit;
    resize: vertical;
}

/* Gift Voucher Form */
.cbl-voucher-amount-section {
    margin-bottom: 20px;
}

.cbl-voucher-amount-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

.cbl-amount-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cbl-preset-amounts {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cbl-amount-preset {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.cbl-amount-preset:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.cbl-amount-preset.active {
    border-color: #0073aa;
    background: #0073aa;
    color: #fff;
}

.cbl-custom-amount {
    display: flex;
    align-items: center;
    gap: 5px;
    max-width: 150px;
}

.cbl-custom-amount span {
    font-weight: bold;
    font-size: 18px;
}

.cbl-custom-amount input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
}

.cbl-voucher-message-section {
    margin-bottom: 20px;
}

.cbl-voucher-message-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

#cbl_voucher_message {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
}

/* Button States */
.button.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.button.added {
    background: var(--e-global-color-primary, #5abad6) !important;
    border-color: var(--e-global-color-primary, #5abad6) !important;
    color: #fff !important;
}

/* Keep add-to-cart and added buttons same width to avoid layout shift */
.button.added,
.button.add_to_cart_button {
    min-width: 170px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

/* Parents View Styles */
.cbl-parents-actions {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.cbl-share-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Make share buttons visually consistent with theme buttons */
.cbl-share-buttons .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 4px !important;
    line-height: 1.2;
    font-weight: 500;
    border: 1px solid transparent;
}

.cbl-whatsapp {
    background-color: #25D366 !important;
    color: white !important;
    border-color: #25D366 !important;
    border-radius: 4px !important;
}

.cbl-facebook {
    background-color: #1877F2 !important;
    color: white !important;
    border-color: #1877F2 !important;
    border-radius: 4px !important;
}

.cbl-parents-product-table,
.cbl-parents-voucher-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.cbl-parents-product-table th,
.cbl-parents-product-table td,
.cbl-parents-voucher-table th,
.cbl-parents-voucher-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.cbl-parents-product-table th,
.cbl-parents-voucher-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.cbl-product-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cbl-product-info img {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

.cbl-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.cbl-status.purchased {
    background-color: #d4edda;
    color: #155724;
}

.cbl-status.reserved {
    background-color: #fff3cd;
    color: #856404;
}

.cbl-status.available {
    background-color: #e2e3e5;
    color: #383d41;
}

.cbl-status.committed {
    background-color: #cce5ff;
    color: #004085;
}

.cbl-password-form {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.cbl-password-form input[type="password"] {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
}

/* All purchased notice */
.cbl-all-purchased-notice {
    background-color: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.cbl-all-purchased-notice h3 {
    color: #2e7d32;
    margin-top: 0;
}

/* Ensure Woo "View cart" link drops below the add-to-cart button */
.added_to_cart.wc-forward {
    display: block !important;
    margin-top: 8px;
    width: 100%;
}

.cbl-scroll-to-voucher {
    color: #1976d2;
    text-decoration: none;
    font-weight: bold;
}

.cbl-scroll-to-voucher:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cbl-main-title {
        font-size: 2em;
        margin-bottom: 20px;
    }
    
    .cbl-search-hero {
        flex-direction: column;
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .cbl-search-card {
        padding: 30px 25px;
        clip-path: none;
        border-radius: 12px;
    }
    
    .cbl-card-title {
        font-size: 1.8em;
        margin-bottom: 20px;
    }
    
    .cbl-search-image {
        height: 250px;
        margin-left: 0;
    }
    
    .cbl-search-form {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    
    .cbl-search-field {
        width: 100%;
        padding: 12px 15px;
    }
    
    .cbl-search-submit {
        width: 100%;
        padding: 12px 20px;
    }
    
    .cbl-help-section {
        margin-top: 20px;
        padding: 20px;
    }
    
    .cbl-help-section h2 {
        font-size: 1.3em;
    }
    
    .cbl-product-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px;
    }

    .cbl-item-action {
        width: 100%;
    }

    .cbl-item-image {
        align-self: center;
        order: -1; /* Move image to top */
    }

    .cbl-item-image img {
        max-width: 150px;
        height: auto;
    }

    .cbl-item-details {
        order: 0;
    }

    .cbl-preset-amounts {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .cbl-preset-amounts .button {
        flex: 1;
        min-width: 80px;
        margin: 2px;
    }

    .cbl-amount-options {
        align-items: center;
        flex-direction: column;
        gap: 15px;
    }

    .cbl-custom-amount {
        max-width: 200px;
        margin: 0 auto;
    }

    .cbl-custom-amount input {
        width: 100%;
        text-align: center;
    }
}

/* Tablet and larger screens - keep tables */
@media (min-width: 769px) {
    .cbl-parents-product-table,
    .cbl-parents-voucher-table {
        width: 100%;
        border-collapse: collapse;
    }

    .cbl-parents-product-table th,
    .cbl-parents-product-table td,
    .cbl-parents-voucher-table th,
    .cbl-parents-voucher-table td {
        padding: 12px 8px;
        border: 1px solid #ddd;
    }
}

/* Cart Layout Fix for Birth List Items */
.elementor-menu-cart__product .variation {
    display: block !important;
    grid-template-columns: none !important;
    margin: 10px 0;
}

.elementor-menu-cart__product .variation dt {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--product-variations-color, #1f2124);
}

.elementor-menu-cart__product .variation dd {
    display: block;
    margin: 0 0 10px 0;
    padding: 0;
}

.elementor-menu-cart__product .variation dd p {
    margin: 0;
    padding: 0;
}

/* Mobile and small tablets - use cards */
@media (max-width: 768px) {
    .cbl-parents-product-table,
    .cbl-parents-voucher-table {
        display: block;
        overflow-x: visible;
        white-space: normal;
    }

    .cbl-parents-product-table thead,
    .cbl-parents-voucher-table thead {
        display: none;
    }

    .cbl-parents-product-table tbody,
    .cbl-parents-voucher-table tbody {
        display: block;
    }

    .cbl-parents-product-table tr,
    .cbl-parents-voucher-table tr {
        display: block;
        border: 1px solid #ddd;
        margin-bottom: 20px;
        padding: 20px;
        border-radius: 12px;
        background: #f9f9f9;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .cbl-parents-product-table td,
    .cbl-parents-voucher-table td {
        display: block;
        text-align: left;
        border: none;
        padding: 8px 0;
        position: relative;
        padding-left: 0;
    }

    /* Product info card styling */
    .cbl-parents-product-table td[data-label="Product"] {
        margin-bottom: 15px;
        padding-bottom: 15px;
        border-bottom: 1px solid #e0e0e0;
    }

    .cbl-product-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        text-align: center;
    }

    .cbl-product-info img {
        width: 80px;
        height: 80px;
        object-fit: cover;
        border-radius: 8px;
        order: -1; /* Move image to top */
    }

    .cbl-product-info div {
        flex: 1;
        order: 0;
    }

    /* Hide "Product:" label for product info */
    .cbl-parents-product-table td[data-label="Product"]:before {
        display: none;
    }

    /* Show labels for other fields */
    .cbl-parents-product-table td:not([data-label="Product"]):before,
    .cbl-parents-voucher-table td:before {
        content: attr(data-label) ": ";
        font-weight: bold;
        color: #333;
        display: inline-block;
        min-width: 80px;
        margin-right: 10px;
    }

    /* Status badges in cards */
    .cbl-status {
        display: inline-block;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: bold;
        text-transform: uppercase;
    }

    /* Parents actions responsive */
    .cbl-parents-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        padding: 20px;
    }

    .cbl-share-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .cbl-share-buttons .button {
        flex: 1;
        min-width: 120px;
        margin: 2px;
        padding: 10px 15px;
        text-align: center;
    }

    /* Copy link button */
    .cbl-copy-link-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .cbl-copy-link-container input {
        width: 100%;
        max-width: 300px;
        text-align: center;
        font-size: 14px;
    }
}