/* CurrentRMS Shopping Cart Styles */

.crms-shopping-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.crms-shopping-header {
    text-align: center;
    margin-bottom: 40px;
}

.crms-shopping-header h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #333;
}

.crms-shopping-header p {
    font-size: 16px;
    color: #666;
}

.crms-shopping-content {
    display: flex;
    gap: 30px;
}

.crms-shopping-left {
    flex: 2;
}

.crms-shopping-right {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 6px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.crms-shop-section {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.crms-shop-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Search + sort controls */
.crms-shop-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    align-items: end;
}

.crms-shop-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
    flex: 1 1 260px;
}

.crms-shop-control__label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

.crms-shop-search,
.crms-shop-sort {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-size: 14px;
    padding: 10px 12px;
    box-sizing: border-box;
}

.crms-shop-search:focus,
.crms-shop-sort:focus {
    outline: 2px solid rgba(0, 115, 170, 0.2);
    border-color: #0073aa;
}

/* Filter tabs */
.crms-shop-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.crms-shop-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: #666;
}

.crms-shop-tab:hover,
.crms-shop-tab--active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.crms-shop-tab__count {
    font-size: 11px;
    opacity: .8;
}

/* Products Grid */
.crms-shop-products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

@media (min-width: 640px) {
    .crms-shop-cols-2 .crms-shop-products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crms-shop-cols-3 .crms-shop-products-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .crms-shop-cols-4 .crms-shop-products-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .crms-shop-cols-5 .crms-shop-products-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.crms-shop-product-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.crms-shop-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.crms-shop-product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #fff;
    border-bottom: 1px solid #e9e9e9;
}

.crms-shop-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.crms-shop-product-card:hover .crms-shop-product-image img {
    transform: scale(1.04);
}

.crms-shop-product-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crms-shop-product-group {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: #e8f0fe;
    color: #1a73e8;
    padding: 3px 8px;
    border-radius: 4px;
    width: fit-content;
}

.crms-shop-product-info h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.crms-shop-product-description {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    flex: 1;
}

.crms-shop-product-actions {
    display: flex;
    gap: 10px;
}

.crms-shop-quantity {
    width: 70px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.crms-shop-add-btn {
    flex: 1;
    margin: 0 !important;
    cursor: pointer;
}

.crms-shop-product-card--hidden {
    display: none;
}

.crms-shop-empty {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.crms-shop-empty--hidden {
    display: none;
}

/* Dates */
.crms-shop-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.crms-shop-date-field {
    display: flex;
    flex-direction: column;
}

.crms-shop-date-field label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.crms-shop-date-input,
.crms-shop-input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.crms-shop-date-input:focus,
.crms-shop-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Delivery Options */
.crms-shop-delivery-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.crms-shop-delivery-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #000;
    cursor: pointer;
    transition: background 0.2s;
}

.crms-shop-delivery-option span {
    color: #000;
}

.crms-shop-delivery-option:hover {
    background: #f5f5f5;
}

.crms-shop-delivery-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

#crms-shop-delivery-address {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#crms-shop-delivery-address .crms-shop-input {
    margin: 0;
}

/* Cart Summary */
.crms-shop-cart-summary {
    border: 2px solid #0073aa;
}

.crms-shop-cart-items-list {
    min-height: 100px;
    margin-bottom: 15px;
}

.crms-shop-empty-cart {
    text-align: center;
    color: #999;
    margin: 20px 0;
}

.crms-shop-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

.crms-shop-cart-item:last-child {
    border-bottom: none;
}

.crms-shop-cart-item-info {
    flex: 1;
}

.crms-shop-cart-item-name {
    font-weight: 600;
    color: #333;
}

.crms-shop-cart-item-qty {
    color: #666;
    font-size: 13px;
}

.crms-shop-cart-item-estimate {
    color: #444;
    font-size: 12px;
    margin-top: 4px;
}

.crms-shop-cart-item-remove {
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #d9534f;
    transition: background 0.2s;
}

.crms-shop-cart-item-remove:hover {
    background: #fafafa;
}

.crms-shop-estimated-total {
    margin: 12px 0 16px;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fff8ef;
}

.crms-shop-estimated-total__label {
    display: block;
    font-size: 12px;
    color: #616161;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}

.crms-shop-estimated-total__value {
    display: block;
    font-size: 20px;
    line-height: 1.2;
    color: #111111;
    margin-bottom: 4px;
}

.crms-shop-estimated-total__note {
    display: block;
    font-size: 12px;
    color: #666;
}

/* Form Actions */
.crms-shop-actions {
    text-align: center;
}

.crms-shop-turnstile-wrap {
    margin-bottom: 15px;
    text-align: left;
}

.crms-shop-turnstile-label {
    margin: 0 0 10px;
    color: #333;
    font-weight: 600;
}

#crms-shop-submit-btn {
    width: 100%;
    padding: 15px !important;
    font-size: 16px !important;
    cursor: pointer;
}

#crms-shop-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.crms-shop-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    display: none;
}

.crms-shop-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.crms-shop-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.crms-shop-message.loading {
    display: block;
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Errors and warnings */
.crms-shop-error,
.crms-shop-warning {
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}

.crms-shop-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.crms-shop-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Responsive */
@media (max-width: 768px) {
    .crms-shopping-content {
        flex-direction: column;
    }

    .crms-shopping-right {
        position: static;
    }

    .crms-shop-products-grid {
        grid-template-columns: 1fr;
    }

    .crms-shop-dates {
        grid-template-columns: 1fr;
    }

    .crms-shop-delivery-options {
        flex-direction: row;
    }

    .crms-shop-delivery-option {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .crms-shopping-container {
        padding: 10px;
        margin: 10px;
    }

    .crms-shopping-header h2 {
        font-size: 22px;
    }

    .crms-shop-section {
        padding: 15px;
        margin-bottom: 15px;
    }

    .crms-shopping-left {
        gap: 15px;
    }
}
