/* ========== eSIM Access — Order / Thank You / My Account (dark theme) ========== */

:root{
  --esim-bg1:#141b2e;
  --esim-bg2:#0d1220;
  --esim-card:rgba(255,255,255,.04);
  --esim-border:rgba(255,255,255,.08);
  --esim-text:#e8ecf5;
  --esim-muted:#9aa4bd;
  --esim-muted2:#7a869f;
  --esim-accent:#5d87ff;
  --esim-accent2:#7a5cff;
}

/* ---- Page wrapper ---- */
.woocommerce-order,
.woocommerce-account .woocommerce,
.woocommerce-order-received .entry-content,
.woocommerce-view-order .woocommerce{
  color:var(--esim-text);
  font-family:inherit;
}

.woocommerce-order p,
.woocommerce-account .woocommerce p{
  color:var(--esim-muted);
}

/* ---- "Thank you" heading / message ---- */
.woocommerce-thankyou-order-received,
.woocommerce-notice--success{
  background:linear-gradient(135deg,rgba(93,135,255,.14),rgba(122,92,255,.14));
  border:1px solid var(--esim-border);
  color:#fff !important;
  font-size:20px;
  font-weight:700;
  padding:22px 26px;
  border-radius:16px;
  margin-bottom:28px;
}

/* ========== 50/50 SPLIT LAYOUT ========== */
.esim-order-split{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:28px;
  margin:28px 0;
}
.esim-order-left,
.esim-order-right{
  min-width:0; /* prevent overflow */
}

@media(max-width:900px){
  .esim-order-split{
    grid-template-columns:1fr;
  }
  .esim-order-right{
    order:-1; /* QR first on mobile */
  }
}

/* ---- Section titles ---- */
.woocommerce-column__title,
.woocommerce-order-details__title,
.woocommerce-customer-details h2,
h2.woocommerce-order-details__title{
  color:#fff;
  font-size:18px;
  font-weight:700;
  margin:0 0 14px;
}

/* ---- Order + address tables ---- */
.woocommerce-table,
.woocommerce table.shop_table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  background:var(--esim-card);
  border:1px solid var(--esim-border);
  border-radius:16px;
  overflow:hidden;
  color:var(--esim-text);
  margin-bottom:22px;
}
.woocommerce table.shop_table th,
.woocommerce table.shop_table td{
  border:0;
  border-bottom:1px solid var(--esim-border);
  padding:14px 18px;
  color:var(--esim-text);
}
.woocommerce table.shop_table thead th{
  background:rgba(255,255,255,.03);
  color:var(--esim-muted);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.5px;
}
.woocommerce table.shop_table tbody tr:last-child td{border-bottom:0;}
.woocommerce table.shop_table tfoot th,
.woocommerce table.shop_table tfoot td{
  background:rgba(255,255,255,.02);
  color:#fff;
  font-weight:600;
}
.woocommerce table.shop_table tfoot tr:last-child th,
.woocommerce table.shop_table tfoot tr:last-child td{
  font-size:16px;
}
.woocommerce table.shop_table a{color:var(--esim-accent);text-decoration:none;}
.woocommerce table.shop_table a:hover{text-decoration:underline;}

/* ---- Customer / address blocks ---- */
.woocommerce-customer-details{margin-top:22px;}
.woocommerce-customer-details address{
  background:var(--esim-card);
  border:1px solid var(--esim-border);
  border-radius:14px;
  padding:16px 18px;
  color:var(--esim-text);
  font-style:normal;
  line-height:1.6;
}

/* ---- Buttons ---- */
.woocommerce-order .button,
.woocommerce-account .button,
.woocommerce #payment .button,
.woocommerce a.button,
.woocommerce button.button{
  background:linear-gradient(135deg,var(--esim-accent),var(--esim-accent2));
  color:#fff;
  border:0;
  border-radius:999px;
  padding:11px 26px;
  font-weight:600;
  font-size:14px;
  box-shadow:0 8px 22px rgba(93,135,255,.25);
  transition:transform .15s ease,box-shadow .15s ease;
}
.woocommerce-order .button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 26px rgba(93,135,255,.35);
  color:#fff;
}

/* ---- My Account: navigation ---- */
.woocommerce-MyAccount-navigation ul{
  list-style:none;margin:0;padding:0;
  background:var(--esim-card);
  border:1px solid var(--esim-border);
  border-radius:14px;
  overflow:hidden;
}
.woocommerce-MyAccount-navigation ul li{
  border-bottom:1px solid var(--esim-border);
}
.woocommerce-MyAccount-navigation ul li:last-child{border-bottom:0;}
.woocommerce-MyAccount-navigation ul li a{
  display:block;padding:14px 18px;
  color:var(--esim-muted);text-decoration:none;font-weight:500;
}
.woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-MyAccount-navigation ul li a:hover{
  background:rgba(93,135,255,.12);
  color:#fff;
}
.woocommerce-MyAccount-content{
  color:var(--esim-text);
}
.woocommerce-orders-table__cell-order-actions .button{padding:8px 16px;font-size:13px;}

