/* =========================================================
   CLOUDRIGHT CHECKOUT
   Magento 2 version using the WooCommerce visual design
   ========================================================= */

/* =========================================================
   RESET / BASE
   ========================================================= */

#cloudright-modal-root,
#cloudright-modal-root * {
    box-sizing: border-box;
}

#cloudright-modal-root {
    position: fixed;
    inset: 0;
    z-index: 999999;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
}

/* =========================================================
   OVERLAY
   ========================================================= */

.cloudright-modal-overlay {
    position: fixed;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background: rgba(15, 23, 42, 0.68);

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);

    overflow-y: auto;
}

/* =========================================================
   MAIN MODAL
   ========================================================= */

.cloudright-modal {
    width: min(575px, 100%);
    max-height: calc(100vh - 48px);

    overflow-y: auto;

    background: #ffffff;

    border-radius: 18px;

    box-shadow:
        0 25px 65px rgba(0, 0, 0, 0.24),
        0 8px 25px rgba(0, 0, 0, 0.12);

    border: 1px solid rgba(15, 23, 42, 0.08);

    animation: cloudright-modal-in 0.22s ease-out;
}

@keyframes cloudright-modal-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =========================================================
   TOP BAR
   ========================================================= */

.cloudright-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 14px 17px;

    background: linear-gradient(
        135deg,
        #111827,
        #1f2937
    );

    color: #ffffff;

    border-radius: 18px 18px 0 0;
}

.cloudright-brand-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cloudright-brand-mark {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: linear-gradient(
        135deg,
        #2563eb,
        #7c3aed
    );

    color: #ffffff;

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.5px;

    box-shadow:
        0 5px 15px rgba(37, 99, 235, 0.3);
}

.cloudright-brand-content {
    display: flex;
    flex-direction: column;
}

.cloudright-brand-name {
    color: #ffffff;

    font-size: 15px;
    font-weight: 700;

    line-height: 1.2;
}

.cloudright-brand-caption {
    margin-top: 2px;

    color: #cbd5e1;

    font-size: 10px;
    font-weight: 500;
}

.cloudright-modal-close {
    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;

    padding: 0;

    border: 0;
    border-radius: 8px;

    background: rgba(255, 255, 255, 0.08);

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.cloudright-modal-close:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: scale(1.04);
}

.cloudright-modal-close span {
    position: absolute;

    width: 14px;
    height: 2px;

    border-radius: 2px;

    background: #ffffff;
}

.cloudright-modal-close span:first-child {
    transform: rotate(45deg);
}

.cloudright-modal-close span:last-child {
    transform: rotate(-45deg);
}

/* =========================================================
   PROGRESS
   ========================================================= */

.cloudright-progress {
    display: flex;
    align-items: center;

    padding: 11px 17px;

    background: #f8fafc;

    border-bottom: 1px solid #e5e7eb;
}

.cloudright-progress-step {
    display: flex;
    align-items: center;

    gap: 6px;

    white-space: nowrap;
}

.cloudright-step-number {
    width: 22px;
    height: 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #e5e7eb;

    color: #64748b;

    font-size: 10px;
    font-weight: 700;
}

.cloudright-progress-step.active .cloudright-step-number,
.cloudright-progress-step.completed .cloudright-step-number,
.cloudright-progress-step.is-active .cloudright-step-number {
    background: linear-gradient(
        135deg,
        #2563eb,
        #4f46e5
    );

    color: #ffffff;
}

.cloudright-step-label {
    color: #64748b;

    font-size: 10px;
    font-weight: 600;
}

.cloudright-progress-step.active .cloudright-step-label,
.cloudright-progress-step.completed .cloudright-step-label,
.cloudright-progress-step.is-active .cloudright-step-label {
    color: #1e293b;
}

.cloudright-progress-line {
    flex: 1;

    height: 1px;

    margin: 0 8px;

    background: #e2e8f0;
}

.cloudright-progress-line.active {
    background: #6366f1;
}

/* =========================================================
   PANELS
   ========================================================= */

.cloudright-panel {
    display: none;
}

.cloudright-panel.is-active {
    display: block;
}

