/**
 * HGE Webshop Stylesheet
 * Responsive design - Mobile first
 */

/* ==========================================
   VARIABLES & RESET
   ========================================== */

:root {
    --hge-primary: #4CAF50;
    --hge-primary-dark: #388E3C;
    --hge-secondary: #2196F3;
    --hge-error: #f44336;
    --hge-success: #4CAF50;
    --hge-warning: #ff9800;
    --hge-info: #2196F3;

    --hge-text: #333;
    --hge-text-light: #666;
    --hge-border: #ddd;
    --hge-bg: #f9f9f9;

    --hge-radius: 8px;
    --hge-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --hge-transition: all 0.3s ease;
}

.hge-webshop-products *,
.hge-shopping-cart *,
.hge-checkout * {
    box-sizing: border-box;
}

/* ==========================================
   MENU CART ICON
   ========================================== */

.menu-item-cart {
    position: relative;
}

.hge-menu-cart-link {
    display: flex !important;
    align-items: center;
    gap: 4px;
    position: relative;
    padding: 8px 12px !important;
}

.hge-cart-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

.hge-cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--hge-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 10px;
    line-height: 1;
    opacity: 0;
    transform: scale(0);
    transition: var(--hge-transition);
}

.hge-cart-count-visible {
    opacity: 1;
    transform: scale(1);
}

.hge-menu-cart-link:hover .hge-cart-icon {
    transform: scale(1.1);
    transition: var(--hge-transition);
}

.hge-menu-cart-link:hover .hge-cart-count {
    background: var(--hge-primary-dark);
}

.screen-reader-text {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ==========================================
   BUTTONS
   ========================================== */

.hge-button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--hge-radius);
    cursor: pointer;
    transition: var(--hge-transition);
    font-family: inherit;
}

.hge-button-primary {
    background: var(--hge-primary);
    color: #fff;
}

.hge-button-primary:hover {
    background: var(--hge-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--hge-shadow);
}

.hge-button-secondary {
    background: #fff;
    color: var(--hge-text);
    border: 2px solid var(--hge-border);
}

.hge-button-secondary:hover {
    border-color: var(--hge-primary);
    color: var(--hge-primary);
}

.hge-button-large {
    padding: 14px 28px;
    font-size: 15px;
    width: 100%;
}

.hge-button-disabled,
.hge-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.hge-button:disabled:hover {
    transform: none;
}

/* ==========================================
   PRODUCT GRID
   ========================================== */

.hge-webshop-products {
    margin: 20px 0;
}

.hge-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
    margin: 20px 0;
}

/* Responsive grid - volledig dynamisch */
@media (max-width: 600px) {
    .hge-products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .hge-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (min-width: 901px) {
    .hge-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 24px;
    }
}

.hge-product-card {
    background: #fff;
    border: 1px solid var(--hge-border);
    border-radius: var(--hge-radius);
    overflow: hidden;
    transition: var(--hge-transition);
    display: flex;
    flex-direction: column;
}

.hge-product-card:hover {
    box-shadow: var(--hge-shadow);
    transform: translateY(-4px);
}

.hge-product-image {
    background: var(--hge-bg);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

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

.hge-product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hge-product-info {
    padding: 16px;
    flex: 1;
}

.hge-product-title {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--hge-text);
}

.hge-product-description {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: var(--hge-text-light);
    line-height: 1.5;
}

.hge-product-price {
    font-size: 19px;
    font-weight: 700;
    color: var(--hge-primary);
    margin: 12px 0;
}

.hge-product-actions {
    padding: 16px;
    border-top: 1px solid var(--hge-border);
}

.hge-quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.hge-quantity-input {
    width: 60px;
    height: 36px;
    text-align: center;
    border: 1px solid var(--hge-border);
    border-radius: var(--hge-radius);
    font-size: 14px;
    margin: 0 8px;
}

.hge-qty-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--hge-border);
    background: #fff;
    border-radius: var(--hge-radius);
    font-size: 16px;
    cursor: pointer;
    transition: var(--hge-transition);
}

.hge-qty-btn:hover {
    background: var(--hge-primary);
    color: #fff;
    border-color: var(--hge-primary);
}

/* ==========================================
   SHOPPING CART
   ========================================== */

.hge-shopping-cart {
    margin: 20px 0;
}

.hge-cart-empty {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: var(--hge-radius);
}

.hge-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.hge-cart-title {
    font-size: 22px;
    margin-bottom: 20px;
}

.hge-cart-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}

.hge-cart-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.hge-cart-table thead {
    background: var(--hge-bg);
}

.hge-cart-table th {
    padding: 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 2px solid var(--hge-border);
}

.hge-cart-table td {
    padding: 12px;
    font-size: 14px;
    border-bottom: 1px solid var(--hge-border);
    vertical-align: middle;
}

.hge-cart-product {
    font-weight: 600;
}

