/**
 * Dealer Portal Styles
 */

/* Forms */
.cysec-form {
    max-width: 500px;
    margin: 20px 0;
}

.cysec-form p {
    margin-bottom: 15px;
}

.cysec-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.cysec-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.cysec-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Buttons */
.cysec-button {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.cysec-button:hover {
    background: #005a87;
    color: #fff;
}

.cysec-button:active {
    background: #004a70;
}

/* Dashboard */
.cysec-dealer-dashboard {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
}

.cysec-welcome {
    margin-bottom: 20px;
    padding: 15px;
    background: #f0f0f1;
    border-radius: 4px;
}

.cysec-profile {
    margin-bottom: 30px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.cysec-profile h3 {
    margin-top: 0;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.cysec-profile p {
    margin: 10px 0;
}

.cysec-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Login */
.cysec-dealer-login {
    max-width: 400px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cysec-dealer-login h2 {
    margin-top: 0;
    text-align: center;
    color: #333;
}

/* WordPress Registration Form Styling */
.register #reg_passmail {
    display: none;
}

.register p label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.register p input[type="text"],
.register p input[type="email"],
.register p input[type="tel"],
.register p input[type="password"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 10px;
}

.register p input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Messages */
.cysec-errors {
    padding: 12px;
    margin-bottom: 20px;
    background: #fce8e6;
    border-left: 4px solid #d63638;
    color: #721c24;
    border-radius: 4px;
}

.cysec-success {
    padding: 12px;
    margin-bottom: 20px;
    background: #d4edda;
    border-left: 4px solid #00a32a;
    color: #155724;
    border-radius: 4px;
}

.cysec-warning {
    padding: 12px;
    margin-bottom: 20px;
    background: #fff3cd;
    border-left: 4px solid #ffb900;
    color: #856404;
    border-radius: 4px;
}

.cysec-error {
    padding: 12px;
    margin-bottom: 20px;
    background: #fce8e6;
    border-left: 4px solid #d63638;
    color: #721c24;
    border-radius: 4px;
}

/* Tables */
.cysec-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
}

.cysec-table thead {
    background: #f0f0f1;
}

.cysec-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.cysec-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.cysec-table tbody tr:hover {
    background: #f9f9f9;
}

/* Price List */
.cysec-price-list {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.cysec-search-form {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.cysec-search-form input[type="search"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Orders */
.cysec-orders {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

/* Catalogue */
.cysec-catalogue,
.cysec-catalogue-wrapper {
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
}

/* Catalogue Top Bar */
.cysec-catalogue-topbar {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.cysec-catalogue-topbar .cysec-search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cysec-catalogue-topbar input[type="search"] {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Catalogue Filters */
.cysec-catalogue-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    align-items: center;
}

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

.cysec-filter-group label {
    font-weight: 600;
    font-size: 14px;
    margin: 0;
    white-space: nowrap;
}

.cysec-filter-group select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.cysec-view-toggle {
    margin-left: auto;
    display: flex;
    gap: 5px;
}

.cysec-view-toggle a {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    background: #fff;
    transition: all 0.2s;
}

.cysec-view-toggle a:hover {
    background: #f0f0f1;
}

.cysec-view-toggle a.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Products Grid/List */
.cysec-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.cysec-products-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.cysec-products-list .cysec-product-card {
    display: flex;
    flex-direction: row;
    gap: 20px;
    padding: 15px;
}

.cysec-products-list .cysec-product-image {
    flex: 0 0 150px;
    margin-bottom: 0;
}

.cysec-products-list .cysec-product-info {
    flex: 1;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cysec-products-list .cysec-product-actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Product Card */
.cysec-product-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.cysec-product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.cysec-product-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    transition: box-shadow 0.2s;
}

.cysec-product-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cysec-product-image {
    margin-bottom: 15px;
    text-align: center;
}

.cysec-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.cysec-product-info {
    text-align: center;
}

.cysec-product-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.cysec-product-title a {
    color: #333;
    text-decoration: none;
}

.cysec-product-title a:hover {
    color: #0073aa;
}

.cysec-product-sku {
    font-size: 12px;
    color: #666;
    margin: 5px 0;
}

.cysec-product-price {
    margin: 15px 0;
    font-size: 18px;
}

.cysec-product-price .cysec-dealer-price {
    color: #0073aa;
    font-weight: 600;
    display: block;
}

.cysec-product-price .cysec-regular-price {
    color: #666;
    font-size: 14px;
}

.cysec-product-price .cysec-regular-price del {
    color: #999;
}

.cysec-product-stock {
    margin: 10px 0;
    font-size: 14px;
}

.cysec-product-price-section {
    margin: 15px 0;
}

.cysec-dealer-price {
    color: #0073aa;
    font-weight: 600;
    font-size: 20px;
    display: block;
    margin-bottom: 5px;
}

.cysec-dealer-price .cysec-price-label {
    font-size: 12px;
    font-weight: normal;
    color: #666;
    display: block;
    margin-bottom: 3px;
}

.cysec-dealer-price .cysec-price-value {
    font-size: 22px;
    font-weight: 700;
}

.cysec-regular-price {
    color: #666;
    font-size: 14px;
}

.cysec-regular-price del {
    color: #999;
}

.cysec-product-stock {
    margin: 10px 0;
    font-size: 14px;
}

.cysec-stock-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.cysec-stock-badge.stock-in {
    background: #d4edda;
    color: #155724;
}

.cysec-stock-badge.stock-limited {
    background: #fff3cd;
    color: #856404;
}

.cysec-stock-badge.stock-out {
    background: #f8d7da;
    color: #721c24;
}

.cysec-stock-qty {
    color: #666;
    font-size: 12px;
    margin-left: 5px;
}

/* Quantity Controls */
.cysec-qty-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.cysec-qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cysec-qty-btn:hover {
    background: #f0f0f1;
    border-color: #0073aa;
    color: #0073aa;
}

.cysec-quantity-input {
    width: 60px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.cysec-qty-quick {
    padding: 4px 8px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.cysec-qty-quick:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.cysec-product-actions {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cysec-add-to-cart {
    width: 100%;
    text-align: center;
    padding: 10px;
    font-size: 14px;
}

.cysec-add-to-cart:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cysec-no-products {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

/* Status badges */
.cysec-stock-in {
    color: #00a32a;
    font-weight: 600;
}

.cysec-stock-out {
    color: #d63638;
    font-weight: 600;
}

.cysec-sync-success {
    color: #00a32a;
    font-weight: 600;
}

.cysec-sync-failed {
    color: #d63638;
    font-weight: 600;
}

.cysec-sync-retrying {
    color: #ffb900;
    font-weight: 600;
}

.cysec-sync-pending {
    color: #666;
    font-weight: 600;
}

/* Dealer Price */
.cysec-dealer-price {
    color: #0073aa;
    font-weight: 600;
}

.cysec-dealer-price small {
    font-size: 0.85em;
    color: #666;
    font-weight: normal;
}

.cysec-price-warning {
    color: #d63638;
    font-style: italic;
}

/* Pagination */
.cysec-pagination {
    margin: 20px 0;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.cysec-pagination span {
    padding: 0 15px;
}

/* Footer Link */
.cysec-footer-dealer-link {
    text-align: center;
    padding: 10px 0;
    margin-top: 20px;
    border-top: 1px solid #eee;
}

.cysec-footer-link {
    display: inline-block;
    padding: 8px 16px;
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.cysec-footer-link:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Hide WooCommerce Cart */
.woocommerce-cart,
body.woocommerce-cart,
.woocommerce-page.woocommerce-cart,
body.woocommerce-page.woocommerce-cart {
    display: none !important;
}

.woocommerce-checkout,
body.woocommerce-checkout,
.woocommerce-page.woocommerce-checkout,
body.woocommerce-page.woocommerce-checkout {
    display: none !important;
}

/* Hide cart menu items */
.menu-item-cart,
.menu-item-woocommerce-cart,
li.menu-item-cart,
li.menu-item-woocommerce-cart {
    display: none !important;
}

/* Hide cart widgets */
.widget_shopping_cart,
.widget_woocommerce_widget_cart {
    display: none !important;
}

/* Hide cart shortcode */
.woocommerce-cart-shortcode,
[class*="cart"] {
    display: none !important;
}

/* Floating Cart Button */
.cysec-floating-cart {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.cysec-cart-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s;
    font-weight: 600;
}

.cysec-cart-button:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    color: #fff;
}

.cysec-cart-icon {
    font-size: 24px;
}

.cysec-cart-count {
    background: #fff;
    color: #0073aa;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.cysec-cart-text {
    font-size: 14px;
}

/* Cart Page */
.cysec-dealer-cart {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.cysec-cart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.cysec-cart-table thead {
    background: #f0f0f1;
}

.cysec-cart-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.cysec-cart-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.cysec-cart-table tbody tr:last-child td {
    border-bottom: none;
}

.cysec-cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cysec-cart-qty-controls .cysec-qty-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
}

.cysec-cart-qty-controls .cysec-quantity-input {
    width: 50px;
    height: 28px;
}

.cysec-remove-item {
    background: #d63638;
    color: #fff;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.2s;
}

.cysec-remove-item:hover {
    background: #b32d2e;
}

.cysec-cart-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

.cysec-button-primary {
    background: #00a32a;
}

.cysec-button-primary:hover {
    background: #008a20;
}

.cysec-button-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Checkout Customization */
.cysec-checkout-notice {
    background: #e7f5fe;
    border-left: 4px solid #0073aa;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.cysec-checkout-notice p {
    margin: 5px 0;
}

.cysec-checkout-notice ul {
    margin: 10px 0 0 20px;
}

.cysec-order-confirmation {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.cysec-order-confirmation h3 {
    margin-top: 0;
    color: #0073aa;
}

.cysec-success-message {
    background: #d4edda;
    border-left: 4px solid #00a32a;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    color: #155724;
}

.cysec-error-message {
    background: #f8d7da;
    border-left: 4px solid #d63638;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    color: #721c24;
}

.cysec-warning-message {
    background: #fff3cd;
    border-left: 4px solid #ffb900;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    color: #856404;
}

.cysec-info-message {
    background: #e7f5fe;
    border-left: 4px solid #0073aa;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    color: #004085;
}

/* Order History Enhancements */
.cysec-order-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.cysec-status-processing {
    background: #fff3cd;
    color: #856404;
}

.cysec-status-completed {
    background: #d4edda;
    color: #155724;
}

.cysec-status-pending {
    background: #e7f5fe;
    color: #004085;
}

.cysec-status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.cysec-sync-badge {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 14px;
    margin-left: 8px;
}

.cysec-sync-badge.cysec-sync-success {
    background: #d4edda;
    color: #155724;
}

.cysec-sync-badge.cysec-sync-failed {
    background: #f8d7da;
    color: #721c24;
}

.cysec-sync-badge.cysec-sync-retrying {
    background: #fff3cd;
    color: #856404;
}

.cysec-sync-badge.cysec-sync-pending {
    background: #e7f5fe;
    color: #004085;
}

/* Responsive */
@media (max-width: 768px) {
    .cysec-table {
        font-size: 14px;
    }
    
    .cysec-table th,
    .cysec-table td {
        padding: 8px;
    }
    
    .cysec-actions {
        flex-direction: column;
    }
    
    .cysec-button {
        width: 100%;
        text-align: center;
    }
    
    .cysec-footer-dealer-link {
        padding: 8px 0;
    }
    
    .cysec-footer-link {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .cysec-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .cysec-product-item,
    .cysec-product-card {
        padding: 10px;
    }
    
    .cysec-catalogue-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cysec-filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cysec-filter-group select {
        width: 100%;
    }
    
    .cysec-view-toggle {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    
    .cysec-floating-cart {
        bottom: 20px;
        right: 20px;
    }
    
    .cysec-cart-button {
        padding: 12px 16px;
        font-size: 12px;
    }
    
    .cysec-cart-text {
        display: none;
    }
    
    .cysec-cart-table {
        font-size: 12px;
    }
    
    .cysec-cart-table th,
    .cysec-cart-table td {
        padding: 8px;
    }
    
    .cysec-cart-actions {
        flex-direction: column;
    }
    
    .cysec-cart-actions .cysec-button {
        width: 100%;
    }
    
    .cysec-products-list .cysec-product-card {
        flex-direction: column;
    }
    
    .cysec-products-list .cysec-product-image {
        flex: 0 0 auto;
    }
}
