/* ==============================================
   WooCommerce Custom Design - Frontend Styles
   Color principal: #33125E
   ============================================== */

/* Aviso de Producto Personalizable */
.wc-personalizable-notice {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: linear-gradient(135deg, #f8f5fc 0%, #ffffff 100%);
    border: 2px solid #33125E;
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
    box-shadow: 0 4px 12px rgba(51, 18, 94, 0.1);
}

.wc-personalizable-notice .notice-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.wc-personalizable-notice .notice-content {
    flex: 1;
}

.wc-personalizable-notice strong {
    display: block;
    color: #33125E;
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 700;
}

.wc-personalizable-notice p {
    margin: 0;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

/* Combo Selector Wrapper */
.wc-combo-selector-wrapper {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.wc-combo-selector-wrapper .combo-title {
    color: #33125E;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wc-combo-selector-wrapper .combo-description {
    color: #666;
    font-size: 15px;
    margin: 0 0 25px 0;
    line-height: 1.6;
}

/* Combo Items Grid */
.wc-combo-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* Combo Item Card */
.wc-combo-item-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.wc-combo-item-card:hover {
    border-color: #33125E;
    box-shadow: 0 4px 16px rgba(51, 18, 94, 0.15);
    transform: translateY(-2px);
}

.wc-combo-item-card.configured {
    border-color: #27ae60;
    background: linear-gradient(to bottom, #f0f9f4 0%, #ffffff 100%);
}

/* Card Header */
.combo-item-header {
    background: linear-gradient(135deg, #33125E 0%, #4a1a89 100%);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.combo-item-header .item-number {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 5px 12px;
    border-radius: 20px;
    min-width: 40px;
    text-align: center;
}

.combo-item-header .item-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

/* Card Body */
.combo-item-body {
    padding: 20px;
}

.combo-variation-field {
    margin-bottom: 15px;
}

.combo-variation-field:last-child {
    margin-bottom: 0;
}

.combo-variation-field label {
    display: block;
    color: #333;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.combo-variation-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
}

.combo-variation-select:hover {
    border-color: #bbb;
}

.combo-variation-select:focus {
    outline: none;
    border-color: #33125E;
    box-shadow: 0 0 0 3px rgba(51, 18, 94, 0.1);
}

.simple-product-notice {
    color: #666;
    font-style: italic;
    font-size: 14px;
    margin: 0;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 6px;
    text-align: center;
}

/* Card Footer */
.combo-item-footer {
    padding: 12px 20px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
}

.item-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.item-status.pending {
    color: #f39c12;
}

.item-status.complete {
    color: #27ae60;
}

.item-status .status-icon {
    font-size: 16px;
}

/* Combo Notice */
.wc-combo-notice {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    border: 2px solid #f39c12;
    border-radius: 10px;
    padding: 18px;
    margin-top: 25px;
}

.wc-combo-notice .notice-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.wc-combo-notice .notice-text {
    flex: 1;
}

.wc-combo-notice strong {
    display: block;
    color: #f39c12;
    font-size: 15px;
    margin-bottom: 5px;
}

.wc-combo-notice .notice-text {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* Design Upload Form (Post-Purchase) */
.wc-design-upload-wrapper {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
}

.wc-design-upload-wrapper h2 {
    color: #33125E;
    font-size: 28px;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.wc-design-upload-wrapper .order-info {
    background: #f8f5fc;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #33125E;
}

.wc-design-upload-wrapper .order-info strong {
    color: #33125E;
}

/* Design Upload Item */
.wc-design-upload-item {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    transition: all 0.3s;
}

.wc-design-upload-item:hover {
    border-color: #33125E;
    box-shadow: 0 4px 12px rgba(51, 18, 94, 0.1);
}

.wc-design-upload-item.uploaded {
    border-color: #27ae60;
    background: linear-gradient(to bottom, #f0f9f4 0%, #ffffff 100%);
}

.wc-design-upload-item h3 {
    color: #33125E;
    font-size: 18px;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 700;
}

.wc-design-field-group {
    margin-bottom: 20px;
}

.wc-design-field-group label {
    display: block;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.wc-design-field-group input[type="text"],
.wc-design-field-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    transition: all 0.2s;
}

.wc-design-field-group input[type="text"]:focus,
.wc-design-field-group textarea:focus {
    outline: none;
    border-color: #33125E;
    box-shadow: 0 0 0 3px rgba(51, 18, 94, 0.1);
}

.wc-design-field-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* File Upload */
.wc-file-upload-area {
    border: 2px dashed #d0d0d0;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    background: #f9f9f9;
    transition: all 0.3s;
    cursor: pointer;
}

.wc-file-upload-area:hover {
    border-color: #33125E;
    background: #f8f5fc;
}

.wc-file-upload-area.drag-over {
    border-color: #33125E;
    background: #f0ebf7;
}

.wc-file-upload-area input[type="file"] {
    display: none;
}

.wc-file-upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.wc-file-upload-text {
    color: #666;
    font-size: 15px;
    margin-bottom: 10px;
}

.wc-file-upload-text strong {
    color: #33125E;
    display: block;
    margin-bottom: 5px;
}

.wc-file-requirements {
    color: #999;
    font-size: 13px;
}

.wc-file-preview {
    margin-top: 15px;
    padding: 15px;
    background: #fff;
    border: 2px solid #27ae60;
    border-radius: 8px;
}

.wc-file-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 10px;
}

.wc-file-preview-name {
    color: #27ae60;
    font-weight: 600;
    font-size: 14px;
}

/* Submit Button */
.wc-design-submit-btn {
    background: linear-gradient(135deg, #33125E 0%, #4a1a89 100%);
    color: #fff;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(51, 18, 94, 0.3);
    width: 100%;
    margin-top: 30px;
}

.wc-design-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51, 18, 94, 0.4);
}

.wc-design-submit-btn:active {
    transform: translateY(0);
}

.wc-design-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Success/Error Messages */
.wc-design-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.wc-design-message.success {
    background: #d5f4e6;
    border: 2px solid #27ae60;
    color: #155724;
}

.wc-design-message.error {
    background: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
    .wc-combo-items {
        grid-template-columns: 1fr;
    }

    .wc-personalizable-notice,
    .wc-combo-notice {
        flex-direction: column;
        text-align: center;
    }

    .wc-design-upload-wrapper {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .wc-combo-selector-wrapper {
        padding: 15px;
    }

    .combo-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .wc-design-submit-btn {
        padding: 12px 30px;
        font-size: 15px;
    }
}

/* ==============================================
   Versión compacta para productos simples
   ============================================== */
.wc-combo-item-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #27ae60;
    border-radius: 6px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.wc-combo-item-compact:hover {
    border-color: #27ae60;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.1);
    transform: translateX(3px);
}

.wc-combo-item-compact .compact-number {
    background: #27ae60;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    min-width: 35px;
    text-align: center;
}

.wc-combo-item-compact .compact-title {
    flex: 1;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.wc-combo-item-compact .compact-status {
    font-size: 20px;
}

/* Preview de variación en card */
.combo-variation-preview {
    margin-bottom: 15px;
    text-align: center;
}

.variation-preview-image {
    max-width: 120px;
    max-height: 120px;
    border-radius: 8px;
    border: 2px solid #33125E;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.variation-preview-image:hover {
    transform: scale(1.05);
}

/* Botón de vista previa */
.combo-preview-btn {
    background: linear-gradient(135deg, #33125E 0%, #4a1a89 100%);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(51, 18, 94, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.combo-preview-btn:hover {
    background: linear-gradient(135deg, #4a1a89 0%, #33125E 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(51, 18, 94, 0.3);
}

.combo-preview-btn:active {
    transform: translateY(0);
}

/* Modal de vista previa */
#wc-product-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.wc-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
}

.wc-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.wc-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #dc3232;
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.wc-modal-close:hover {
    background: #a02020;
    transform: rotate(90deg);
}

.wc-modal-body {
    width: 100%;
    height: 100%;
    padding: 20px;
    overflow-y: auto;
}

/* Loader del modal */
.wc-modal-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    gap: 20px;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #33125E;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.wc-modal-loader p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* Contenido de vista rápida */
.wc-quick-view-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 100%;
}

.quick-view-images {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quick-view-main-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quick-view-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.quick-view-thumb {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-view-thumb:hover {
    border-color: #33125E;
    transform: scale(1.05);
}

.quick-view-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quick-view-title {
    color: #33125E;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.quick-view-variation-selected {
    background: linear-gradient(135deg, #f0f9f4 0%, #ffffff 100%);
    border: 2px solid #27ae60;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
}

.variation-badge {
    display: inline-block;
    background: #27ae60;
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.variation-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.attr-tag {
    background: #fff;
    border: 1px solid #27ae60;
    color: #27ae60;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.quick-view-price {
    font-size: 28px;
    font-weight: 700;
    color: #27ae60;
}

.quick-view-price del {
    color: #999;
    font-size: 20px;
    margin-right: 10px;
}

.quick-view-description {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 0;
}

.quick-view-description p {
    margin: 0 0 10px 0;
}

.quick-view-variations h4 {
    color: #33125E;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 15px 0;
}

.quick-view-attribute {
    margin-bottom: 15px;
}

.quick-view-attribute label {
    display: block;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.attribute-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attribute-option {
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
}

.attribute-option:hover {
    border-color: #33125E;
    background: #f8f5fc;
}

.quick-view-note {
    background: linear-gradient(135deg, #f8f5fc 0%, #ffffff 100%);
    border-left: 4px solid #33125E;
    padding: 12px 15px;
    border-radius: 6px;
    color: #555;
    font-size: 13px;
    margin: 10px 0 0 0;
    line-height: 1.5;
}

.quick-view-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    width: fit-content;
}

.quick-view-stock.in-stock {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.quick-view-stock.out-of-stock {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.quick-view-error {
    text-align: center;
    padding: 40px 20px;
    color: #dc3232;
    font-size: 16px;
}

/* Responsive para modal */
@media (max-width: 1024px) {
    .wc-quick-view-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .wc-modal-content {
        width: 95%;
        max-width: 95%;
        max-height: 95vh;
        border-radius: 8px;
    }

    .wc-modal-body {
        padding: 15px;
    }

    .wc-modal-close {
        width: 35px;
        height: 35px;
        font-size: 20px;
        top: 10px;
        right: 10px;
    }

    .quick-view-title {
        font-size: 20px;
    }

    .quick-view-price {
        font-size: 24px;
    }

    .quick-view-gallery {
        grid-template-columns: repeat(3, 1fr);
    }

    .attribute-options {
        gap: 6px;
    }

    .attribute-option {
        padding: 5px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .wc-modal-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .wc-modal-body {
        padding: 12px;
    }

    .quick-view-title {
        font-size: 18px;
    }

    .quick-view-price {
        font-size: 20px;
    }

    .quick-view-description {
        font-size: 13px;
    }

    .quick-view-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* ==============================================
   Mensaje de Completación de Diseños
   ============================================== */
.wc-completion-message {
    background: linear-gradient(135deg, #f0f9f4 0%, #ffffff 100%);
    border: 3px solid #27ae60;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    margin: 30px 0;
    box-shadow: 0 8px 24px rgba(39, 174, 96, 0.15);
    animation: completionFadeIn 0.6s ease;
}

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

.completion-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.wc-completion-message h3 {
    color: #27ae60;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.wc-completion-message > p {
    color: #555;
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 30px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.completion-details {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 30px 0;
    padding: 25px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f8f5fc 0%, #ffffff 100%);
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
}

.detail-item:hover {
    border-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.1);
}

.detail-icon {
    font-size: 20px;
}

.completion-note {
    background: #fff;
    border-left: 4px solid #27ae60;
    padding: 15px 20px;
    border-radius: 6px;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-top: 25px !important;
    max-width: 650px;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Responsive para mensaje de completación */
@media (max-width: 768px) {
    .wc-completion-message {
        padding: 30px 20px;
    }

    .completion-icon {
        font-size: 48px;
    }

    .wc-completion-message h3 {
        font-size: 24px;
    }

    .wc-completion-message > p {
        font-size: 15px;
    }

    .completion-details {
        flex-direction: column;
        gap: 12px;
        padding: 20px;
    }

    .detail-item {
        justify-content: center;
    }
}
