/* wpcbd-frontend.css */

/* Image Blurring and gallery hiding */
.wpcbd-locked-product .woocommerce-product-gallery__image {
    filter: blur(12px) grayscale(50%);
    pointer-events: none;
    transition: filter 0.5s ease;
}

.wpcbd-locked-product .woocommerce-product-gallery .flex-control-nav,
.wpcbd-locked-product .woocommerce-product-gallery .woocommerce-product-gallery__trigger {
    display: none !important;
}

/* Badge Styling */
.wpcbd-lock-badge {
    display: inline-flex;
    align-items: center;
    background: #e74c3c;
    color: #fff;
    font-size: 0.85em;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    margin-right: 10px;
    vertical-align: middle;
}

.wpcbd-lock-badge svg {
    margin-right: 5px;
    fill: currentColor;
}

/* Unlock Container */
.wpcbd-unlock-container {
    background: rgba(0, 0, 0, 0.03); /* Subtle contrast */
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
}

.wpcbd-unlock-info {
    font-size: 0.95em;
    margin-bottom: 20px;
    line-height: 1.6;
}

.wpcbd-unlock-info p:last-child {
    margin-bottom: 0;
}

.wpcbd-unlock-form {
    display: flex;
    flex-direction: column;
}

.wpcbd-unlock-form label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.wpcbd-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.wpcbd-input-group input[type="text"] {
    flex: 1;
    padding: 12px 15px;
    font-size: 1em;
    min-height: 48px; /* Match standard WC button heights */
}

.wpcbd-input-group button {
    margin: 0;
    min-height: 48px; /* Match input height */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Loading State */
.wpcbd-input-group button.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
    color: transparent !important;
}

.wpcbd-input-group button.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    border: 3px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: wpcbd-spin 1s ease infinite;
}

@keyframes wpcbd-spin {
    from { transform: rotate(0turn); }
    to { transform: rotate(1turn); }
}

/* Messages */
.wpcbd-message {
    margin-top: 15px;
    font-size: 0.9em;
    font-weight: 500;
    display: none;
    padding: 10px;
    border-radius: 6px;
}

.wpcbd-message.error {
    display: block;
    background: #fdf0ed;
    color: #e74c3c;
    border: 1px solid #fadbd8;
}

.wpcbd-message.success {
    display: block;
    background: #edf7ed;
    color: #2ecc71;
    border: 1px solid #d5f5e3;
}


/* Skeleton Loading for AJAX Replacement */
.wpcbd-skeleton {
    animation: wpcbd-skeleton-loading 1s linear infinite alternate;
    background: #eee;
    border-radius: 4px;
    height: 20px;
    margin-bottom: 10px;
}
.wpcbd-skeleton.btn {
    height: 45px;
    width: 150px;
}

@keyframes wpcbd-skeleton-loading {
    0% { background-color: hsl(200, 20%, 90%); }
    100% { background-color: hsl(200, 20%, 95%); }
}
