/* Shahrchin Frontend Styles */

.shahrchin-restriction-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 13px;
    padding: 15px;
    margin: 15px 0;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    transition: all 0.3s ease; animation: shahrchinSlideIn 0.5s ease-out;
}

.shahrchin-restriction-notice.shahrchin-notice-after_title {
    margin: 10px 0 20px 0;
    border-right: 4px solid #ff9f43;
}

.shahrchin-restriction-notice.shahrchin-notice-meta {
    margin: 10px 0;
    padding: 12px;
    font-size: 13px;
}

.shahrchin-restriction-notice.shahrchin-notice-primary {
    margin: 20px 0;
}

.shahrchin-notice-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.shahrchin-notice-content {
    flex: 1;
}

.shahrchin-notice-title {
    margin: 0 0 5px 0;
    color: #856404;
    font-weight: bold;
    font-size: 15px;
}

.shahrchin-notice-text {
    margin: 0 0 8px 0;
    color: #856404;
}

.shahrchin-allowed-cities {
    color: #856404;
    font-weight: bold;
    background: rgba(255, 193, 7, 0.1);
    padding: 8px 12px;
    border-radius: 3px;
    border-right: 3px solid #ffc107;
    margin: 0;
    line-height: 1.4;
}

/* Elementor compatibility */
.elementor-widget-woocommerce-product-title+.shahrchin-restriction-notice {
    margin-top: 15px;
}

.elementor-product-summary .shahrchin-restriction-notice {
    margin: 15px 0;
}

/* HPOS compatibility */
.woocommerce-product-details__short-description+.shahrchin-restriction-notice {
    margin-top: 20px;
}

.product_meta .shahrchin-restriction-notice {
    border: 1px solid #e1e1e1;
    background: #f8f9fa;
    margin: 10px 0;
    padding: 10px;
}

.shahrchin-cart-notice,
.shahrchin-checkout-notice {
    background: #d9edf7;
    border: 1px solid #bce8f1;
    color: #31708f;
    border-radius: 13px;
    padding: 15px;
    margin: 20px 0;
}

.shahrchin-cart-notice:after,
.shahrchin-checkout-notice:after,
#shahrchin-checkout-warning:after {
    content: '';
    position: absolute;
    width: 0;
    height: calc(100% - 44px);
    border-left: 1px solid;
    border-right: 2px solid;
    border-bottom-left-radius: 3px;
    border-top-left-radius: 3px;
    right: 0;
    top: 50%;
    transform: translate(0, -50%);
    height: 40px;
}

.shahrchin-cart-notice:before,
.shahrchin-checkout-notice:before,
#shahrchin-checkout-warning:before {
    font-size: 25px;
}

.shahrchin-cart-notice h3,
.shahrchin-checkout-notice h3 {
    margin: 0 !important;
    color: #0c5460;
    font-size: 16px;
}

.shahrchin-cart-notice p,
.shahrchin-checkout-notice p {
    margin: 0 !important;
}

.shahrchin-restricted-products>p {
    margin-bottom: 5px !important;
}

.shahrchin-cart-notice ul,
.shahrchin-checkout-notice ul {
    margin: 0 !important;
    padding-right: 20px;
    display: block;
    width: 100%;
}

.shahrchin-cart-notice li,
.shahrchin-checkout-notice li {
    margin-bottom: 8px;
    color: #155724;
}

/* Theme specific adjustments */
.single-product .shahrchin-restriction-notice {
    border-right: 4px solid #ff9f43;
}

.single-product .shahrchin-restriction-notice strong {
    color: #e55039;
}

/* Cart page specific styles */
.woocommerce-cart .shahrchin-cart-notice {
    /*border-right: 4px solid #3742fa;*/
}

/* Checkout page specific styles */
.woocommerce-checkout .shahrchin-checkout-notice {
    /*border-right: 4px solid #2ed573;*/
}

/* Responsive design */
@media (max-width: 768px) {
    .shahrchin-restriction-notice {
        padding: 12px;
        margin: 15px 0;
        font-size: 13px;
        flex-direction: column;
        gap: 8px;
    }

    .shahrchin-notice-icon {
        align-self: flex-start;
    }

    .shahrchin-allowed-cities {
        padding: 6px 10px;
    }

    .shahrchin-cart-notice,
    .shahrchin-checkout-notice {
        padding: 12px;
        margin: 15px 0;
        font-size: 13px;
    }

    .shahrchin-restricted-products ul {
        flex-direction: column;
    }

    .shahrchin-restricted-products li {
        width: 100%;
    }
}

