/* =====================================================
   PWD Elite Header Elements - Frontend Styles
   Version: 1.0.0
   ===================================================== */

/* ----- Reset & Common ----- */
.pwd-ehe-hidden {
    display: none !important;
}

/* ----- Trigger Buttons (shared) ----- */
.pwd-ehe-search-trigger,
.pwd-ehe-account-trigger,
.pwd-ehe-cart-trigger {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    position: relative;
    transition: color 0.3s ease, background-color 0.3s ease, opacity 0.3s ease;
    font-family: inherit;
}

.pwd-ehe-search-trigger:focus-visible,
.pwd-ehe-account-trigger:focus-visible,
.pwd-ehe-cart-trigger:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.pwd-ehe-trigger-text {
    white-space: nowrap;
}

/* =====================================================
   SEARCH OVERLAY
   ===================================================== */
.pwd-ehe-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.4s, opacity 0.4s ease;
}

.pwd-ehe-search-overlay.pwd-ehe-active {
    visibility: visible;
    opacity: 1;
    transition: visibility 0s, opacity 0.4s ease;
}

/* Overlay animations */
.pwd-ehe-overlay-fade {
    /* default fade handled above */
}

.pwd-ehe-overlay-slide-down .pwd-ehe-search-field-wrap {
    transform: translateY(-40px);
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

.pwd-ehe-overlay-slide-down.pwd-ehe-active .pwd-ehe-search-field-wrap {
    transform: translateY(0);
    opacity: 1;
}

.pwd-ehe-overlay-zoom .pwd-ehe-search-field-wrap {
    transform: scale(0.8);
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

.pwd-ehe-overlay-zoom.pwd-ehe-active .pwd-ehe-search-field-wrap {
    transform: scale(1);
    opacity: 1;
}

.pwd-ehe-search-overlay-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.pwd-ehe-search-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1;
}

.pwd-ehe-search-close:hover {
    opacity: 0.7;
    transform: rotate(90deg);
}

.pwd-ehe-search-close svg {
    stroke: currentColor;
}

.pwd-ehe-search-field-wrap {
    text-align: center;
    max-width: 90%;
}

.pwd-ehe-search-form {
    display: flex;
    align-items: center;
}

.pwd-ehe-search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding: 15px 0;
    font-size: 36px;
    font-weight: 300;
    outline: none;
    transition: border-color 0.3s ease;
    color: inherit;
}

.pwd-ehe-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.pwd-ehe-search-helper {
    margin-top: 20px;
    font-size: 14px;
    opacity: 0.6;
}

/* =====================================================
   OFF-CANVAS (shared for Account & Cart)
   ===================================================== */
.pwd-ehe-offcanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    visibility: hidden;
    pointer-events: none;
}

.pwd-ehe-offcanvas.pwd-ehe-active {
    visibility: visible;
    pointer-events: all;
}

.pwd-ehe-offcanvas-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pwd-ehe-offcanvas.pwd-ehe-active .pwd-ehe-offcanvas-backdrop {
    opacity: 1;
}

.pwd-ehe-offcanvas-panel {
    position: absolute;
    top: 0;
    height: 100%;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.pwd-ehe-offcanvas-right {
    right: 0;
    transform: translateX(100%);
}

.pwd-ehe-offcanvas-left {
    left: 0;
    transform: translateX(-100%);
}

.pwd-ehe-offcanvas.pwd-ehe-active .pwd-ehe-offcanvas-right,
.pwd-ehe-offcanvas.pwd-ehe-active .pwd-ehe-offcanvas-left {
    transform: translateX(0);
}

.pwd-ehe-offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.pwd-ehe-offcanvas-heading {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwd-ehe-offcanvas-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    line-height: 1;
}

.pwd-ehe-offcanvas-close:hover {
    opacity: 0.6;
}

.pwd-ehe-offcanvas-close svg {
    stroke: currentColor;
}

.pwd-ehe-offcanvas-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    -webkit-overflow-scrolling: touch;
}

.pwd-ehe-offcanvas-footer {
    flex-shrink: 0;
    padding: 20px 24px;
    border-top: 1px solid #eee;
}

/* =====================================================
   ACCOUNT PANEL
   ===================================================== */
.pwd-ehe-account-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid #eee;
}

