/* =========================================
   Shipping Calc Tabs Shortcode
   ========================================= */

.ysc-wrap {
    --ysc-green: #20A748;
    --ysc-green-dark: #178a3a;
    --ysc-green-soft: rgba(32, 167, 72, 0.12);
    --ysc-orange: #E67E22;
    --ysc-text: #1a5c2e;
    --ysc-radius-panel: 28px;
    --ysc-radius-tab: 20px;
    width: 100%;
    max-width: none;
    margin: 0;
    font-family: inherit;
    overflow: visible;
}

.ysc-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: flex-end;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 2;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ysc-tabs::-webkit-scrollbar {
    display: none;
}

.ysc-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 22px;
    border: 1.5px solid rgba(32, 167, 72, 0.35);
    border-bottom: none;
    border-radius: var(--ysc-radius-tab) var(--ysc-radius-tab) 0 0;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ysc-green);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.ysc-tab svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.ysc-tab[data-tab="international"] {
    color: var(--ysc-green);
}

.ysc-tab[data-tab="tracking"] {
    color: var(--ysc-orange);
    border-color: rgba(230, 126, 34, 0.4);
}

.ysc-tab:hover {
    background: rgba(255, 255, 255, 0.92);
}

.ysc-tab.is-active {
    background: #ffffff;
    color: var(--ysc-text);
    border-color: transparent;
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.04);
    position: relative;
}

.ysc-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 4px;
    background: #ffffff;
}

.ysc-tab[data-tab="tracking"].is-active {
    color: var(--ysc-orange);
}

.ysc-panel {
    position: relative;
    z-index: 1;
    background: #ffffff;
    /* Tabs always sit on the left — keep top-left square so it never looks chopped */
    border-radius: 0 var(--ysc-radius-panel) var(--ysc-radius-panel) var(--ysc-radius-panel);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
    padding: 36px 40px 40px;
    overflow: visible;
}

/* Elementor wrappers often clip + scroll because of box-shadow / fixed heights */
.elementor-widget-shortcode:has(.ysc-wrap),
.elementor-widget-shortcode:has(.ysc-wrap) > .elementor-widget-container,
.elementor-element:has(> .elementor-widget-container .ysc-wrap) {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
}

.ysc-panel-title {
    margin: 0 0 28px;
    text-align: center;
    color: var(--ysc-text);
    font-size: clamp(1.35rem, 2.4vw, 1.75rem);
    font-weight: 700;
    line-height: 1.35;
}

.ysc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
    margin-bottom: 28px;
}

.ysc-field {
    position: relative;
    min-width: 0;
}

.ysc-select,
.ysc-input {
    width: 100%;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    box-sizing: border-box;
    min-height: 52px;
    padding: 12px 44px 12px 18px;
    border: 1.5px solid var(--ysc-green);
    border-radius: 14px;
    background-color: #ffffff !important;
    background-image: none !important;
    color: var(--ysc-text);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ysc-select::-ms-expand {
    display: none;
}

.ysc-select:focus,
.ysc-input:focus {
    border-color: var(--ysc-green-dark);
    box-shadow: 0 0 0 3px var(--ysc-green-soft);
}

.ysc-select option {
    color: #111827;
}

.ysc-field-icon {
    position: absolute;
    top: 50%;
    right: 16px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--ysc-green);
    pointer-events: none;
}

.ysc-actions {
    display: flex;
    justify-content: center;
}

.ysc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: min(280px, 100%);
    min-height: 52px;
    padding: 12px 36px;
    border: 0;
    border-radius: 9999px;
    background: var(--ysc-green);
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 20px rgba(32, 167, 72, 0.28);
}

.ysc-btn:hover {
    background: var(--ysc-green-dark);
    transform: translateY(-1px);
}

.ysc-btn:active {
    transform: translateY(0);
}

.ysc-pane {
    display: none;
}

.ysc-pane.is-active {
    display: block;
}

.ysc-tracking-note {
    margin: 0 0 20px;
    text-align: center;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.5;
}

.ysc-form-error {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.ysc-form.is-loading .ysc-btn {
    opacity: 0.75;
    cursor: wait;
}

.ysc-custom-box {
    margin: -8px 0 24px;
}

.ysc-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ysc-address {
    z-index: 3;
}

.ysc-address.is-selected .ysc-address-input {
    border-color: var(--ysc-green-dark);
    background: rgba(32, 167, 72, 0.04) !important;
}

.ysc-address.is-searching .ysc-field-icon {
    animation: ysc-spin 0.8s linear infinite;
}

.ysc-address-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 240px;
    overflow: auto;
    border: 1px solid rgba(32, 167, 72, 0.35);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.ysc-address-option {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid #f3f4f6;
    background: transparent;
    color: var(--ysc-text);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.ysc-address-option:last-child {
    border-bottom: 0;
}

.ysc-address-option:hover,
.ysc-address-option:focus {
    background: rgba(32, 167, 72, 0.08);
    outline: none;
}

.ysc-address-empty {
    padding: 14px 16px;
    color: #6b7280;
    font-size: 14px;
}

@keyframes ysc-spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

@media (max-width: 768px) {
    .ysc-tabs {
        gap: 4px;
    }

    .ysc-tab {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 13px;
        border-radius: 16px 16px 0 0;
    }

    .ysc-panel {
        border-radius: 0 22px 22px 22px;
        padding: 24px 18px 28px;
    }

    .ysc-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 22px;
    }

    .ysc-grid-3 {
        grid-template-columns: 1fr;
    }

    .ysc-select,
    .ysc-input {
        min-height: 48px;
        font-size: 14px;
    }

    .ysc-btn {
        width: 100%;
        font-size: 16px;
    }
}
