/* Main Container */
.aliexpress-product-fetcher {
    max-width: 1200px;
    margin: 2rem auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Input Section */
.input-section {
    padding: 2.5rem;
    background: linear-gradient(135deg, #fff6f0 0%, #ffebdc 100%);
    text-align: center;
    border-bottom: 1px solid #ffddd3;
}

.input-section h3 {
    color: #333;
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

#aliexpress-url {
    width: 70%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.25s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

#aliexpress-url:focus {
    border-color: #ff6a00;
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.15);
    outline: none;
}

#fetch-product {
    background: #ff6a00;
    color: white;
    border: none;
    padding: 0.8rem 1.8rem;
    margin-left: 0.8rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

#fetch-product:hover {
    background: #e05d00;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 106, 0, 0.3);
}

.loading {
    display: none;
    align-items: center;
    justify-content: center;
    margin: 12px auto 0;
    padding: 10px 16px;
    width: fit-content;
    color: #ff6a00;
    font-size: 14px;
    font-weight: 500;
    background: rgba(255, 106, 0, 0.05);
    border-radius: 6px;
    border: 1px dashed rgba(255, 106, 0, 0.3);
}

.loading:before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23FF6A00'%3E%3Cpath d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,20a9,9,0,1,1,9-9A9,9,0,0,1,12,21Z' opacity='.15'/%3E%3Cpath d='M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.75s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    animation: spin 1s linear infinite;
}

.ajax-alert {
    display: none;
    margin: 8px auto 0;
    padding: 10px 16px;
    width: fit-content;
    color: #d63638;
    font-size: 14px;
    background: rgba(214, 54, 56, 0.08);
    border-radius: 6px;
    border-left: 3px solid #d63638;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.aliexpress-variations {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #ffddd3;
    border-radius: 5px;
    background: #fff8f5;
}

.aliexpress-variations h3 {
    margin-top: 0;
    color: #333;
}

.variation-group {
    margin-bottom: 15px;
}

.variation-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.variation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variation-option {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 120px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.variation-option:hover {
    border-color: #a0a0a0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.variation-option img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.variation-option:hover img {
    transform: scale(1.05);
}

.option-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.variation-option.selected {
    border-color: #ff6a00;
    background-color: #fff1e6;
    box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.2);
}

.price-display {
    margin: 15px 0;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 10px;
}

.current-price {
    font-weight: bold;
    color: #ff6a00;
    font-size: 1.2em;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-selector label {
    font-size: 14px;
    color: #666;
}

.quantity-input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    -moz-appearance: textfield;
    transition: border 0.2s ease;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input:focus {
    outline: none;
    border-color: #999;
}

.shipping-section {
    margin: 24px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.shipping-options {
    margin-bottom: 16px;
}

.shipping-options label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
}

.shipping-options p {
    padding: 16px 20px;
    margin: 16px 0;
    color: #2d3748;
    font-size: 14px;
    font-weight: 500;
    background: #f8fafc;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.shipping-options p::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30%;
    height: 2px;
    background: #ff6a00;
    animation: loadingBar 1.5s infinite ease-in-out;
}

@keyframes loadingBar {
    0% { left: -30%; width: 30%; }
    50% { width: 60%; }
    100% { left: 100%; width: 30%; }
}

.shipping-method-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background-color: white;
    font-size: 14px;
    color: #1a202c;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #718096 50%),
        linear-gradient(135deg, #718096 50%, transparent 50%);
    background-position:
        calc(100% - 16px) 50%,
        calc(100% - 12px) 50%;
    background-size: 4px 4px;
    background-repeat: no-repeat;
    transition: border 0.2s ease;
}

.shipping-method-select:focus {
    outline: none;
    border-color: #ff6a00;
    box-shadow: 0 0 0 1px rgba(255, 106, 0, 0.2);
}

.delivery-time {
    font-size: 13px;
    color: #b34d00;
    margin: 12px 0;
    display: flex;
    align-items: center;
    background: #fff1e6;
    padding: 8px 12px;
    border-radius: 6px;
}

.delivery-time::before {
    content: "→";
    margin-right: 6px;
    color: #ff6a00;
}

.total-amount {
    padding: 16px;
    background: #fff8f5;
    border-radius: 6px;
    border-left: 3px solid #ff6a00;
}

.total-amount strong {
    display: block;
    font-size: 15px;
    color: #2d3748;
    margin-bottom: 4px;
}

.total-amount br {
    display: none;
}

.total-amount span {
    font-size: 13px;
    color: #718096;
    display: block;
    line-height: 1.5;
}

.shipping-method-select:hover {
    border-color: #cbd5e0;
}

@media (max-width: 480px) {
    .shipping-method-select {
        padding: 10px 14px;
    }
}

.loading-variations {
    padding: 16px 24px;
    margin: 20px 0;
    text-align: center;
    color: #4a5568;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    background-color: #f8fafc;
    border: 1px solid #edf2f7;
    position: relative;
    overflow: hidden;
}

.loading-variations:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        rgba(237, 242, 247, 0) 0%,
        rgba(237, 242, 247, 0.8) 50%,
        rgba(237, 242, 247, 0) 100%);
    animation: shimmer 1.5s infinite;
    z-index: 1;
}

.loading-variations:after {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 12px;
    border: 2px solid #cbd5e0;
    border-top-color: #ff6a00;
    border-radius: 50%;
    vertical-align: middle;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.error {
    color: #cc0000;
    padding: 10px;
    background: #ffebeb;
    border-radius: 4px;
}