/* =========================================================
   YAFFI WEARS — ORDERING SYSTEM
========================================================= */

.product-card {
    position: relative;
}

.wear-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.wear-add-card-button,
.wear-add-to-cart-modal,
.wear-checkout-button,
.wear-checkout-confirm,
.wear-auth-primary {
    border: 0;
    background: var(--green);
    color: var(--cream);
    cursor: pointer;
    font-family: var(--sans);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    transition: transform .45s var(--ease), background .4s ease, color .4s ease;
}

.wear-add-card-button {
    padding: 11px 13px;
    border: 1px solid rgba(57,71,56,.18);
    background: transparent;
    color: var(--green);
}

.wear-add-card-button:hover,
.wear-add-to-cart-modal:hover,
.wear-checkout-button:hover,
.wear-checkout-confirm:hover,
.wear-auth-primary:hover {
    transform: translateY(-3px);
    background: var(--green-dark);
    color: var(--cream-light);
}

.wear-add-card-button span,
.wear-add-to-cart-modal span,
.wear-checkout-button span,
.wear-checkout-confirm span {
    margin-left: 8px;
    font-size: 13px;
}

.wear-add-to-cart-modal {
    width: 100%;
    margin-top: 26px;
    padding: 17px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wear-cart-trigger {
    position: fixed;
    z-index: 900;
    right: 26px;
    bottom: 26px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px 12px 18px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    background: var(--green);
    color: var(--cream);
    box-shadow: 0 16px 45px rgba(20,28,22,.18);
    cursor: pointer;
    font-family: var(--sans);
}

.wear-cart-label {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .2em;
}

.wear-cart-count {
    min-width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--cream);
    color: var(--green);
    font-size: 10px;
    font-weight: 700;
}

.wear-cart-drawer,
.wear-auth-modal,
.wear-checkout-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    visibility: hidden;
    pointer-events: none;
}

.wear-cart-drawer.active,
.wear-auth-modal.active,
.wear-checkout-modal.active {
    visibility: visible;
    pointer-events: auto;
}

.wear-cart-backdrop,
.wear-auth-backdrop,
.wear-checkout-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24,31,25,.48);
    opacity: 0;
    transition: opacity .55s var(--ease);
    backdrop-filter: blur(8px);
}

.active .wear-cart-backdrop,
.active .wear-auth-backdrop,
.active .wear-checkout-backdrop {
    opacity: 1;
}

.wear-cart-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(520px, 94vw);
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 46px 38px 30px;
    background: var(--cream-light);
    color: var(--ink);
    transform: translateX(100%);
    transition: transform .75s var(--ease);
}

.wear-cart-drawer.active .wear-cart-panel {
    transform: translateX(0);
}

.wear-cart-head,
.wear-auth-heading,
.wear-checkout-heading {
    position: relative;
}

.wear-cart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--line);
}

.wear-cart-head > div > span,
.wear-auth-heading > span,
.wear-checkout-heading > span {
    color: var(--muted);
    font-size: 7px;
    font-weight: 700;
    letter-spacing: .22em;
}

.wear-cart-head h2,
.wear-auth-heading h2,
.wear-checkout-heading h2 {
    margin-top: 9px;
    font-family: var(--serif);
    font-size: clamp(38px, 5vw, 60px);
    font-weight: 500;
    line-height: .9;
    letter-spacing: -.055em;
}

.wear-cart-head h2 em,
.wear-auth-heading h2 em,
.wear-checkout-heading h2 em {
    font-style: italic;
}

.wear-icon-close {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(32,37,31,.15);
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-size: 23px;
    transition: transform .45s var(--ease), background .4s ease, color .4s ease;
}

.wear-icon-close:hover {
    transform: rotate(45deg);
    background: var(--green);
    color: var(--cream);
}

.wear-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 25px 0;
}

.wear-cart-empty {
    min-height: 250px;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.8;
}