.hge-cart-price,
.hge-cart-subtotal {
    font-weight: 600;
    color: var(--hge-primary);
}

.hge-quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hge-remove-item-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--hge-error);
    background: #fff;
    color: var(--hge-error);
    font-size: 18px;
    cursor: pointer;
    transition: var(--hge-transition);
}

.hge-remove-item-btn:hover {
    background: var(--hge-error);
    color: #fff;
}

.hge-cart-footer {
    margin-top: 30px;
    padding: 24px;
    background: var(--hge-bg);
    border-radius: var(--hge-radius);
}

.hge-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--hge-border);
}

.hge-total-amount {
    color: var(--hge-primary);
}

.hge-cart-actions {
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

/* ==========================================
   CHECKOUT
   ========================================== */

.hge-checkout {
    max-width: 800px;
    margin: 20px auto;
}

.hge-checkout-title {
    font-size: 22px;
    margin-bottom: 24px;
}

.hge-order-summary {
    background: var(--hge-bg);
    padding: 20px;
    border-radius: var(--hge-radius);
    margin-bottom: 24px;
}

.hge-summary-items {
    margin: 16px 0;
}

.hge-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--hge-border);
}

.hge-summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 700;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--hge-border);
}

.hge-summary-amount {
    color: var(--hge-primary);
}

.hge-checkout-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.hge-tab-btn {
    flex: 1;
    padding: 14px;
    background: #fff;
    border: 2px solid var(--hge-border);
    border-radius: var(--hge-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--hge-transition);
}

.hge-tab-btn:hover {
    border-color: var(--hge-primary);
}

.hge-tab-btn.hge-tab-active {
    background: var(--hge-primary);
    color: #fff;
    border-color: var(--hge-primary);
}

.hge-tab-content {
    display: none;
    background: #fff;
    padding: 24px;
    border-radius: var(--hge-radius);
    border: 1px solid var(--hge-border);
}

.hge-tab-content.hge-tab-active {
    display: block;
}

.hge-checkout-form {
    max-width: 600px;
}

.hge-form-group {
    margin-bottom: 20px;
}

.hge-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--hge-text);
}

.hge-form-group label .required {
    color: var(--hge-error);
}

.hge-form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--hge-border);
    border-radius: var(--hge-radius);
    transition: var(--hge-transition);
    font-family: inherit;
}

.hge-form-control:focus {
    outline: none;
    border-color: var(--hge-primary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.hge-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.hge-form-message {
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: var(--hge-radius);
}

.hge-message-success {
    background: #e8f5e9;
    color: var(--hge-success);
    border: 1px solid var(--hge-success);
}

.hge-message-error {
    background: #ffebee;
    color: var(--hge-error);
    border: 1px solid var(--hge-error);
}

/* ==========================================
   PAYMENT RESULT
   ========================================== */

.hge-payment-result {
    max-width: 600px;
    margin: 40px auto;
    padding: 40px;
    background: #fff;
    border-radius: var(--hge-radius);
    text-align: center;
}

.hge-success-icon,
.hge-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.hge-payment-success .hge-success-icon {
    color: var(--hge-success);
}

.hge-payment-failed .hge-error-icon {
    color: var(--hge-error);
}

.hge-order-details {
    margin: 24px 0;
    padding: 20px;
    background: var(--hge-bg);
    border-radius: var(--hge-radius);
}

.hge-order-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--hge-border);
}

.hge-result-actions {
    margin-top: 32px;
}

/* ==========================================
   NOTIFICATIONS
   ========================================== */

.hge-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    font-size: 14px;
    background: #fff;
    border-radius: var(--hge-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.hge-notification-show {
    transform: translateX(0);
}

.hge-notification-success {
    border-left: 4px solid var(--hge-success);
}

.hge-notification-error {
    border-left: 4px solid var(--hge-error);
}

/* ==========================================
   NOTICES
   ========================================== */

.hge-notice {
    padding: 14px 18px;
    margin: 20px 0;
    font-size: 14px;
    border-radius: var(--hge-radius);
    border-left: 4px solid;
}

.hge-notice-info {
    background: #e3f2fd;
    border-color: var(--hge-info);
    color: #1565c0;
}

.hge-notice-warning {
    background: #fff3e0;
    border-color: var(--hge-warning);
    color: #e65100;
}

.hge-notice-error {
    background: #ffebee;
    border-color: var(--hge-error);
    color: #c62828;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 768px) {
    .hge-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }

    .hge-cart-table-wrapper {
        overflow-x: auto;
    }

    .hge-cart-actions {
        flex-direction: column;
    }

    .hge-checkout-tabs {
        flex-direction: column;
    }

    .hge-tab-btn {
        width: 100%;
    }

    .hge-form-row {
        grid-template-columns: 1fr;
    }

    .hge-notification {
        left: 20px;
        right: 20px;
        transform: translateY(-200px);
    }

    .hge-notification-show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .hge-products-grid {
        grid-template-columns: 1fr;
    }

    .hge-button {
        padding: 8px 16px;
        font-size: 13px;
    }

    .hge-product-title {
        font-size: 14px;
    }

    .hge-product-price {
        font-size: 17px;
    }
}

