/* WooState Frontend Styles */


.woostate-wrapper {
    --ws-primary: #2563eb;
    --ws-secondary:#211195;
    --ws-hover: #3b82f6;
    --ws-active: #ef4444;
    --ws-bg: #f8fafc;
    --ws-text: #1f2937;
    --ws-badge: #2563eb;
    --ws-badge-text: #ffffff;
    direction: rtl;
    background: var(--ws-bg);
    border-radius: 16px;
    padding: 24px;
    margin: 20px 0;
    color: var(--ws-text);
}

/* Main Title */
.woostate-main-title {
    text-align: center;
    margin-bottom: 20px;
}

.woostate-main-title h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--ws-text);
    margin: 0;
}

/* View Switcher */
.woostate-view-switcher {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.ws-view-btn {
    padding: 10px 24px;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    background: #ffffff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.25s ease;
}

.ws-view-btn:hover {
    border-color: var(--ws-primary);
    color: var(--ws-primary);
}

.ws-view-btn.active {
    background: var(--ws-primary);
    border-color: var(--ws-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

/* Views */
.woostate-view {
    display: none;
}

.woostate-view.active {
    display: block;
    animation: wsSlideIn 0.3s ease;
}

@keyframes wsSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Map View */
.woostate-map-wrapper {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.woostate-map-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.woostate-legend-items {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 13px;
    color: #64748b;
}

.woostate-legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
    margin-left: 6px;
    vertical-align: middle;
}

.woostate-map-tip {
    font-size: 13px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.woostate-svg-container {
    width: 100%;
    overflow: visible;
}

.woostate-iran-svg {
    width: 100%;
    height: auto;
    /* max-height: 600px; */
}

/* Map Styles */
.woostate-style-dark .woostate-map-wrapper,
.woostate-style-neon .woostate-map-wrapper {
    background: #0f172a;
}

.woostate-style-dark .woostate-map-legend,
.woostate-style-neon .woostate-map-legend {
    border-color: #1e293b;
}

.woostate-style-dark .woostate-map-tip,
.woostate-style-neon .woostate-map-tip { color: #475569; }

.woostate-style-neon .woostate-map-wrapper { background: #050011; }

/* Tooltip */
.woostate-map-tooltip {
    position: fixed;
    background: rgba(15,23,42,0.95);
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    min-width: 160px;
}

.woostate-tooltip-name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.woostate-tooltip-count {
    color: #94a3b8;
    font-size: 12px;
    margin-bottom: 6px;
}

.woostate-tooltip-action {
    color: #60a5fa;
    font-size: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 6px;
    margin-top: 6px;
}

/* List View */
.woostate-list-grid {
    display: grid;
    gap: 12px;
}

.woostate-cols-2 { grid-template-columns: repeat(2, 1fr); }
.woostate-cols-3 { grid-template-columns: repeat(3, 1fr); }
.woostate-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .woostate-cols-3,
    .woostate-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .woostate-cols-2,
    .woostate-cols-3,
    .woostate-cols-4 { grid-template-columns: 1fr; }
}

.woostate-province-card-front {
    background: var(--ws-card, #ffffff);
    border: 1.5px solid var(--ws-border, #e2e8f0);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.25s ease;
    cursor: default;
}

.woostate-province-card-front.has-products {
    cursor: pointer;
}

.woostate-province-card-front.has-products:hover {
    border-color: var(--ws-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,99,235,0.15);
}

.woostate-province-card-front.no-products {
    opacity: 0.6;
}

.woostate-province-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.woostate-province-info {
    flex: 1;
}

.woostate-province-info h4 {
    margin: 0 0 6px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--ws-text) !important;
}

.woostate-count-badge {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.woostate-count-badge.has {
    background: var(--ws-badge);
    color: var(--ws-badge-text);
}

.woostate-count-badge.none {
    background: #f1f5f9;
    color: #94a3b8;
}

.woostate-province-arrow {
    color: var(--ws-primary);
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.woostate-province-card-front.has-products:hover .woostate-province-arrow {
    opacity: 1;
    transform: translateX(-4px);
}

/* Modal */
.woostate-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.woostate-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,0.7);
    backdrop-filter: blur(6px);
}

.woostate-modal-container {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    animation: wsModalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
    overflow: hidden;
}

@keyframes wsModalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.woostate-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: white;
}

.woostate-modal-title {
    flex: 1;
    margin: 0 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: white !important;
}

.woostate-modal-count {
    background: rgba(255,255,255,0.2);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.woostate-modal-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.woostate-modal-close:hover {
    background: rgba(255,255,255,0.3);
}

.woostate-modal-body {
    overflow-y: auto;
    padding: 24px;
    flex: 1;
}

/* Products Grid in Modal */
.woostate-products-grid-inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 640px) {
    .woostate-products-grid-inner { grid-template-columns: repeat(2, 1fr); }
}

/* Product Card */
.woostate-product-card {
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--ws-card, #ffffff);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.woostate-product-card:hover {
    border-color: var(--ws-primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(37,99,235,0.15);
}

.woostate-product-link {
    text-decoration: none;
    color: inherit;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.woostate-product-thumb {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background: #f8fafc;
}

.woostate-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.woostate-product-card:hover .woostate-product-thumb img {
    transform: scale(1.05);
}

.woostate-sale-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ef4444;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.woostate-product-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.woostate-product-info h4 {
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    line-height: 1.4 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.woostate-product-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--ws-primary);
}

.woostate-product-price .woocommerce-Price-amount {
    color: var(--ws-primary);
}

.woostate-add-to-cart {
    width: 100%;
    padding: 10px;
    background: var(--ws-primary, #2563eb);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.woostate-add-to-cart:hover {
    background: #1d4ed8;
}

/* Loading Spinner */
.woostate-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    color: #64748b;
    font-size: 15px;
}

.woostate-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--ws-primary, #2563eb);
    border-radius: 50%;
    animation: wsSpinner 0.8s linear infinite;
}

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

/* Empty State */
.woostate-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.woostate-empty-icon {
    font-size: 60px;
    margin-bottom: 16px;
}

.woostate-empty-state p {
    font-size: 16px;
    margin: 0;
}

/* Direct Province Products */
.woostate-province-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin-bottom: 20px !important;
    display: flex;
    align-items: center;
    gap: 10px;
    direction: rtl;
}

.woostate-province-title span {
    font-size: 15px;
    color: #64748b;
    font-weight: 400;
}

.woostate-products-direct {
    display: grid;
    gap: 16px;
}

.woostate-empty {
    text-align: center;
    padding: 40px;
    background: #f8fafc;
    border-radius: 12px;
    color: #64748b;
}

.wc-forward {
    width: 100%;
    padding: 10px;
    background: var(--ws-secondary, #211195);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: background 0.2s ease;
    text-align: center;
}


/* ── Mini Cart in Modal ── */
.woostate-modal-header {
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.woostate-modal-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.woostate-mini-cart {
    position: relative;
    flex-shrink: 0;
}

.woostate-mini-cart-toggle {
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.3);
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
}

.woostate-mini-cart-toggle:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
}

.woostate-mini-cart-toggle svg {
    width: 20px;
    height: 20px;
}

.woostate-cart-badge {
    position: absolute;
    top: -7px;
    left: -7px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #1e40af;
    animation: wsBadgePop 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes wsBadgePop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

.woostate-mini-cart-toggle.has-items {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.5);
}

/* Dropdown */
.woostate-cart-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 320px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    z-index: 1000;
    overflow: hidden;
    animation: wsDropIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
    border: 1px solid #e2e8f0;
    direction: rtl;
}

@keyframes wsDropIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.woostate-cart-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.woostate-cart-dropdown-header strong {
    font-size: 14px;
    color: #1e293b;
}

.woostate-cart-total {
    font-size: 13px;
    font-weight: 700;
    color: #2563eb;
}

.woostate-cart-items {
    max-height: 260px;
    overflow-y: auto;
    padding: 8px 0;
}

.woostate-cart-empty {
    text-align: center;
    padding: 24px;
    color: #94a3b8;
    font-size: 13px;
}

.woostate-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    transition: background 0.15s ease;
    position: relative;
}

.woostate-cart-item:hover {
    background: #f8fafc;
}

.woostate-cart-item-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.woostate-cart-item-info {
    flex: 1;
    min-width: 0;
}

.woostate-cart-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.woostate-cart-item-meta {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.woostate-cart-item-qty {
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.woostate-cart-item-price {
    font-weight: 700;
    color: #2563eb;
    font-size: 12px;
}

.woostate-cart-item-remove {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.woostate-cart-item-remove:hover {
    background: #fef2f2;
    color: #ef4444;
}

.woostate-cart-actions {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.woostate-cart-btn {
    flex: 1;
    text-align: center;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    display: block;
}

.woostate-cart-btn-primary {
    background: #2563eb;
    color: white;
}

.woostate-cart-btn-primary:hover {
    background: #1d4ed8;
    color: white;
}

.woostate-cart-btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

.woostate-cart-btn-secondary:hover {
    background: #cbd5e1;
    color: #1e293b;
}

/* Add to cart success animation */
.woostate-add-to-cart.added-flash {
    animation: wsAddedFlash 0.5s ease;
}

@keyframes wsAddedFlash {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.06); background: #16a34a; }
    100% { transform: scale(1); }
}


/* ── Modal Filter Bar ── */
.woostate-modal-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    direction: rtl;
}

.woostate-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.woostate-filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.woostate-filter-select {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    color: #1e293b;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s ease;
    direction: rtl;
    min-width: 160px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    padding-left: 30px;
}

.woostate-filter-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.woostate-filter-results {
    margin-right: auto;
    gap: 10px;
}

#woostate-filter-count {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.woostate-filter-reset-btn {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    transition: all 0.2s ease;
}

.woostate-filter-reset-btn:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

@media (max-width: 600px) {
    .woostate-modal-filters {
        padding: 10px 16px;
        gap: 8px;
    }
    .woostate-filter-select {
        min-width: 130px;
        font-size: 12px;
    }
}