.wear-cart-item {
    display: grid;
    grid-template-columns: 82px minmax(0,1fr) auto;
    gap: 15px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.wear-cart-item-image {
    width: 82px;
    height: 96px;
    overflow: hidden;
    background: var(--cream);
}

.wear-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wear-cart-item-info span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 7px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.wear-cart-item-info strong {
    display: block;
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.05;
}

.wear-cart-item-options {
    margin-top: 8px;
    color: var(--muted);
    font-size: 8px;
    line-height: 1.7;
}

.wear-cart-item-price {
    text-align: right;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.wear-cart-item-controls {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 9px;
}

.wear-qty-button {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}

.wear-cart-remove {
    margin-left: 7px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 8px;
    letter-spacing: .12em;
}

.wear-cart-footer {
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.wear-cart-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.wear-cart-total-row span {
    color: var(--muted);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .18em;
}

.wear-cart-total-row strong {
    font-family: var(--serif);
    font-size: 25px;
    font-weight: 500;
}

.wear-checkout-button {
    width: 100%;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wear-auth-modal,
.wear-checkout-modal {
    display: grid;
    place-items: center;
}

.wear-auth-card,
.wear-checkout-card {
    position: relative;
    z-index: 2;
    width: min(560px, calc(100vw - 30px));
    max-height: calc(100vh - 30px);
    overflow-y: auto;
    padding: 48px;
    background: var(--cream-light);
    color: var(--ink);
    transform: translateY(35px) scale(.98);
    opacity: 0;
    transition: transform .65s var(--ease), opacity .5s ease;
}

.wear-auth-modal.active .wear-auth-card,
.wear-checkout-modal.active .wear-checkout-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.wear-auth-card > .wear-icon-close,
.wear-checkout-card > .wear-icon-close {
    position: absolute;
    top: 20px;
    right: 20px;
}

.wear-auth-heading p,
.wear-checkout-heading p {
    max-width: 430px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.8;
}

.wear-auth-google {
    min-height: 44px;
    margin-top: 27px;
    display: flex;
    justify-content: center;
}

.wear-auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0;
    color: var(--muted);
    font-size: 7px;
    letter-spacing: .18em;
}

.wear-auth-divider::before,
.wear-auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.wear-auth-form,
.wear-checkout-form {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.wear-auth-form label,
.wear-checkout-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 7px;
    font-weight: 700;
    letter-spacing: .18em;
}

.wear-auth-form input,
.wear-checkout-form input {
    width: 100%;
    height: 47px;
    padding: 0 14px;
    border: 1px solid rgba(32,37,31,.14);
    outline: 0;
    background: #fff;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 11px;
    letter-spacing: 0;
}

.wear-auth-form input:focus,
.wear-checkout-form input:focus {
    border-color: var(--green);
}

.wear-auth-primary,
.wear-auth-secondary {
    min-height: 48px;
    margin-top: 6px;
    border: 1px solid var(--green);
    cursor: pointer;
}

.wear-auth-secondary {
    background: transparent;
    color: var(--green);
    font-size: 8px;
    letter-spacing: .16em;
}

.wear-auth-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    color: var(--muted);
    font-size: 9px;
}

.wear-auth-switch button {
    border: 0;
    background: transparent;
    color: var(--green);
    cursor: pointer;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .12em;
}

.wear-auth-message,
.wear-checkout-message {
    min-height: 16px;
    margin-top: 12px;
    color: #8a4d3c;
    font-size: 9px;
    line-height: 1.5;
    text-align: center;
}

.wear-optional {
    margin-left: 5px;
    opacity: .6;
}

.wear-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.wear-checkout-summary {
    margin-top: 15px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
}

.wear-checkout-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 7px 0;
    color: var(--muted);
    font-size: 9px;
}

.wear-checkout-summary-row.total {
    margin-top: 8px;
    padding-top: 15px;
    border-top: 1px solid var(--line);
    color: var(--ink);
}

.wear-checkout-summary-row.total strong {
    color: var(--green);
    font-family: var(--serif);
    font-size: 20px;
}

.wear-checkout-confirm {
    min-height: 52px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 700px) {
    .wear-cart-trigger {
        right: 16px;
        bottom: 16px;
    }

    .wear-cart-panel {
        width: 100%;
        padding: 35px 22px 22px;
    }

    .wear-auth-card,
    .wear-checkout-card {
        padding: 38px 22px 25px;
    }

    .wear-form-grid {
        grid-template-columns: 1fr;
    }

    .wear-cart-item {
        grid-template-columns: 65px minmax(0,1fr);
    }

    .wear-cart-item-image {
        width: 65px;
        height: 78px;
    }

    .wear-cart-item-price {
        grid-column: 2;
        text-align: left;
    }

    .wear-add-card-button {
        padding: 9px 10px;
        font-size: 7px;
    }
}
