/* WOALY Address Forms Styles */

/* Hide nav trigger button ONLY when editing a specific address (billing/shipping), not on the address list page */
body.woocommerce-edit-address .woaly-address-form-container ~ #woaly-nav-trigger,
body.woocommerce-edit-address:has(.woaly-address-form-container) #woaly-nav-trigger {
	display: none !important;
}

/* Modern Address Buttons */
.woaly-address-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 22px;
    width: 100%;
    margin: 0 auto;
}

.woaly-address-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    min-height: 62px;
    height: auto;
    background: #ffffff;
    border: 1px solid #EBEBEB;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.woaly-address-button .address-content {
    display: flex;
    flex-direction: column;
    text-align: start;
    gap: 14px;
    flex: 1;
}

.woaly-address-button .address-label {
    font-family: Rethink Sans;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.2;
    color: #3A4151;
}

.woaly-address-button .address-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.woaly-address-button .address-details span {
    font-family: Rethink Sans;
    font-weight: 500;
    font-size: 14px;
    line-height: 140%;
    color: #5D5D5D;
}

.woaly-address-button .address-street,
.woaly-address-button .address-location {
    font-weight: 400;
}

.woaly-address-button .edit-icon {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 4px;
}

.woaly-address-button:hover .edit-icon {
    opacity: 1;
}

/* Address Form Styles */
.woaly-address-form-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
}

.woaly-address-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    position: relative;
}

/* Back button uses same style as order-details */
.woaly-address-header .back-button {
    width: 44px;
    height: 44px;
    border-radius: 30px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.woaly-address-header .back-arrow {
    width: 20px;
    height: 20px;
}

.woaly-address-header .back-button:hover {
    background: #e5e7eb;
}

.woaly-address-title {
    font-family: Rethink Sans;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
    text-align: left;
}

.woaly-address-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.woaly-form-row {
    display: flex;
    gap: 12px;
}

.woaly-form-row.woaly-two-columns {
    display: flex;
    gap: 12px;
}

.woaly-form-row.woaly-two-columns .input-wrapper {
    flex: 1;
}

.woaly-form-row.woaly-full-width {
    width: 100%;
}

.woaly-form-row.woaly-full-width .input-wrapper {
    width: 100%;
}

/* Reuse existing floating input styles from edit-account */
.woaly-address-form .input-wrapper {
    position: relative;
    margin-bottom: 0;
}

.woaly-address-form .floating-input,
.woaly-address-form .floating-select {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 14px;
    border: 1px solid rgba(79, 79, 79, 0.2);
    border-radius: 12px;
    background: transparent;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.woaly-address-form .floating-select {
    padding-right: 40px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path fill='%234F4F4F' d='M6 8L0 2h12L6 8z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
    cursor: pointer;
}

.woaly-address-form .floating-input:focus,
.woaly-address-form .floating-select:focus {
    border-color: rgba(79, 79, 79, 0.4);
}

.woaly-address-form .floating-label {
    position: absolute;
    left: 12px;
    top: 12px;
    background: white;
    padding: 0 4px;
    font-size: 14px;
    color: rgba(79, 79, 79, 0.52);
    transition: all 0.2s ease;
    pointer-events: none;
}

.woaly-address-form .floating-input:focus + .floating-label,
.woaly-address-form .floating-input:not(:placeholder-shown) + .floating-label,
.woaly-address-form .floating-select:focus + .floating-label,
.woaly-address-form .select-wrapper .floating-label {
    top: -8px;
    font-size: 12px;
    color: #242638;
}

.woaly-address-form .required {
    color: #ef4444;
}

.woaly-form-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-start;
}

.woaly-save-button {
    background: #242638;
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: Rethink Sans;
    font-weight: 500;
    font-size: 14px;
    line-height: 1;
}

.woaly-save-button:hover {
    background: #1a1d2b;
}

h2.woaly-address-title {
  text-align: center;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .woaly-address-buttons-container {
        max-width: 100%;
        padding: 0;
    }

    .woaly-address-button {
        padding: 14px 16px;
        min-height: 70px;
    }

    .woaly-address-button .address-label {
        font-size: 14px;
    }

    .woaly-address-button .address-details span {
        font-size: 13px;
    }

    .woaly-form-row.woaly-two-columns {
        flex-direction: column;
        gap: 16px;
    }

    .woaly-address-form-container {
        padding: 0;
    }

    .woaly-address-header {
        flex-direction: column;
        align-items: start;
        margin-bottom: 24px;
    }

    .woaly-address-title {
        font-size: 18px;
    }
}
