/* ==========================================================
   CORE WRAPPER
   ========================================================== */

.wesma-wrapper.wesma-soilboy {
    font-size: 14px;
    width: 100%;
    font-family: inherit;
    /* Mobil Safari için kritik düzenlemeler */
    -webkit-text-size-adjust: 100%;
}


/* ==========================================================
   HEADER — BACK | TITLE | CLOSE
   ========================================================== */

.wesma-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 14px;
    border-bottom: 1px solid rgba(0,0,0,.06);
}

.wesma-back {
    background: none;
    border: 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    cursor: pointer;
    padding: 0;
    -webkit-text-size-adjust: 100%;
}

.wesma-header-title {
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    flex: 1;
}

.wesma-close,
.wesma-close-placeholder {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: none;
    border: 0;
    cursor: pointer;
    -webkit-text-size-adjust: 100%;
}


/* ==========================================================
   USER BOX (Hi, Name | Sign out)
   ========================================================== */

.wesma-user-box {
    display: block;
    text-align: center;
    padding: 30px 0 26px;
    border-bottom: 1px solid rgba(0,0,0,.06);
}

.wesma-user-hello {
    display: block;
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 4px;
}

.wesma-signout {
    font-size: 13px;
    opacity: .6;
    text-decoration: none;
    display: inline-block;
    margin-top: 4px;
}

.wesma-signout:hover {
    opacity: .9;
}


/* ==========================================================
   HOME NAVIGATION LIST (Orders, Payment, Address, Profile)
   ========================================================== */

.wesma-nav {
    margin: 0px;
    padding: 0;
}

.wesma-nav-item {
    display: block;
    padding: 20px 0;
    border-bottom: 1px solid rgba(0,0,0,.06);
    cursor: pointer;
    text-align: center;
    background: transparent;
    transition: background 0.15s ease;
}

.wesma-nav-item:hover {
    background: rgba(0,0,0,0.03);
}

.wesma-nav-item-main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wesma-nav-title {
    font-size: 17px;
    font-weight: 500;
    margin-bottom: 6px;
}

.wesma-nav-subtitle {
    font-size: 13px;
    opacity: .55;
}


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

.wesma-content {
    margin-top: 18px;
    padding-bottom: 100px; /* iOS Safari toolbar için alt boşluk */
}

.wesma-panel {
    display: none;
}

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


/* ==========================================================
   HOME vs DETAIL MODE
   ========================================================== */

.wesma-wrapper.wesma-mode-home .wesma-content {
    display: none;
}
.wesma-wrapper.wesma-mode-home .wesma-nav,
.wesma-wrapper.wesma-mode-home .wesma-user-box {
    display: block;
}
.wesma-wrapper.wesma-mode-home .wesma-back {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.wesma-wrapper.wesma-mode-detail .wesma-nav,
.wesma-wrapper.wesma-mode-detail .wesma-user-box {
    display: none;
}
.wesma-wrapper.wesma-mode-detail .wesma-content {
    display: block;
}
.wesma-wrapper.wesma-mode-detail .wesma-back {
    visibility: visible;
    opacity: 1;
}


/* ==========================================================
   BASIC NOTICE
   ========================================================== */

.wesma-notice {
    padding: 10px;
    border-radius: 4px;
    background: #f4f4f4;
}


/* ==========================================================
   ADDRESS PANEL — MODERN & CLEAN CARD STYLE
   ========================================================== */

.wesma-panel[data-wesma-panel="edit-address"] .woocommerce-Addresses {
    display: block;
    margin-top: 20px;
}

/* Card */
.wesma-panel[data-wesma-panel="edit-address"] .woocommerce-Address {
    width: 100%;
    max-width: 420px;
    margin: 0 auto 18px auto;
    padding: 16px 18px;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,.02);
}

/* Title row */
.wesma-panel[data-wesma-panel="edit-address"] .woocommerce-Address-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 10px;
}

.wesma-panel[data-wesma-panel="edit-address"] .woocommerce-Address-title h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* Edit/Add button */
.wesma-panel[data-wesma-panel="edit-address"] .woocommerce-Address-title a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,.18);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    text-decoration: none;
    line-height: 1;
}

.wesma-panel[data-wesma-panel="edit-address"] .woocommerce-Address-title a:hover {
    border-color: rgba(0,0,0,.35);
}

