:root {
    --danger-color: #ff2a2a;
    --text-color: #000;
    --bg-color: #fff;
    --modal-bg: #fff;
    --gray-light: #f7f7f7;
    --success-color: #28a745;
    --error-color: #dc3545;
}

.my-popup-cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.51);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    overflow: hidden;
}

.my-popup-cart-modal.my-popup-show {
    display: block;
    opacity: 1;
    z-index: 99999;
}

body.my-popup-open {
    overflow: hidden;
    height: 100vh;
}

.my-popup-cart-content {
    background: rgba(195, 194, 194, 0.07);
    -webkit-backdrop-filter: blur(15px);
    -moz-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    width: 600px;
    margin: 50px auto;
    padding: 0;
    position: relative;
    border-radius: 16px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    transform: translateY(-20px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border: solid 1px #ffffff17;
    overflow: hidden;
}

@supports not ((-webkit-backdrop-filter: blur(15px)) or (backdrop-filter: blur(15px))) {
    .my-popup-cart-modal {
        background: rgba(0, 0, 0, 0.5);
    }
    .my-popup-cart-content {
        background: rgba(195, 194, 194, 0.1);
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    }
}

.my-popup-cart-modal.my-popup-show .my-popup-cart-content {
    animation: slideIn 0.5s ease forwards;
}

.my-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    color: #fff;
    font-size: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 20;
}

.my-popup-top-bar {
    background: linear-gradient(90deg, #ff2a2a, #e10000);
    padding: 12px;
    text-align: center;
    color: #fff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 0;
}

.my-popup-top-bar .my-popup-discount-text {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    padding: 0;
}

.my-popup-top-bar .my-popup-discount-text strong {
    font-weight: 700;
}

.my-popup-products-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 16px;
    flex-grow: 1;
    -webkit-overflow-scrolling: touch;
}

.my-popup-products-list::-webkit-scrollbar {
    width: 8px;
}

.my-popup-products-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.my-popup-products-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.my-popup-product-card {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
}

.my-popup-cart-item-remove {
    position: absolute;
    top: 8px;
    left: 8px;
    cursor: pointer;
    color: red;
    font-size: 16px;
    background: none;
    border: none;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.my-popup-cart-item-remove:hover {
    background-color: red;
    color: #fff;
}

.my-popup-product-image img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.my-popup-product-details {
    flex: 1;
    margin-right: 12px;
}

.my-popup-product-details h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.my-popup-product-details .my-popup-product-price {
    font-size: 13px;
    color: #777;
    margin-top: 4px;
}

.my-popup-product-quantity {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.my-popup-product-quantity button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #ff6f61;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    padding: 0.1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    outline: none;
}

.my-popup-product-quantity button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background: #ff483a;
}

.my-popup-product-quantity button:active {
    transform: scale(0.95);
}

.my-popup-product-quantity input {
    width: 60px;
    height: 32px;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    color: #333;
    margin: 0 5px;
    background: #fff;
    -webkit-appearance: none;
    -moz-appearance: textfield !important;
    appearance: none;
}

.my-popup-product-quantity input::-webkit-inner-spin-button,
.my-popup-product-quantity input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.my-popup-cart-footer {
    padding: 16px;
    background: rgba(195, 194, 194, 0.05);
    flex-shrink: 0;
}

.my-popup-total-section {
    margin: 12px 0;
    text-align: right;
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    padding: 0 16px;
}

.my-popup-total-section strong {
    font-weight: 700;
}

.my-popup-discount-section {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    padding: 0 16px;
}

.my-popup-discount-section input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    width: 120px;
}

.my-popup-button {
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    box-sizing: border-box;
    display: inline-block;
    text-align: center;
    min-width: 100px;
    background: #5027b0;
    color: #fff;
}

.my-popup-button.my-popup-next-step {
    background: #ff9800;
    margin-bottom: 17px;
    margin-top: 10px;
}

.my-popup-button.my-popup-back-step {
    background: #ff9800;
}