/* ========== QR SECTION (Vertical, narrow column) ========== */
.esim-qr-box{
  padding:28px;border-radius:20px;
  background:linear-gradient(160deg,var(--esim-bg1) 0%,var(--esim-bg2) 100%);
  border:1px solid var(--esim-border);
  box-shadow:0 20px 50px rgba(0,0,0,.35);
  color:var(--esim-text);font-family:inherit;
}
.esim-qr-head{
  display:flex;align-items:center;gap:10px;margin-bottom:20px;
}
.esim-qr-ico{
  flex:0 0 auto;
  width:38px;height:38px;border-radius:10px;background:rgba(93,135,255,.15);font-size:20px;
  display:flex;align-items:center;justify-content:center;
}
.esim-qr-head div{flex:1;}
.esim-qr-box h2{margin:0 0 4px;font-size:20px;font-weight:700;color:#fff;}
.esim-qr-sub{margin:0;color:var(--esim-muted);font-size:13px;line-height:1.4;}

.esim-qr-code{
  text-align:center;margin-bottom:20px;
}
.esim-qr-code-inner{
  background:#fff;padding:14px;border-radius:16px;display:inline-block;
  box-shadow:0 8px 24px rgba(0,0,0,.25);
}
.esim-qr-code-inner img{display:block;width:220px;height:220px;}
.esim-qr-btn{
  display:inline-block;margin-top:12px;padding:10px 22px;border-radius:999px;
  background:linear-gradient(135deg,var(--esim-accent),var(--esim-accent2));
  color:#fff !important;text-decoration:none !important;font-weight:600;font-size:14px;
  border:0;text-shadow:none;
}
.esim-qr-btn:visited{color:#fff !important;}
.esim-qr-btn:hover,
.esim-qr-btn:focus{color:#fff !important;opacity:.92;text-decoration:none !important;}

.esim-qr-iccid{
  background:var(--esim-card);border:1px solid var(--esim-border);
  border-radius:14px;padding:14px 16px;margin-bottom:20px;
}
.esim-qr-iccid-label{font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--esim-muted2);margin-bottom:4px;}
.esim-qr-iccid-val{font-size:14px;font-weight:600;color:#fff;word-break:break-all;line-height:1.4;}

.esim-qr-info h3{margin:0 0 12px;font-size:15px;color:#fff;font-weight:700;}
.esim-qr-steps{margin:0;padding:0;list-style:none;}
.esim-qr-steps li{
  display:flex;gap:10px;align-items:flex-start;
  padding:0 0 12px 0;color:var(--esim-muted);font-size:13px;line-height:1.5;
}
.esim-qr-step-num{
  flex:0 0 auto;width:24px;height:24px;border-radius:50%;
  background:rgba(93,135,255,.18);color:#8ba6ff;font-weight:700;font-size:12px;
  display:flex;align-items:center;justify-content:center;
}
.esim-qr-steps li strong{color:#dfe4f2;}

/* Pending state */
.esim-qr-pending{text-align:center;}
.esim-qr-pending-ico{font-size:40px;margin-bottom:12px;}
.esim-qr-pending h2{margin:0 0 10px;}
.esim-qr-pending p{margin:0 auto 6px;max-width:360px;color:var(--esim-muted);font-size:13px;line-height:1.6;}
.esim-qr-orderno{color:var(--esim-muted2) !important;font-size:12px;}
.esim-qr-orderno strong{color:#c4cbe0;}
.esim-refresh-btn{
  display:inline-block;padding:12px 28px;border-radius:999px;
  background:linear-gradient(135deg,var(--esim-accent),var(--esim-accent2));
  color:#fff !important;text-decoration:none !important;font-weight:600;font-size:15px;
  border:0;cursor:pointer;box-shadow:0 4px 12px rgba(93,135,255,.3);
  transition:all .2s;
}
.esim-refresh-btn:hover{opacity:.9;transform:translateY(-1px);box-shadow:0 6px 16px rgba(93,135,255,.4);}
.esim-refresh-btn:active{transform:translateY(0);}

@media(max-width:600px){
  .esim-qr-box{padding:20px;}
  .esim-qr-code-inner img{width:180px;height:180px;}
}

/* ---- QR buttons (Install without scanning) ---- */
.esim-qr-buttons{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:14px;}
.esim-qr-buttons .esim-qr-btn{margin-top:0;}
.esim-qr-btn-secondary{background:rgba(255,255,255,.08) !important;border:1px solid var(--esim-border) !important;}
.esim-qr-btn-primary{font-size:15px;padding:12px 26px;}
.esim-qr-ac{margin-top:14px;text-align:center;color:var(--esim-muted);font-size:12px;}
.esim-qr-ac code{display:inline-block;margin-top:6px;padding:8px 12px;border-radius:8px;background:rgba(0,0,0,.35);color:#fff;font-size:12px;word-break:break-all;user-select:all;}
.esim-qr-copy{cursor:pointer;background:none;border:1px solid var(--esim-border);color:var(--esim-text);border-radius:999px;padding:6px 14px;margin-left:6px;font-size:12px;}
.esim-qr-copy:hover{opacity:.85;}

/* ---- Layout fixes ---- */
.esim-order-split{width:100%;max-width:1100px;margin:28px auto;}
.esim-order-split .esim-order-split{display:block;}
.esim-qr-box{width:100%;box-sizing:border-box;}
.esim-qr-head{display:flex;gap:14px;align-items:flex-start;}
.esim-qr-head h2{margin:0 0 6px;font-size:22px;line-height:1.2;white-space:normal;}
.esim-qr-sub{margin:0;}
.woocommerce table.shop_table{table-layout:auto;}
.woocommerce table.shop_table td,.woocommerce table.shop_table th{white-space:normal;word-break:normal;}

/* ---- Install buttons (iOS / Android) ---- */
.esim-install-btns{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:18px 0 6px;}
.esim-install-btns .esim-qr-btn{margin:0;text-align:center;padding:14px 18px;font-size:15px;border-radius:14px;cursor:pointer;}
.esim-qr-btn-ios{background:linear-gradient(135deg,#1c1c1e,#3a3a3c) !important;border:1px solid rgba(255,255,255,.15) !important;}
.esim-qr-btn-android{background:linear-gradient(135deg,#1e8e3e,#34a853) !important;}
.esim-android-steps{margin:10px 0 14px;padding:12px 14px;border-radius:12px;background:rgba(52,168,83,.12);border:1px solid rgba(52,168,83,.3);color:var(--esim-text);font-size:13px;line-height:1.5;}
@media(max-width:520px){.esim-install-btns{grid-template-columns:1fr;}}

/* ---- Pending spinner with progress ---- */
.esim-spinner{
  position:relative;display:inline-block;width:48px;height:48px;margin:14px auto 18px;
}
.esim-spinner::before{
  content:'';position:absolute;inset:0;border:5px solid rgba(255,255,255,.12);border-radius:50%;
}
.esim-spinner::after{
  content:'';position:absolute;inset:0;border:5px solid transparent;border-top-color:var(--esim-accent);
  border-right-color:var(--esim-accent);border-radius:50%;animation:esimspin 1.2s cubic-bezier(.5,0,.5,1) infinite;
  clip-path:polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%, 50% 0%);
  transform:rotate(calc(var(--progress, 0%) * 3.6deg));transition:transform .4s ease;
}
@keyframes esimspin{
  0%{transform:rotate(0deg);}
  100%{transform:rotate(360deg);}
}
.esim-qr-pending .esim-spinner[data-elapsed]::before{
  content:attr(data-elapsed);position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  font-size:10px;font-weight:700;color:var(--esim-muted2);border:none;
}
.esim-refresh-btn{
  margin-top:14px;padding:11px 24px;border-radius:999px;background:var(--esim-accent);color:#fff !important;
  border:0;font-weight:600;cursor:pointer;transition:opacity .2s;
}
.esim-refresh-btn:hover{opacity:.88;}

/* ===== HARD LAYOUT FIX (v1.5) ===== */
.woocommerce-order,.woocommerce-order-received .woocommerce{display:block !important;width:100% !important;max-width:100% !important;}
.woocommerce-order-overview{display:none !important;}
.esim-order-split{display:grid !important;grid-template-columns:minmax(0,1.15fr) minmax(320px,440px) !important;gap:32px !important;width:100% !important;max-width:100% !important;margin:24px 0 !important;align-items:start;}
.esim-order-split .esim-order-split,.esim-order-split .esim-order-split>.esim-order-left,.esim-order-split .esim-order-split>.esim-order-right{display:contents !important;}
.esim-order-left,.esim-order-right{min-width:0 !important;width:100% !important;}
.esim-order-left>*,.esim-order-right>*{width:100% !important;max-width:100% !important;}
.esim-qr-box{width:100% !important;max-width:100% !important;box-sizing:border-box;padding:26px !important;}
.esim-qr-head{display:flex !important;gap:14px;align-items:center;}
.esim-qr-head h2{font-size:22px !important;line-height:1.2;white-space:normal;margin:0 0 4px;}
.esim-qr-sub{font-size:14px;}
.esim-qr-code{text-align:center;}
.esim-qr-code-inner img{width:220px !important;height:220px !important;}
.woocommerce-order-details__title,.woocommerce-column__title{white-space:nowrap;}
.woocommerce table.shop_table{width:100% !important;table-layout:auto !important;}
.woocommerce table.shop_table td,.woocommerce table.shop_table th{white-space:normal;}
.woocommerce table.shop_table td.woocommerce-table__product-name{white-space:nowrap;}
.woocommerce-customer-details address{width:100%;box-sizing:border-box;}
@media(max-width:900px){.esim-order-split{grid-template-columns:1fr !important;}.esim-order-right{order:-1;}}

/* ===== v1.6 install buttons redesign ===== */
.esim-install-btns{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:22px 0 8px;}
.esim-install-btn{display:flex !important;align-items:center;gap:12px;padding:14px 16px;border-radius:14px;text-decoration:none !important;
  background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.12);color:#fff !important;transition:all .2s;width:100%;box-sizing:border-box;}
.esim-install-btn:hover{transform:translateY(-2px);border-color:rgba(255,255,255,.28);background:rgba(255,255,255,.09);}
.esim-install-ico{flex:0 0 42px;width:42px;height:42px;border-radius:11px;display:flex;align-items:center;justify-content:center;}
.esim-install-ios .esim-install-ico{background:#fff;color:#000;}
.esim-install-android .esim-install-ico{background:#34a853;color:#fff;}
.esim-install-txt{display:flex;flex-direction:column;line-height:1.2;text-align:left;min-width:0;}
.esim-install-txt small{font-size:11px;text-transform:uppercase;letter-spacing:.6px;color:var(--esim-muted);}
.esim-install-txt strong{font-size:15px;font-weight:700;color:#fff;white-space:nowrap;}
.esim-install-note{margin:0 0 18px;font-size:12.5px;color:var(--esim-muted);text-align:center;line-height:1.5;}
.esim-android-steps{display:none !important;}
.esim-qr-ac{margin-top:16px;padding:14px;border-radius:14px;background:rgba(255,255,255,.03);border:1px solid var(--esim-border);text-align:left;}
.esim-qr-ac>div{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:6px 0;font-size:12px;color:var(--esim-muted);}
.esim-qr-ac code{margin:0;flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@media(max-width:520px){.esim-install-btns{grid-template-columns:1fr;}}

/* ===== v1.7 layout + mobile ===== */
.esim-split-php{display:grid !important;grid-template-columns:minmax(0,1.1fr) minmax(320px,460px) !important;gap:32px !important;align-items:start;width:100% !important;}
.esim-split-php .esim-order-split:not(.esim-split-php),.esim-split-php .esim-order-split:not(.esim-split-php)>div{display:contents !important;}
.woocommerce-thankyou-order-received,.woocommerce-notice--success{width:100%;box-sizing:border-box;}
@media(max-width:900px){
  .esim-split-php,.esim-order-split{grid-template-columns:1fr !important;gap:22px !important;}
  .esim-order-right{order:-1;}
  .esim-qr-box{padding:18px !important;border-radius:18px;}
  .esim-qr-head h2{font-size:19px !important;}
  .esim-qr-code-inner{padding:10px;}
  .esim-qr-code-inner img{width:190px !important;height:190px !important;}
  .esim-install-btns{grid-template-columns:1fr 1fr;gap:10px;}
  .esim-install-btn{padding:12px;gap:10px;}
  .esim-install-ico{flex-basis:38px;width:38px;height:38px;}
  .esim-install-txt strong{font-size:14px;white-space:normal;}
  .esim-qr-ac>div{flex-direction:column;align-items:flex-start;}
  .esim-qr-ac code{white-space:normal;word-break:break-all;width:100%;box-sizing:border-box;}
  .woocommerce table.shop_table td,.woocommerce table.shop_table th{padding:10px 12px;font-size:14px;}
  .woocommerce-thankyou-order-received,.woocommerce-notice--success{font-size:17px;padding:16px 18px;}
  .woocommerce-customer-details address{padding:14px;}
}
@media(max-width:420px){
  .esim-install-btns{grid-template-columns:1fr;}
  .esim-qr-code-inner img{width:170px !important;height:170px !important;}
}