.shahrchin-restriction-notice+.shahrchin-restriction-notice {
    opacity: 0;
    pointer-events: none;
}

#shahrchin-checkout-warning {
    background: #fcf8e3;
    border: 1px solid #faebcc;
    border-radius: 13px;
    padding: 20px;
    margin: 20px 0;
    color: #8a6d3b;
    position: relative;
}

#shahrchin-checkout-warning h3 {
    margin: 0 !important;
    color: #856404;
    font-size: 16px;
}

.shahrchin-restricted-products ul {
    margin: 10px 0;
    padding-right: 0 !important;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    list-style-type: decimal;
    list-style-position: inside;
}

.shahrchin-restricted-products {
    margin-right: 10px;
}

#shahrchin-checkout-warning p {
    display: flex;
    align-items: center;
}

.shahrchin-restricted-products .quantity {
    color: #666;
    font-size: 12px;
}

.shahrchin-restricted-products li {
    border: 1px solid #f0c674;
    border-radius: 10px;
    padding: 12px 20px;
    background: #fffadd;
    margin-bottom: 0 !important;
    color: #856404;
    min-width: 210px;
}

.shahrchin-actions {
    border-top: 1px dashed #f0c674;
    padding-top: 10px;
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: center;
    animation: slideUpFadeIn 0.5s ease-out;
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#shahrchin-remove-restricted {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

#shahrchin-remove-restricted:hover {
    background: #c0392b;
}

#shahrchin-remove-restricted:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.spinner {
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxjaXJjbGUgY3g9IjEwIiBjeT0iMTAiIHI9IjkiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzMzMyIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtZGFzaGFycmF5PSI1IDUiLz4KPC9zdmc+') no-repeat center;
    display: inline-block;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.shahrchin-restriction-notice {
    transition: all 0.3s ease;
    position: relative;
}

.shahrchin-restriction-notice.elementor-positioned {
    margin-top: 15px;
    margin-bottom: 20px;
}

.shahrchin-restriction-notice.elementor-product-widget {
    font-size: 13px;
    padding: 12px;
}

.shahrchin-allowed-cities {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.shahrchin-allowed-cities:hover {
    background-color: rgba(255, 193, 7, 0.2);
    transform: translateX(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.shahrchin-allowed-cities.expanded {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
}

.notice-dismiss {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
    outline: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.notice-dismiss:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.notice-dismiss:before {
    content: "×";
    font-size: 16px;
    color: #666;
    line-height: 1;
    font-weight: bold;
}

.notice-dismiss:hover:before {
    color: #000;
}

.notice-dismiss {
    display: none !important;
}

.has-city-restriction {
    position: relative;
    border: 1px solid #ff9f43 !important;
    background: rgba(255, 159, 67, 0.05) !important;
}

.has-city-restriction::before {
    content: "⚠️";
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 14px;
    opacity: 0.8;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

.has-city-restriction:hover::before {
    opacity: 1;
    transform: scale(1.1);
}

.restriction-tooltip {
    position: absolute;
    top: -60px;
    right: 10px;
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1000;
    white-space: nowrap;
    max-width: 250px;
    white-space: normal;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.restriction-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 20px;
    border: 5px solid transparent;
    border-top-color: #333;
}

.restriction-tooltip .tooltip-content {
    line-height: 1.4;
}

.has-city-restriction:hover .restriction-tooltip {
    display: block !important;
    animation: tooltipFadeIn 0.3s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


@keyframes shahrchinSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shahrchin-checkout-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    color: #666;
    font-weight: 500;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
}

.shahrchin-checkout-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.shahrchin-success-message {
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

#shahrchin-checkout-warning.shahrchin-success {
    background: linear-gradient(135deg, #f0fff4, #e8f5e8);
    border-left-color: #4caf50;
}


.shahrchin-checkout-loading~.shahrchin-actions {
    display: none !important;
}

.shahrchin-actions {
    display: flex;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 107, 107, 0.15);
    text-align: center;
    width: 100%;
    justify-content: center;
    gap: 10px;
    align-items: center;
    animation: slideUpFadeIn 0.5s ease-out;
}