/* =========================================================
   ACCOUNT BODY
   ========================================================= */

.cloudright-account-layout {
    display: block;

    padding: 19px;
}

.cloudright-account-content {
    width: 100%;
    max-width: 410px;

    margin: 0 auto;
}

.cloudright-welcome {
    display: flex;
    align-items: flex-start;

    gap: 10px;

    margin-bottom: 15px;
}

.cloudright-welcome-icon {
    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: #eef2ff;

    font-size: 17px;
}

.cloudright-welcome h2 {
    margin: 0 0 4px;

    color: #111827;

    font-size: 17px;
    line-height: 1.25;
    font-weight: 750;
}

.cloudright-welcome p {
    margin: 0;

    color: #64748b;

    font-size: 11px;
    line-height: 1.45;
}

/* =========================================================
   FORM
   ========================================================= */

.cloudright-account-form {
    width: 100%;
}

.cloudright-form-heading {
    margin: 12px 0 14px;
}

.cloudright-form-heading h2 {
    margin: 0 0 4px;

    color: #111827;

    font-size: 17px;
    font-weight: 750;
}

.cloudright-form-heading p {
    margin: 0;

    color: #64748b;

    font-size: 11px;
}

.cloudright-form-group {
    margin-bottom: 11px;
}

.cloudright-form-group label,
.cloudright-label {
    display: block;

    margin-bottom: 5px;

    color: #334155;

    font-size: 10px;
    font-weight: 650;
}

.cloudright-input-wrapper {
    position: relative;
}

.cloudright-input-icon {
    position: absolute;

    left: 10px;
    top: 50%;

    transform: translateY(-50%);

    color: #64748b;

    font-size: 12px;

    pointer-events: none;
}

.cloudright-account-input {
    width: 100%;
    height: 39px;

    padding: 0 10px 0 30px;

    border: 1px solid #dbe2ea;
    border-radius: 8px;

    background: #ffffff;

    color: #111827;

    font-family: inherit;

    font-size: 11px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.cloudright-account-input:focus {
    border-color: #6366f1;

    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.10);
}

.cloudright-account-input::placeholder {
    color: #a1aab8;
}

/* =========================================================
   ERRORS
   ========================================================= */

.cloudright-form-error,
.cloudright-error {
    margin: 4px 0 10px;

    padding: 8px 10px;

    border: 1px solid #fecaca;
    border-radius: 7px;

    background: #fef2f2;

    color: #b91c1c;

    font-size: 10px;

    line-height: 1.4;
}

/* =========================================================
   PRIMARY BUTTON
   ========================================================= */

.cloudright-primary-button {
    width: 100%;
    min-height: 41px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 0 14px;

    border: 0;
    border-radius: 8px;

    background: linear-gradient(
        135deg,
        #2563eb,
        #4f46e5
    );

    color: #ffffff;

    font-family: inherit;

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 7px 18px rgba(79, 70, 229, 0.22);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

.cloudright-primary-button:hover:not(:disabled) {
    transform: translateY(-1px);

    box-shadow:
        0 10px 24px rgba(79, 70, 229, 0.28);
}

.cloudright-primary-button:disabled {
    opacity: 0.7;

    cursor: wait;
}

.cloudright-button-arrow {
    font-size: 15px;
}

.cloudright-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 5px;

    margin-top: 9px;

    color: #64748b;

    font-size: 9px;
}

.cloudright-secure-note span {
    color: #059669;

    font-weight: 800;
}

/* =========================================================
   ORDER PREVIEW
   ========================================================= */

.cloudright-order-preview {
    margin-top: 16px;

    padding: 12px;

    border: 1px solid #e5e7eb;
    border-radius: 10px;

    background: #f8fafc;
}

.cloudright-preview-heading {
    display: flex;
    justify-content: space-between;

    margin-bottom: 9px;

    color: #334155;

    font-size: 10px;
    font-weight: 700;
}

.cloudright-preview-lock {
    font-size: 10px;
}

.cloudright-preview-items {
    display: flex;
    flex-direction: column;

    gap: 7px;
}

.cloudright-preview-item {
    display: flex;
    align-items: center;

    gap: 8px;
}