.my-popup-button.my-popup-instant-buy {
    background: #2196f3;
    width: 100%;
    padding: 12px;
}

.my-popup-button.my-popup-continue-shopping {
  background:#5027b0;
  margin-top: 12px;
  margin-bottom: 12px;
}

@media (max-width: 768px) {

    .my-popup-button.my-popup-continue-shopping {
  margin-top: 9px;
  margin-bottom: 9px;
}
.my-popup-button.my-popup-next-step {
    margin-bottom: 7px;
    margin-top: 10px;
}

}


.my-popup-button.my-popup-apply-discount {
    background: #4caf50;
    padding: 6px 10px;
    min-width: 80px;
}

.my-popup-button.my-popup-verify,
.my-popup-button.my-popup-send-verification {
    background: #ff9800;
    padding: 9px 12px;
    min-width: 80px;
}

.my-popup-button:hover {
    transform: scale(1.05);
}

.my-popup-button.my-popup-next-step:hover,
.my-popup-button.my-popup-back-step:hover,
.my-popup-button.my-popup-verify:hover,
.my-popup-button.my-popup-send-verification:hover {
    background: #f57c00;
}

.my-popup-button.my-popup-instant-buy:hover:not(:disabled) {
    background: #1976d2;
}

.my-popup-button.my-popup-continue-shopping:hover {
    background: #7b1fa2;
}

.my-popup-button.my-popup-apply-discount:hover {
    background: #388e3c;
}

.my-popup-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.my-popup-discount-message {
    font-size: 13px;
    margin-top: 4px;
    color: green;
    padding: 0 16px;
}

.my-popup-user-details {
    margin: 12px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 16px;
}

.my-popup-user-details .my-popup-form-group {
    margin-bottom: 10px;
}

.my-popup-user-details .my-popup-form-group.my-popup-name-field,
.my-popup-user-details .my-popup-form-group.my-popup-mobile-field {
    width: calc(50% - 5px);
}

.my-popup-user-details .my-popup-form-group.my-popup-state-field,
.my-popup-user-details .my-popup-form-group.my-popup-city-field {
    width: calc(50% - 5px);
}

.my-popup-user-details .my-popup-form-group.my-popup-full-width {
    width: 100%;
}

.my-popup-user-details .my-popup-form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
    color: #fff;
}

.my-popup-user-details .my-popup-form-group input,
.my-popup-user-details .my-popup-form-group select,
.my-popup-user-details .my-popup-form-group textarea {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 14px;
    box-sizing: border-box;
    background: #fff;
}

.my-popup-user-details .my-popup-verification-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.my-popup-user-details .my-popup-verification-group button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.my-popup-user-details .my-popup-verification-group button.loading span {
    visibility: hidden;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.my-popup-user-details .my-popup-verification-message {
    font-size: 13px;
    margin-top: 5px;
    width: 100%;
}

.my-popup-instant-buy {
    margin: 12px 0;
    padding: 0 16px;
}

.my-popup-cart-actions .my-popup-button {
    flex: 1;
    margin: 0 4px;
}

.my-popup-step-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    gap: 8px;
}