/* ==========================================
   LOADING STATE
   ========================================== */

.hge-btn-loading {
    display: inline-block;
}

.hge-btn-loading:after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hge-spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes hge-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   MEMBERSHIP MODAL
   ========================================== */

.hge-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hge-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    animation: hge-fade-in 0.3s ease;
}

.hge-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: hge-slide-up 0.3s ease;
}

.hge-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--hge-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to right, #f8f9fa, white);
}

.hge-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--hge-text);
    display: flex;
    align-items: center;
}

.hge-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: var(--hge-text-light);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--hge-transition);
}

.hge-modal-close:hover {
    background: #f0f0f0;
    color: var(--hge-text);
}

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

.hge-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--hge-border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f8f9fa;
}

.hge-modal-footer .hge-button {
    min-width: 140px;
}

/* Modal Animations */
@keyframes hge-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes hge-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Error States */
.hge-form-control:invalid:not(:placeholder-shown) {
    border-color: var(--hge-error);
}

.hge-form-control:valid:not(:placeholder-shown) {
    border-color: var(--hge-success);
}

.hge-form-message {
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 14px;
}

.hge-form-message.error {
    background: #ffebee;
    color: #c62828;
    border-left: 3px solid var(--hge-error);
}

.hge-form-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 3px solid var(--hge-success);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hge-modal {
        padding: 0;
    }

    .hge-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .hge-modal-header {
        padding: 16px;
    }

    .hge-modal-body {
        padding: 16px;
    }

    .hge-modal-footer {
        padding: 12px 16px;
        flex-direction: column;
    }

    .hge-modal-footer .hge-button {
        width: 100%;
        min-width: 0;
    }

    .hge-form-row {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================
   TAGS FILTER SECTION
   ========================================== */

.hge-filter-locked-notice {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    font-size: 14px;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hge-filter-locked-notice svg {
    flex-shrink: 0;
}

.hge-filter-locked-notice strong {
    color: #664d03;
}

.hge-products-filters {
    margin-bottom: 32px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid var(--hge-border);
    border-radius: var(--hge-radius);
    box-shadow: var(--hge-shadow);
}

.hge-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--hge-border);
}

.hge-filter-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--hge-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.hge-filter-title svg {
    opacity: 0.6;
}

.hge-filter-clear {
    font-size: 14px;
    color: var(--hge-error);
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 4px;
    transition: var(--hge-transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.hge-filter-clear:hover {
    background: #ffebee;
    color: #c62828;
}

.hge-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hge-tag-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid var(--hge-border);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--hge-text);
    cursor: pointer;
    transition: var(--hge-transition);
    text-decoration: none;
    font-family: inherit;
}

.hge-tag-filter-btn:hover {
    background: #e8f5e9;
    border-color: var(--hge-primary);
    color: var(--hge-primary-dark);
    transform: translateY(-1px);
}

.hge-tag-filter-btn.active {
    background: var(--hge-primary);
    border-color: var(--hge-primary-dark);
    color: white;
    font-weight: 600;
}

.hge-tag-filter-btn.active:hover {
    background: var(--hge-primary-dark);
    transform: translateY(0);
}

.hge-tag-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.hge-tag-filter-btn.active .hge-tag-count {
    background: rgba(255,255,255,0.3);
}

/* Mobile Responsive - Filters */
@media (max-width: 768px) {
    .hge-products-filters {
        padding: 16px;
        margin-bottom: 24px;
    }

    .hge-filter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .hge-filter-tags {
        gap: 6px;
    }

    .hge-tag-filter-btn {
        font-size: 13px;
        padding: 6px 12px;
    }

    .hge-tag-count {
        font-size: 11px;
        min-width: 18px;
        height: 18px;
    }
}

/* ==========================================
   EMAIL VALIDATION & CLAIM FEEDBACK
   ========================================== */

.hge-email-feedback {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
    animation: slideDown 0.3s ease;
}

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

.hge-email-feedback a {
    font-weight: 500;
    transition: opacity 0.2s;
}

.hge-email-feedback a:hover {
    opacity: 0.8;
}

/* Email field states */
#reg-email.hge-email-valid {
    border-color: var(--hge-success) !important;
    background-color: rgba(76, 175, 80, 0.05);
}

#reg-email.hge-email-invalid {
    border-color: var(--hge-error) !important;
    background-color: rgba(244, 67, 54, 0.05);
}

#reg-email.hge-email-checking {
    border-color: var(--hge-info) !important;
    background-image: linear-gradient(90deg, transparent 0%, rgba(33, 150, 243, 0.1) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}