.pwd-ehe-account-avatar img {
    border-radius: 50%;
    margin-bottom: 12px;
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.pwd-ehe-account-name {
    font-weight: 600;
    font-size: 16px;
    display: block;
    margin-bottom: 2px;
}

.pwd-ehe-account-email {
    font-size: 13px;
    opacity: 0.6;
    display: block;
}

.pwd-ehe-account-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pwd-ehe-account-nav li {
    border-bottom: 1px solid #eee;
}

.pwd-ehe-account-nav a {
    display: flex;
    align-items: center;
    padding: 14px 0;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 15px;
}

.pwd-ehe-account-nav a:hover {
    text-decoration: none;
}

.pwd-ehe-account-logout {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.pwd-ehe-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    font-size: 14px;
}

.pwd-ehe-logout-btn:hover {
    opacity: 1;
    text-decoration: none;
}

/* Login Form */
.pwd-ehe-login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pwd-ehe-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pwd-ehe-form-group label {
    font-size: 13px;
    font-weight: 500;
}

.pwd-ehe-login-form input[type="text"],
.pwd-ehe-login-form input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.pwd-ehe-login-form input[type="text"]:focus,
.pwd-ehe-login-form input[type="password"]:focus {
    border-color: #0073aa;
    outline: none;
}

.pwd-ehe-form-remember {
    flex-direction: row;
    align-items: center;
}

.pwd-ehe-form-remember label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.pwd-ehe-login-btn {
    width: 100%;
    padding: 12px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    transition: background-color 0.3s ease;
    text-align: center;
}

.pwd-ehe-login-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    font-size: 13px;
}

.pwd-ehe-login-links a {
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    text-decoration: none;
}

.pwd-ehe-login-links a:hover {
    opacity: 1;
}

/* =====================================================
   CART PANEL
   ===================================================== */

/* Badge */
.pwd-ehe-cart-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pwd-ehe-cart-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    text-align: center;
    padding: 0 4px;
    box-sizing: border-box;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.pwd-ehe-badge-top-right .pwd-ehe-cart-count-badge,
.pwd-ehe-badge-top-left .pwd-ehe-cart-count-badge,
.pwd-ehe-badge-bottom-right .pwd-ehe-cart-count-badge {
    position: absolute;
}

.pwd-ehe-badge-inline {
    position: static !important;
    margin-left: 4px;
}

/* Cart count in heading */
.pwd-ehe-cart-count {
    font-weight: 400;
    opacity: 0.6;
    font-size: 0.85em;
}

.pwd-ehe-cart-count::before {
    content: "(";
}

.pwd-ehe-cart-count::after {
    content: ")";
}

/* Cart Items */
.pwd-ehe-cart-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
    position: relative;
}

.pwd-ehe-cart-item:last-child {
    border-bottom: none;
}

.pwd-ehe-cart-item-image img {
    display: block;
    object-fit: cover;
}

.pwd-ehe-cart-item-details {
    flex: 1;
    min-width: 0;
}

.pwd-ehe-cart-item-name a {
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.pwd-ehe-cart-item-name a:hover {
    text-decoration: underline;
}

.pwd-ehe-cart-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    font-size: 13px;
}

.pwd-ehe-cart-item-qty {
    opacity: 0.6;
}

.pwd-ehe-cart-item-remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.3s ease, transform 0.3s ease;
    line-height: 1;
    align-self: center;
}

.pwd-ehe-cart-item-remove:hover {
    transform: scale(1.1);
}

.pwd-ehe-cart-item-remove svg {
    stroke: currentColor;
}

.pwd-ehe-cart-item.pwd-ehe-removing {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Empty Cart */
.pwd-ehe-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    color: inherit;
    opacity: 0.6;
}

.pwd-ehe-cart-empty svg {
    margin-bottom: 16px;
    stroke: currentColor;
    opacity: 0.5;
}

.pwd-ehe-cart-empty p {
    margin: 0 0 16px;
    font-size: 15px;
}

.pwd-ehe-continue-shopping {
    color: inherit;
    text-decoration: underline;
    font-size: 14px;
    transition: opacity 0.3s ease;
}

.pwd-ehe-continue-shopping:hover {
    opacity: 0.7;
}

/* Subtotal */
.pwd-ehe-cart-subtotal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
}

.pwd-ehe-cart-subtotal-amount {
    font-weight: 700;
}

/* Buttons */
.pwd-ehe-cart-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pwd-ehe-view-cart-btn,
.pwd-ehe-checkout-btn {
    display: block;
    text-align: center;
    padding: 12px 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 1px solid #333;
    cursor: pointer;
}

.pwd-ehe-view-cart-btn:hover,
.pwd-ehe-checkout-btn:hover {
    text-decoration: none;
}

/* =====================================================
   BODY LOCK
   ===================================================== */
body.pwd-ehe-body-locked {
    overflow: hidden;
    padding-right: var(--pwd-ehe-scrollbar-width, 0px);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 767px) {
    .pwd-ehe-search-input {
        font-size: 24px;
    }

    .pwd-ehe-search-close {
        top: 15px;
        right: 15px;
    }

    .pwd-ehe-offcanvas-panel {
        max-width: 100vw;
        width: 100% !important;
    }
}