.cloudright-preview-image {
    width: 36px;
    height: 36px;

    position: relative;

    flex: 0 0 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border: 1px solid #e2e8f0;
    border-radius: 7px;

    background: #ffffff;
}

.cloudright-preview-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.cloudright-preview-qty {
    position: absolute;

    right: -2px;
    top: -2px;

    min-width: 15px;
    height: 15px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0 3px;

    border-radius: 20px;

    background: #111827;

    color: #ffffff;

    font-size: 8px;
    font-weight: 700;
}

.cloudright-preview-info {
    display: flex;
    flex-direction: column;

    min-width: 0;

    flex: 1;
}

.cloudright-preview-info strong {
    overflow: hidden;

    color: #334155;

    font-size: 10px;
    font-weight: 650;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.cloudright-preview-info span {
    margin-top: 2px;

    color: #64748b;

    font-size: 9px;
}

.cloudright-preview-total {
    display: flex;
    justify-content: space-between;

    margin-top: 10px;
    padding-top: 10px;

    border-top: 1px solid #e2e8f0;

    color: #475569;

    font-size: 10px;
}

.cloudright-preview-total strong {
    color: #111827;

    font-size: 13px;
}

.cloudright-trust-list {
    display: flex;
    flex-wrap: wrap;

    gap: 6px 12px;

    margin-top: 9px;
}

.cloudright-trust-list div {
    color: #64748b;

    font-size: 8px;
}

.cloudright-trust-list span {
    margin-right: 3px;

    color: #059669;

    font-weight: 800;
}

/* =========================================================
   PAYMENT
   ========================================================= */

.cloudright-payment-layout {
    display: block;

    padding: 19px;
}

.cloudright-payment-content {
    width: 100%;
    max-width: 420px;

    margin: 0 auto;
}

.cloudright-payment-heading {
    display: flex;
    align-items: flex-start;

    gap: 10px;

    margin-bottom: 14px;
}

.cloudright-heading-icon {
    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: #eef2ff;

    font-size: 17px;
}

.cloudright-payment-heading h2 {
    margin: 0 0 3px;

    color: #111827;

    font-size: 16px;
    font-weight: 750;
}

.cloudright-payment-heading p {
    margin: 0;

    color: #64748b;

    font-size: 10px;
    line-height: 1.45;
}

/* =========================================================
   CUSTOMER BADGE
   ========================================================= */

.cloudright-customer-badge {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-bottom: 11px;
    padding: 8px 10px;

    border: 1px solid #e0e7ff;
    border-radius: 8px;

    background: #f5f7ff;
}

.cloudright-customer-avatar {
    width: 29px;
    height: 29px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 29px;

    border-radius: 50%;

    background: linear-gradient(
        135deg,
        #2563eb,
        #7c3aed
    );

    color: #ffffff;

    font-size: 11px;
    font-weight: 700;
}

.cloudright-customer-details {
    display: flex;
    flex-direction: column;

    min-width: 0;

    flex: 1;
}

.cloudright-customer-details strong {
    overflow: hidden;

    color: #1e293b;

    font-size: 10px;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.cloudright-customer-details span {
    margin-top: 1px;

    overflow: hidden;

    color: #64748b;

    font-size: 8px;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.cloudright-btn-link {
    padding: 0;

    border: 0;

    background: transparent;

    color: #4f46e5;

    font-family: inherit;

    font-size: 9px;
    font-weight: 700;

    cursor: pointer;
}

.cloudright-btn-link:hover {
    color: #3730a3;
}

/* =========================================================
   PAYMENT CART ITEMS
   ========================================================= */

.cloudright-cart-items {
    display: flex;
    flex-direction: column;

    gap: 7px;

    padding: 10px;

    border: 1px solid #e5e7eb;
    border-radius: 9px;

    background: #f8fafc;
}

.cloudright-cart-item {
    display: flex;
    align-items: center;

    gap: 8px;
}

.cloudright-item-image-wrapper {
    width: 40px;
    height: 40px;

    flex: 0 0 40px;

    overflow: hidden;

    border: 1px solid #e2e8f0;
    border-radius: 7px;

    background: #ffffff;
}

.cloudright-item-image {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}

.cloudright-item-image-placeholder {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 15px;
}

.cloudright-item-details {
    flex: 1;

    min-width: 0;
}

.cloudright-item-name {
    overflow: hidden;

    color: #334155;

    font-size: 10px;
    font-weight: 650;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.cloudright-item-meta {
    margin-top: 2px;

    color: #64748b;

    font-size: 8px;
}

.cloudright-item-price {
    color: #111827;

    font-size: 10px;
    font-weight: 700;
}

/* =========================================================
   TOTAL
   ========================================================= */

.cloudright-total-section {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-top: 11px;
    padding: 11px 12px;

    border-radius: 9px;

    background: linear-gradient(
        135deg,
        #eef2ff,
        #f5f3ff
    );
}

.cloudright-total-section span {
    color: #475569;

    font-size: 10px;
    font-weight: 600;
}

.cloudright-total-section strong {
    color: #111827;

    font-size: 17px;
    font-weight: 800;
}

/* =========================================================
   PAYMENT ACTIONS
   ========================================================= */

.cloudright-actions {
    margin-top: 11px;
}

.cloudright-payment-button {
    min-height: 42px;

    font-size: 12px;
}

.cloudright-secondary-button {
    width: 100%;

    min-height: 34px;

    margin-top: 6px;

    padding: 0;

    border: 0;

    background: transparent;

    color: #64748b;

    font-family: inherit;

    font-size: 10px;
    font-weight: 600;

    cursor: pointer;
}

.cloudright-secondary-button:hover {
    color: #334155;
}

/* =========================================================
   PAYMENT SIDE
   ========================================================= */

.cloudright-payment-side {
    display: none;
}

/* =========================================================
   CONFIRMATION
   ========================================================= */

.cloudright-confirmation {
    padding: 42px 24px;

    text-align: center;
}

.cloudright-confirmation .cloudright-success-icon {
    width: 72px;
    height: 72px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 15px;

    border-radius: 50%;

    background: linear-gradient(
        135deg,
        #0f766e,
        #059669
    );

    color: #ffffff;

    font-size: 32px;
    font-weight: 800;

    box-shadow:
        0 12px 30px rgba(5, 150, 105, 0.25);
}

.cloudright-success-label {
    display: inline-block;

    margin-bottom: 9px;

    padding: 5px 11px;

    border: 1px solid #bbf7d0;

    border-radius: 30px;

    background: #f0fdf4;

    color: #15803d;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.8px;

    text-transform: uppercase;
}

.cloudright-confirmation .cloudright-title {
    margin: 0 0 7px;

    color: #111827;

    font-size: 24px;
    line-height: 1.2;
    font-weight: 800;
}

.cloudright-confirmation-text {
    margin: 0 auto;

    max-width: 390px;

    color: #64748b;

    font-size: 11px;
    line-height: 1.5;
}

.cloudright-confirmation-details {
    max-width: 390px;

    margin: 20px auto 0;

    padding: 12px 14px;

    border: 1px solid #e5e7eb;
    border-radius: 10px;

    background: #f8fafc;
}

.cloudright-confirmation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 9px 0;

    border-bottom: 1px solid #e2e8f0;

    color: #64748b;

    font-size: 10px;
}

.cloudright-confirmation-row:last-child {
    border-bottom: 0;
}

.cloudright-confirmation-row strong {
    color: #111827;

    font-size: 11px;
}

.cloudright-badge-paid {
    display: inline-flex;
    align-items: center;

    padding: 5px 9px;

    border-radius: 20px;

    background: #16a34a;

    color: #ffffff;

    font-size: 9px;
    font-weight: 750;
}

.cloudright-confirmation-note {
    margin: 14px 0;

    color: #94a3b8;

    font-size: 9px;
}

.cloudright-confirmation > .cloudright-primary-button {
    max-width: 390px;

    margin: 0 auto;
}

/* =========================================================
   FOOTER
   ========================================================= */

.cloudright-modal-footer {
    display: flex;
    justify-content: space-between;

    padding: 9px 17px;

    border-top: 1px solid #e5e7eb;

    color: #94a3b8;

    font-size: 8px;
}

/* =========================================================
   LOADING
   ========================================================= */

.cloudright-loading-spinner {
    width: 13px;
    height: 13px;

    display: inline-block;

    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;

    border-radius: 50%;

    animation: cloudright-spin 0.7s linear infinite;
}

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

/* =========================================================
   EMPTY CART
   ========================================================= */

.cloudright-preview-empty,
.cloudright-empty-cart {
    padding: 12px;

    color: #64748b;

    text-align: center;

    font-size: 10px;
}

/* =========================================================
   CUSTOM CLOUDRIGHT CHECKOUT BUTTON
   ========================================================= */

.cloudright-custom-checkout-wrapper {
    width: 100%;

    margin: 20px 0;
}

.cloudright-custom-checkout-button {
    width: 100%;
    min-height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0 18px;

    border: 0;
    border-radius: 8px;

    background: linear-gradient(
        135deg,
        #2563eb,
        #4f46e5
    );

    color: #ffffff;

    font-family: inherit;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 7px 18px rgba(79, 70, 229, 0.22);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

.cloudright-custom-checkout-button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 10px 24px rgba(79, 70, 229, 0.28);
}

.cloudright-custom-checkout-button:active {
    transform: translateY(0);
}

/* =========================================================
   HIDE MAGENTO MINI-CART CHECKOUT BUTTON
   KEEP CART ICON + VIEW FULL CART
   ========================================================= */

/*
 * Exact Magento mini-cart button:
 *
 * #top-cart-btn-checkout
 *
 * Hide ONLY the Magento mini-cart checkout button.
 * Do NOT hide the cart icon.
 * Do NOT hide View Full Cart.
 * Do NOT affect the CloudRight checkout button.
 */

#minicart-content-wrapper #top-cart-btn-checkout {
    display: none !important;
}

.minicart-wrapper #minicart-content-wrapper #top-cart-btn-checkout {
    display: none !important;
}

.minicart-wrapper .actions .primary #top-cart-btn-checkout {
    display: none !important;
}

