/* ========================================
   Portal System Styling
   ======================================== */

/* Portal Container */
.portals {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    visibility: hidden;
}

#portals.active{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
}

.portal-cart button,
.portals button {
    padding: 0;
    margin: 0;
    min-height: 0;
    min-width: 0;
}

/* Portal Drawer Base */
.portal-drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: min(90vw, 32rem);
    height: 100%;
    background: var(--color-white);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s ease;
}

.portal-drawer.portal--active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Portal Dialog */
.portal-dialog {
    border: none;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    background: transparent;
}

.portal-dialog::backdrop {
    background-color: transparent;
}

/* Portal Layout */
.portal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.portal-inner {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    height: 100%;
    overflow-y: auto;
    position: relative;
}

/* Portal Header */
.portal-header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm);
}

.portal-title {
    font-size: var(--fs-h3);
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
}

.portal-close-btn {
    width: 24px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.portal-close-btn:hover {
    color: #333;
}

/* Portal Content */
.portal-content {
    flex: 1;
    overflow-y: auto;
    padding-inline: var(--space-md);
}

/* Form Groups */
.portal-form-group {
    margin-bottom: var(--space-sm);
}

.portal-form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 500;
    color: var(--color-neutral-200);
    font-size: var(--fs-sm);
}

.portal-content .portal-input,
.portal-content .portal-textarea,
.portal-content .portal-select {
    width: 100%;
    height: auto;
    padding: var(--space-sm);
    border: 1px solid var(--color-neutral-100);
    border-radius: var(--rounded-xs);
    font-size: var(--fs-sm);
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.2;
}


.portal-content .portal-input:focus,
.portal-content .portal-textarea:focus,
.portal-content .portal-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.portal-textarea {
    resize: vertical;
}

.portal-form-hint {
    font-size: var(--fs-xs);
    color: var(--color-neutral-300);
    margin-top: var(--space-xs);
    margin-bottom: 0;
}

/* Form Submit Button */
.portal-content .portal-btn-submit {
    width: 100%;
    padding: var(--space-md);
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: 99px;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 1rem;
}

.portal-btn-submit:hover {
    background-color: #0052a3;
}

.portal-btn-submit:active {
    background-color: #003d7a;
}
/* Notification */
.portal-notification {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100000;
    transition: bottom 0.3s ease-out;
    max-width: 90%;
    max-width: min(90%, 500px);
}

.portal-notification.portal-notification--show {
    bottom: 2rem;
}

.portal-notification--success {
    border-left: 4px solid #28a745;
    color: #155724;
}

.portal-notification--error {
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.portal-notification--info {
    border-left: 4px solid #0066cc;
    color: #004085;
}

/* Body Lock when portal is open */
body.portal-open {
    overflow: hidden;
}
