/* Easy Kreditt - Public styles */

.ek-portal {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Portal header */
.ek-portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ek-portal-title {
    margin: 0;
    font-size: 1.75rem;
}

.ek-portal-welcome {
    font-size: 0.95rem;
    color: #555;
}

.ek-company-name {
    font-weight: 600;
    color: #333;
}

/* Navigation */
.ek-portal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.ek-nav-item {
    padding: 0.85rem 1.25rem;
    text-decoration: none;
    color: #444;
    font-size: 0.9rem;
    font-weight: 500;
    border-right: 1px solid #e0e0e0;
    transition: background 0.15s, color 0.15s;
}

.ek-nav-item:last-child {
    border-right: none;
}

.ek-nav-item:hover {
    background: #e9ecef;
    color: #222;
}

.ek-nav-active {
    background: #2271b1;
    color: #fff !important;
}

.ek-nav-active:hover {
    background: #135e96;
}

.ek-nav-logout {
    margin-left: auto;
    color: #999;
}

.ek-nav-logout:hover {
    background: #f8d7da;
    color: #721c24;
}

.ek-cart-count {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Notices */
.ek-notice {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.ek-notice-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Account form */
.ek-account-form {
    max-width: 500px;
}

.ek-account-form h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.ek-form-hint {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
}

.ek-account-form input[type="password"] {
    width: 100%;
    max-width: 300px;
    padding: 0.5rem;
}

/* Order actions */
.ek-order-actions {
    white-space: nowrap;
}

.ek-out-of-stock {
    color: #dc3545;
    font-size: 0.85rem;
    font-weight: 500;
}

.ek-section {
    margin-bottom: 2rem;
}

.ek-section-title {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.ek-section-desc {
    margin-bottom: 0.75rem;
    color: #666;
}

/* Credit balance cards */
.ek-credit-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.ek-credit-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid #e9ecef;
}

.ek-credit-card.ek-credit-total {
    background: #e8f4f8;
    border-color: #b8d4e3;
}

.ek-credit-label,
.ek-overview-label {
    display: block;
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.ek-credit-value,
.ek-overview-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.ek-credit-sublabel {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.25rem;
}

/* Overview cards */
.ek-overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.ek-overview-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid #e9ecef;
}

/* Product grid */
.ek-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

.ek-product-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.ek-product-image {
    display: block;
}

.ek-product-image img {
    width: 100%;
    height: auto;
    display: block;
}

.ek-product-info {
    padding: 1rem;
}

.ek-product-title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.ek-product-title a {
    text-decoration: none;
}

.ek-product-price {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* Tables */
.ek-table,
.ek-orders-table {
    width: 100%;
    border-collapse: collapse;
}

.ek-table th,
.ek-table td,
.ek-orders-table th,
.ek-orders-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.ek-table th,
.ek-orders-table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* Buttons */
.ek-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.875rem;
}

.ek-btn:hover {
    background: #f8f9fa;
}

.ek-btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.ek-btn-primary {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.ek-btn-primary:hover {
    background: #135e96;
    color: #fff;
}

.ek-btn-reorder {
    margin-left: 0.5rem;
}

/* Forms */
.ek-form-row {
    margin-bottom: 1rem;
}

.ek-form-row label {
    display: block;
    margin-bottom: 0.25rem;
}

.ek-form-row input[type="text"],
.ek-form-row input[type="email"],
.ek-form-row input[type="number"] {
    width: 100%;
    max-width: 300px;
    padding: 0.5rem;
}

.ek-add-employee-form {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.ek-add-employee-form h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.ek-credit-limit-input {
    width: 100px;
    padding: 0.35rem;
}

/* Shipping toggles */
.ek-shipping-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.ek-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* Messages */
.ek-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 4px;
}

.ek-message.ek-success {
    background: #d4edda;
    color: #155724;
}

.ek-message.ek-error {
    background: #f8d7da;
    color: #721c24;
}

/* Login / denied */
.ek-portal-login .ek-login-message,
.ek-portal-denied .ek-denied-message {
    margin-bottom: 1rem;
}

.ek-no-orders {
    color: #666;
}

/* Add-to-cart form in product card */
.ek-add-to-cart-form {
    margin-top: auto;
}

.ek-quantity-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ek-quantity-input {
    width: 60px;
    padding: 0.4rem 0.3rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
}

.ek-quantity-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.woocommerce-message {
    background: #d4edda;
    color: #155724;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border-left: 4px solid #28a745;
}

/* Cart tab */
.ek-cart-table {
    width: 100%;
    border-collapse: collapse;
}

.ek-cart-table th,
.ek-cart-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.ek-cart-col-img {
    width: 70px;
}

.ek-cart-col-img img {
    border-radius: 4px;
}

.ek-cart-table tfoot td {
    border-bottom: none;
    padding-top: 1rem;
}

.ek-cart-subtotal td,
.ek-cart-total td {
    font-size: 1.05rem;
}

.ek-text-right {
    text-align: right;
}

.ek-cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    gap: 1rem;
}

.ek-btn-secondary {
    background: #f0f0f0;
    color: #333;
    padding: 0.6rem 1.2rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.ek-btn-secondary:hover {
    background: #e0e0e0;
}

.ek-btn-danger {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    text-decoration: none;
    transition: background 0.2s;
}

.ek-btn-danger:hover {
    background: #c82333;
    color: #fff;
}

.ek-cart-empty {
    color: #666;
    margin-bottom: 1rem;
}