.minicart-wrapper button#top-cart-btn-checkout.action.primary.checkout {
    display: none !important;
}

/* Fallback selectors for Magento mini-cart */

#top-cart-btn-checkout {
    display: none !important;
}

.minicart-wrapper .action.checkout {
    display: none !important;
}

/* =========================================================
   SHOW CART ICON ONLY ON HOME AND PRODUCT PAGES
   ========================================================= */

body:not(.cms-index-index):not(.catalog-product-view) .minicart-wrapper {
    display: none !important;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {
    .cloudright-modal-overlay {
        align-items: flex-start;

        padding: 12px;
    }

    .cloudright-modal {
        width: 100%;

        max-height: calc(100vh - 24px);

        border-radius: 16px;
    }

    .cloudright-modal-header {
        padding: 14px 15px;

        border-radius: 16px 16px 0 0;
    }

    .cloudright-brand-mark {
        width: 34px;
        height: 34px;
    }

    .cloudright-progress {
        padding: 11px 14px;
    }

    .cloudright-step-label {
        display: none;
    }

    .cloudright-progress-line {
        margin: 0 6px;
    }

    .cloudright-account-layout,
    .cloudright-payment-layout {
        padding: 17px 14px;
    }

    .cloudright-welcome h2,
    .cloudright-payment-heading h2 {
        font-size: 17px;
    }

    .cloudright-confirmation {
        padding: 35px 17px;
    }

    .cloudright-modal-footer {
        padding: 10px 14px;
    }

    .cloudright-custom-checkout-wrapper {
        margin: 15px 0;
    }
}

@media (max-width: 420px) {
    .cloudright-modal-overlay {
        padding: 8px;
    }

    .cloudright-modal {
        max-height: calc(100vh - 16px);
    }

    .cloudright-account-layout,
    .cloudright-payment-layout {
        padding: 15px 12px;
    }

    .cloudright-order-preview {
        padding: 11px;
    }

    .cloudright-modal-footer {
        font-size: 8px;
    }

    .cloudright-custom-checkout-button {
        min-height: 46px;

        font-size: 12px;
    }
}