/* Beetle Promo Styles */

.beetle-promo-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 15px;
}

/* Promo Section Title */
.beetle-promo-section-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 3px solid #0073aa;
    padding-bottom: 5px;
    text-align: left;
}

/* Promo Controls */
.beetle-promo-controls {
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.beetle-empty-message {
    text-align: center;
    padding: 40px;
    color: #667;
    font-size: 16px;
}

/* Promo Card (Editor) */
.beetle-promo-card {
    background: #f9f9f9;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

.beetle-promo-header {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.beetle-promo-title {
    flex: 1;
    padding: 12px;
    font-size: 18px;
    font-weight: 600;
    border: 2px solid #0073aa;
    border-radius: 6px;
}

.beetle-promo-title:focus {
    outline: none;
    border-color: #005a87;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

/* Promo Items */
.beetle-promo-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.beetle-promo-item {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    position: relative;
}

.beetle-remove-item {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3232;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.beetle-remove-item:hover {
    background: #a00;
    transform: scale(1.1);
}

.beetle-item-selection {
    margin-bottom: 15px;
}

.beetle-item-type {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 2px solid #0073aa;
    border-radius: 6px;
    background: white;
}

.beetle-item-type:focus {
    outline: none;
    border-color: #005a87;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

/* Linked Fields */
.beetle-linked-fields {
    margin-bottom: 15px;
}

.beetle-beetle-selection {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
}

.beetle-beetle-selection:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

/* Extra Fields */
.beetle-extra-fields {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.beetle-custom-name {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
}

.beetle-custom-name:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

.beetle-base-price {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-weight: 600;
}

.beetle-base-price:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

.beetle-custom-image-upload {
    width: 100%;
    height: 210px;
    background-color: #f0f0f0;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px dashed #ddd;
}

.beetle-upload-custom-btn,
.beetle-remove-custom-image {
    padding: 12px 24px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.beetle-upload-custom-btn:hover,
.beetle-remove-custom-image:hover {
    background: #005a87;
}

.beetle-remove-custom-image {
    background: #dc3232;
}

.beetle-remove-custom-image:hover {
    background: #a00;
}

/* Item Quantity */
.beetle-item-quantity-wrapper {
    margin-top: 15px;
}

.beetle-item-quantity {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
}

.beetle-item-quantity:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

/* Discount Settings */
.beetle-promo-discount {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.beetle-promo-discount h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.beetle-discount-description {
    margin: 0 0 15px 0;
    font-size: 13px;
    color: #666;
    font-style: italic;
    line-height: 1.4;
}

.beetle-discount-row {
    display: block;
}

.beetle-discount-value {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-weight: 600;
    box-sizing: border-box;
}

.beetle-discount-value:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

/* Time Limit Settings */
.beetle-promo-time-limit {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.beetle-promo-time-limit h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.beetle-time-limit-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.beetle-time-limit-toggle {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

.beetle-time-limit-fields {
    margin-top: 15px;
}

.beetle-time-limit-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.beetle-time-limit-row:last-child {
    margin-bottom: 0;
}

.beetle-time-limit-row label {
    flex: 0 0 180px;
    font-weight: 600;
    color: #555;
}

.beetle-expiry-date,
.beetle-expiry-action,
.beetle-reduction-amount,
.beetle-reduction-period {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
}

.beetle-expiry-date:focus,
.beetle-expiry-action:focus,
.beetle-reduction-amount:focus,
.beetle-reduction-period:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

.beetle-reduction-fields {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

/* Button Styles */
.beetle-btn-secondary {
    background-color: #666;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.beetle-btn-secondary:hover {
    background-color: #444;
}

/* Validation Error State */
.beetle-field-error {
    border-color: #dc3232 !important;
    border-width: 2px !important;
    box-shadow: 0 0 0 3px rgba(220, 50, 50, 0.1) !important;
}

.beetle-field-error:focus {
    border-color: #dc3232 !important;
    box-shadow: 0 0 0 3px rgba(220, 50, 50, 0.2) !important;
}

/* Display Mode (for visitors) */
.beetle-promo-display {
    margin-bottom: 20px;
}

.beetle-promo-title-header {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 0 0 6px 0;
    line-height: 1.2;
}

.beetle-promos-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
}

.beetle-promo-card-display {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    height: 210px;
    width: 210px;
    cursor: pointer;
    flex: 0 0 210px;
}

.beetle-promo-card-display:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.beetle-promo-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.75);
    padding: 6px 10px;
    margin: 0;
}

.beetle-promo-item-line {
    font-size: 13px;
    color: white;
    margin: 0 0 2px 0;
    line-height: 1.2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.beetle-promo-original-price {
    font-size: 12px;
    font-weight: 500;
    color: #ccc;
    text-decoration: line-through;
    margin-left: 6px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
    display: inline;
}

.beetle-promo-price {
    font-size: 18px;
    font-weight: 700;
    color: #46b450;
    margin: 0;
    line-height: 1.2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.beetle-promo-discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #46b450;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.beetle-promo-timer {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(220, 50, 50, 0.95);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.beetle-quantity-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.beetle-quantity-row.beetle-gender-quantity input {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
}

.beetle-quantity-row.beetle-gender-quantity input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

.beetle-linked-quantity-fields {
    margin-top: 10px;
}

/* Responsive - Tablets */
@media (max-width: 1024px) {
    .beetle-promo-card-display {
        width: 180px;
        height: 180px;
        flex: 0 0 180px;
    }
    
    .beetle-promo-title-header {
        font-size: 15px;
    }
    
    .beetle-promo-item-line {
        font-size: 12px;
    }
    
    .beetle-promo-original-price {
        font-size: 11px;
    }
    
    .beetle-promo-price {
        font-size: 16px;
    }
    
    .beetle-promo-discount-badge {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .beetle-promo-timer {
        font-size: 9px;
        padding: 5px 8px;
    }
    
    .beetle-discount-row {
        display: block;
    }
    
    .beetle-discount-value {
        width: 100%;
    }
    
    .beetle-time-limit-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .beetle-time-limit-row label {
        flex: 1 1 auto;
        margin-bottom: 5px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .beetle-promo-container {
        padding: 15px;
    }
    
    .beetle-promo-controls {
        flex-direction: column;
    }
    
    .beetle-btn {
        width: 100%;
    }
    
    .beetle-promos-wrapper {
        justify-content: center;
    }
    
    .beetle-promo-card-display {
        width: calc(50vw - 20px);
        max-width: 180px;
        height: calc(50vw - 20px);
        max-height: 180px;
        flex: 0 0 auto;
    }
    
    .beetle-custom-image-upload {
        height: 180px;
    }
    
    .beetle-promo-timer {
        font-size: 8px;
        padding: 4px 7px;
    }
    
    .beetle-promo-title-header {
        font-size: 13px;
        margin-bottom: 4px;
    }
    
    .beetle-promo-item-line {
        font-size: 11px;
        margin-bottom: 2px;
        line-height: 1.2;
    }
    
    .beetle-promo-original-price {
        font-size: 10px;
        margin-left: 4px;
    }
    
    .beetle-promo-price {
        font-size: 15px;
    }
    
    .beetle-promo-discount-badge {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .beetle-promo-content {
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    .beetle-promo-card-display {
        width: calc(50vw - 18px);
        max-width: 150px;
        height: calc(50vw - 18px);
        max-height: 150px;
    }
    
    .beetle-custom-image-upload {
        height: 150px;
    }
    
    .beetle-promo-timer {
        font-size: 7px;
        padding: 3px 6px;
    }
    
    .beetle-promo-title-header {
        font-size: 12px;
        margin-bottom: 3px;
    }
    
    .beetle-promo-item-line {
        font-size: 10px;
        margin-bottom: 2px;
    }
    
    .beetle-promo-original-price {
        font-size: 9px;
        margin-left: 3px;
    }
    
    .beetle-promo-price {
        font-size: 13px;
    }
    
    .beetle-promo-discount-badge {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    .beetle-promo-content {
        padding: 6px;
    }
}