/* =============================================================================
   MetaMorphe LMS — Unlock Button & Modal Styles
   [mmlms_unlock_button]
   Butterfly design system: cyan · green · pink · yellow — warm neutral palette
   ============================================================================= */

/* =============================================================================
   Unlock Button
   ============================================================================= */

.mmlms-unlock-button {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 9px 20px !important;
    background: #4ec0d8 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 999px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    font-family: "Inter", system-ui, sans-serif !important;
    cursor: pointer !important;
    transition: opacity 0.18s ease !important, transform 0.18s ease !important;
    box-shadow: 0 2px 8px rgba(78,192,216,0.3) !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    width: auto !important;
    letter-spacing: 0.01em !important;
}

.mmlms-unlock-button:hover {
    opacity: 0.88 !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(78,192,216,0.38) !important;
}

.mmlms-unlock-button .dashicons {
    width: 18px !important;
    height: 18px !important;
    font-size: 18px !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.mmlms-unlock-button .dashicons::before { line-height: 1 !important; }

/* Homepage wrapper */
.mmlms-module-unlock-wrapper {
    padding: 14px 18px;
    border-top: 1px solid #e7e4df;
    margin-top: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mmlms-unlock-button-homepage { justify-content: center; }

/* =============================================================================
   Modal overlay
   ============================================================================= */

.mmlms-unlock-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    font-family: "Inter", system-ui, sans-serif;
}

.mmlms-unlock-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(28, 26, 23, 0.55);
    backdrop-filter: blur(4px);
}

/* =============================================================================
   Modal container
   ============================================================================= */

.mmlms-unlock-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(28,26,23,0.06), 0 16px 40px -12px rgba(28,26,23,0.18);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* =============================================================================
   Modal header
   ============================================================================= */

.mmlms-unlock-modal-header {
    padding: 22px 26px;
    border-bottom: 1px solid #e7e4df;
    background: #e0f1f5;
}

.mmlms-unlock-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #1d6e80;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* =============================================================================
   Close button
   ============================================================================= */

.mmlms-unlock-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    border: 1px solid #b4dde6;
    background: rgba(255,255,255,0.7);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    z-index: 10;
}

.mmlms-unlock-modal-close:hover {
    background: #4ec0d8;
    border-color: #4ec0d8;
    transform: rotate(90deg);
}

.mmlms-unlock-modal-close:hover .dashicons { color: #fff; }

.mmlms-unlock-modal-close .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
    color: #1d6e80;
    transition: color 0.18s ease;
}

/* =============================================================================
   Modal body
   ============================================================================= */

.mmlms-unlock-modal-body {
    padding: 26px;
    overflow-y: auto;
    flex: 1;
}

/* =============================================================================
   Loading state
   ============================================================================= */

.mmlms-unlock-loading {
    text-align: center;
    padding: 56px 20px;
}

.mmlms-unlock-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #efece7;
    border-top: 3px solid #4ec0d8;
    border-radius: 50%;
    animation: mmlms-spin 0.9s linear infinite;
    margin: 0 auto 16px;
}

@keyframes mmlms-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mmlms-unlock-loading p {
    color: #807a72;
    font-size: 14px;
    margin: 0;
}

/* =============================================================================
   Products grid
   ============================================================================= */

.mmlms-unlock-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

/* =============================================================================
   Product card
   ============================================================================= */

.mmlms-unlock-product-card {
    background: #fff;
    border: 1px solid #e7e4df;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    display: flex;
    flex-direction: column;
}

.mmlms-unlock-product-card:hover {
    box-shadow: 0 2px 4px rgba(28,26,23,.04), 0 8px 24px -8px rgba(28,26,23,.12);
    transform: translateY(-3px);
}

.mmlms-unlock-product-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f6f3ee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mmlms-unlock-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mmlms-unlock-product-info {
    padding: 18px;
    flex: 1;
}

.mmlms-unlock-product-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
    color: #1c1a17;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.mmlms-unlock-product-description {
    font-size: 13px;
    color: #807a72;
    line-height: 1.55;
    margin-bottom: 12px;
}

.mmlms-unlock-product-price {
    font-size: 20px;
    font-weight: 700;
    color: #1d6e80;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

/* =============================================================================
   Product actions
   ============================================================================= */

.mmlms-unlock-product-actions {
    padding: 14px 18px;
    border-top: 1px solid #e7e4df;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mmlms-buy-now-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 18px;
    background: #8fcc5a;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    font-family: "Inter", system-ui, sans-serif;
    cursor: pointer;
    transition: opacity 0.18s ease, transform 0.18s ease;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(143,204,90,0.3);
}

.mmlms-buy-now-button:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.mmlms-buy-now-button .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.mmlms-product-details-link {
    text-align: center;
    color: #1d6e80;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px;
    transition: color 0.18s ease;
}

.mmlms-product-details-link:hover {
    color: #4ec0d8;
    text-decoration: underline;
}

.mmlms-product-unavailable {
    text-align: center;
    color: #a8a39a;
    font-style: italic;
    padding: 10px;
    font-size: 13px;
}

/* =============================================================================
   Error state
   ============================================================================= */

.mmlms-unlock-error {
    text-align: center;
    padding: 56px 20px;
    color: #9c2f51;
}

.mmlms-unlock-error .dashicons {
    font-size: 52px;
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
}

.mmlms-unlock-error p { font-size: 14px; margin: 0; }

/* =============================================================================
   Body scroll lock
   ============================================================================= */

body.mmlms-modal-open { overflow: hidden; }

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 768px) {
    .mmlms-unlock-modal-content { width: 95%; max-height: 90vh; }
    .mmlms-unlock-modal-header  { padding: 18px; }
    .mmlms-unlock-modal-header h2 { font-size: 17px; padding-right: 38px; }
    .mmlms-unlock-modal-body    { padding: 18px; }
    .mmlms-unlock-products-grid { grid-template-columns: 1fr; gap: 16px; }
    .mmlms-unlock-product-image { height: 140px; }
    .mmlms-unlock-modal-close   { top: 14px; right: 14px; width: 32px; height: 32px; }
}

@media (max-width: 480px) {
    .mmlms-unlock-button     { padding: 8px 16px !important; font-size: 12px !important; }
    .mmlms-module-unlock-wrapper { padding: 10px 14px; }
    .mmlms-unlock-modal-header h2 { font-size: 15px; }
    .mmlms-unlock-product-title   { font-size: 15px; }
    .mmlms-unlock-product-price   { font-size: 17px; }
}
