/* WooCommerce Consent Products - Frontend Styles */

/* Modal Container */
.wc-consent-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

/* Modal Overlay */
.wc-consent-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

/* Modal Content */
.wc-consent-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

/* Close Button */
.wc-consent-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 32px;
    height: 32px;
    display: inline-block;
    text-align: center;
    transition: all 0.2s ease;
    z-index: 10;
    border-radius: 4px;
    font-family: Arial, sans-serif;
}

.wc-consent-modal-close:hover {
    color: #333333;
    background: #f5f5f5;
}

/* Modal Body */
.wc-consent-modal-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    max-height: calc(90vh - 60px);
}

/* Modal Title */
.wc-consent-modal-title {
    font-size: 22px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 8px 0;
    padding: 0 40px 0 0;
    line-height: 1.3;
}

/* Modal Subtitle */
.wc-consent-modal-subtitle {
    font-size: 15px;
    font-weight: 400;
    color: #64748b;
    margin: 0 0 20px 0;
    padding: 0 40px 0 0;
    line-height: 1.5;
}

/* Message Scroll Container */
.wc-consent-message-scroll {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 25px;
    padding-right: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    background: #f9fafb;
}

.wc-consent-message-scroll::-webkit-scrollbar {
    width: 8px;
}

.wc-consent-message-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.wc-consent-message-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.wc-consent-message-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Message */
.wc-consent-message {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.wc-consent-message p {
    margin-bottom: 15px;
}

.wc-consent-message p:last-child {
    margin-bottom: 0;
}

.wc-consent-message h1,
.wc-consent-message h2,
.wc-consent-message h3,
.wc-consent-message h4,
.wc-consent-message h5,
.wc-consent-message h6 {
    margin-top: 0;
    margin-bottom: 15px;
}

.wc-consent-message ul,
.wc-consent-message ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.wc-consent-message strong {
    font-weight: 600;
}

/* Checkbox Container */
.wc-consent-checkbox-container {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
}

.wc-consent-checkbox-container label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    gap: 12px;
    margin: 0;
}

.wc-consent-checkbox-container input[type="checkbox"] {
    margin: 3px 0 0 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.wc-consent-checkbox-container span {
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    flex: 1;
}

/* Disabled state */
.wc-consent-checkbox-container.wc-consent-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wc-consent-checkbox-container.wc-consent-disabled label {
    cursor: not-allowed;
}

.wc-consent-checkbox-container.wc-consent-disabled input[type="checkbox"] {
    cursor: not-allowed;
}

/* Hidden state */
.wc-consent-checkbox-container {
    transition: opacity 0.4s ease, transform 0.4s ease, max-height 0.4s ease, padding 0.4s ease, margin 0.4s ease;
    transform-origin: top;
    max-height: 200px;
}

.wc-consent-checkbox-container.wc-consent-hidden {
    opacity: 0;
    transform: scaleY(0);
    max-height: 0;
    padding: 0 !important;
    margin: 0 !important;
    border-width: 0 !important;
    overflow: hidden;
    pointer-events: none;
}

/* Scroll Notice */
.wc-consent-scroll-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    color: #856404;
    font-size: 14px;
    margin-bottom: 20px;
    transition: opacity 0.3s ease, max-height 0.3s ease, margin 0.3s ease;
}

.wc-consent-scroll-notice svg {
    flex-shrink: 0;
}

.wc-consent-scroll-notice.hidden {
    opacity: 0;
    max-height: 0;
    margin: 0;
    padding: 0;
    border-width: 0;
    overflow: hidden;
}

/* Actions */
.wc-consent-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.wc-consent-actions .button {
    padding: 12px 24px;
    font-size: 15px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.wc-consent-cancel {
    background: #f5f5f5;
    color: #333;
}

.wc-consent-cancel:hover {
    background: #e0e0e0;
}

.wc-consent-accept {
    background: #2c3e50;
    color: #fff;
}

.wc-consent-accept:hover {
    background: #1a252f;
}

.wc-consent-accept:disabled,
.wc-consent-accept.wc-consent-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Error Message */
.wc-consent-error {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    padding: 12px;
    margin-top: 15px;
    color: #c33;
    font-size: 14px;
}

/* Loading State */
.wc-consent-loading {
    pointer-events: none;
    opacity: 0.6;
}

.wc-consent-loading .wc-consent-accept::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    margin-left: 8px;
    animation: spin 0.6s linear infinite;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .wc-consent-modal-content {
        width: 95%;
        border-radius: 12px;
    }

    .wc-consent-modal-body {
        padding: 20px;
    }

    .wc-consent-modal-title {
        font-size: 18px;
        margin-bottom: 16px;
        padding-right: 35px;
    }

    .wc-consent-message-scroll {
        padding: 16px;
        margin-bottom: 20px;
    }

    .wc-consent-actions {
        flex-direction: column-reverse;
    }

    .wc-consent-actions .button {
        width: 100%;
        text-align: center;
    }

    .wc-consent-checkbox-container {
        padding: 15px;
    }
}

/* Body scroll lock when modal is open */
body.wc-consent-modal-open {
    overflow: hidden;
}