.my-popup-progress-bar {
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.my-popup-progress-bar .my-popup-progress {
    height: 100%;
    background: #2196f3;
    border-radius: 4px;
    width: 50%;
    transition: width 0.3s ease;
}

.my-popup-progress-bar.my-popup-step-2 .my-popup-progress {
    width: 100%;
}

.my-popup-step {
    display: none;
}

.my-popup-step.my-popup-active {
    display: block;
}

@keyframes slideIn {
    0% { transform: translateY(100px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@media (max-width: 600px) {
    .my-popup-cart-modal {
        align-items: flex-end;
        overflow: hidden;
    }

    .my-popup-cart-content {
        width: 100%;
        margin: 0;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        overflow: hidden;
    }

    .my-popup-cart-modal.my-popup-show .my-popup-cart-content {
        transform: translateY(0);
    }

    .my-popup-close {
        top: 5px;
        right: 10px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        z-index: 20;
    }

    .my-popup-top-bar {
        padding: 10px;
        font-size: 13px;
        border-radius: 16px 16px 0 0;
        position: sticky;
        top: 0;
        z-index: 10;
        margin: 0;
    }

    .my-popup-top-bar .my-popup-discount-text {
        font-size: 12px;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
        padding: 0;
    }

    .my-popup-products-list {
        max-height: 200px;
        padding: 10px;
        overflow-y: auto;
    }

    .my-popup-product-card {
        padding: 10px;
    }

    .my-popup-product-image img {
        width: 50px;
        height: 50px;
    }

    .my-popup-product-details h4 {
        font-size: 13px;
    }

    .my-popup-product-details .my-popup-product-price {
        font-size: 12px;
    }

    .my-popup-product-quantity button {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .my-popup-product-quantity input {
        width: 50px;
        height: 28px;
        font-size: 14px;
    }

    .my-popup-cart-footer {
        padding: 10px;
    }

    .my-popup-total-section {
        font-size: 14px;
        padding: 0 10px;
        margin: 8px 0;
    }

    .my-popup-discount-section {
        padding: 0 10px;
        gap: 6px;
        margin: 8px 0;
    }

    .my-popup-discount-section input {
        width: 120px;
        font-size: 13px;
    }

    .my-popup-button.my-popup-apply-discount {
        padding: 5px 8px;
        font-size: 13px;
    }

    .my-popup-discount-message {
        font-size: 12px;
        padding: 0 10px;
        margin: 4px 0;
    }

    .my-popup-user-details {
        padding: 0 10px;
        margin: 8px 0;
    }

    .my-popup-user-details .my-popup-form-group.my-popup-name-field,
    .my-popup-user-details .my-popup-form-group.my-popup-mobile-field {
        width: calc(50% - 5px);
    }

    .my-popup-user-details .my-popup-form-group.my-popup-state-field,
    .my-popup-user-details .my-popup-form-group.my-popup-city-field {
        width: calc(50% - 5px);
    }

    .my-popup-user-details .my-popup-form-group.my-popup-full-width {
        width: 100%;
    }

    .my-popup-user-details .my-popup-verification-group button {
        min-width: 70px;
        font-size: 11px;
    }

    .my-popup-instant-buy {
        padding: 0 10px;
        margin: 8px 0;
    }

    .my-popup-button {
        padding: 8px 15px;
        font-size: 13px;
        min-width: 100px;
    }

    .my-popup-button.my-popup-instant-buy {
        padding: 10px;
    }

    .my-popup-cart-actions {
        flex-direction: column;
        gap: 6px;
        padding: 0 10px;
        margin: 0 0 10px 0;
    }

    .my-popup-cart-actions .my-popup-button {
        width: 100%;
        margin: 0;
    }
}

.my-custom-cart-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: rgba(78, 54, 181, 0.2); /* رنگ اصلی بنفش شفاف */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), inset 0 2px 23px rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease, background 0.3s ease;
}

.my-custom-cart-button:hover {
  transform: scale(1.1);
  background:rgba(80, 198, 255, 0.3);
}

.my-custom-cart-button:active {
  transform: scale(0.95); /* کمی کوچک‌تر میشه موقع کلیک */
  background: rgba(78, 54, 181, 0.4); /* رنگ بنفش تیره‌تر موقع کلیک */
}

.my-custom-cart-button:focus {
  outline: none; /* حذف حاشیه فوکوس پیش‌فرض */
  background: rgba(78, 54, 181, 0.2); /* بازگشت به رنگ اصلی بعد از کلیک */
}

.my-custom-cart-button .cart-icon {
  width: 24px;
  height: 24px;
  color: #fff; /* رنگ آیکون */
  transition: transform 0.3s ease;
}

.my-custom-cart-button:hover .cart-icon {
  transform: rotate(10deg);
}

.my-custom-cart-button.my-custom-pulse {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}