/* Address text */
.wesma-panel[data-wesma-panel="edit-address"] .woocommerce-Address address {
    font-style: normal;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}


/* ==========================================================
   WOOCOMMERCE FORM STİLLERİ - MOBİL SAFARİ ZOOM FİX
   ========================================================== */

/* Tüm input/select/textarea için 16px - zoom engellemek için */
.wesma-panel form input[type="text"],
.wesma-panel form input[type="email"],
.wesma-panel form input[type="tel"],
.wesma-panel form input[type="password"],
.wesma-panel form input[type="number"],
.wesma-panel form textarea,
.wesma-panel form select {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* WooCommerce Input'lar */
.wesma-panel .woocommerce-Input,
.wesma-panel .input-text {
    font-size: 16px !important;
    padding: 10px 12px;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
}

/* Select box'lar */
.wesma-panel select.country_select,
.wesma-panel select.state_select {
    font-size: 16px !important;
    padding: 10px 12px;
    width: 100%;
    box-sizing: border-box;
}

/* Textarea */
.wesma-panel textarea {
    font-size: 16px !important;
    padding: 10px 12px;
    resize: vertical;
    min-height: 80px;
}

/* Form butonları */
.wesma-panel button[type="submit"],
.wesma-panel .button {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
    margin-bottom: 20px; /* iOS Safari toolbar için ekstra boşluk */
}

/* WooCommerce save button için özel */
.wesma-panel .woocommerce-form__row--button,
.wesma-panel .woocommerce-Button {
    margin-bottom: 20px;
}


/* ==========================================================
   ORDERS TABLE - YATAY SCROLL İLE
   ========================================================== */

.wesma-panel[data-wesma-panel="orders"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wesma-panel table.woocommerce-orders-table {
    width: 100%;
    min-width: 600px; /* Tablonun minimum genişliği - yatay scroll için */
    border-collapse: collapse;
}

.wesma-panel table.woocommerce-orders-table th,
.wesma-panel table.woocommerce-orders-table td {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    padding: 10px 12px;
    text-align: left;
}

.wesma-panel table.woocommerce-orders-table th {
    font-weight: 600;
    border-bottom: 2px solid rgba(0,0,0,.1);
}

.wesma-panel table.woocommerce-orders-table td {
    border-bottom: 1px solid rgba(0,0,0,.06);
}

/* View order butonları */
.wesma-panel table.woocommerce-orders-table .woocommerce-button {
    font-size: 13px;
    padding: 6px 14px;
    white-space: nowrap;
}


/* ==========================================================
   ORDER DETAIL - YATAY SCROLL İLE
   ========================================================== */

.wesma-panel .woocommerce-order-details {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wesma-panel .woocommerce-table--order-details {
    width: 100%;
    min-width: 500px; /* Order detail tablosu için minimum genişlik */
}


/* ==========================================================
   MOBİL SAFARİ ÖZEL DÜZENLEMELER
   ========================================================== */

/* iOS Safari için viewport düzeltmeleri */
@supports (-webkit-touch-callout: none) {
    .wesma-wrapper.wesma-soilboy {
        -webkit-text-size-adjust: 100%;
    }
    
    /* iOS Safari input zoom engelleme */
    .wesma-panel input,
    .wesma-panel select,
    .wesma-panel textarea {
        font-size: 16px !important;
    }
    
    /* iOS smooth scrolling */
    .wesma-panel[data-wesma-panel="orders"],
    .wesma-panel .woocommerce-order-details {
        -webkit-overflow-scrolling: touch;
    }
}


/* ==========================================================
   MOBİL RESPONSIVE
   ========================================================== */

@media (max-width: 768px) {
    /* Adres kartlarının mobil düzeni */
    .wesma-panel[data-wesma-panel="edit-address"] .woocommerce-Address {
        margin-left: 10px;
        margin-right: 10px;
        max-width: calc(100% - 20px);
    }
    
    /* Header düğmelerinin mobilde daha kolay tıklanması için */
    .wesma-back,
    .wesma-close {
        min-width: 60px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* User box mobilde daha kompakt */
    .wesma-user-box {
        padding: 24px 0 20px;
    }
    
    .wesma-user-hello {
        font-size: 20px;
    }
}