/* Base styles for the offcanvas */
.adesivos-offcanvas {
    position: fixed;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 400px;
    height: 100%;
    background: #fff;
    transform: translateX(100%);
    transition: 0.3s;
    z-index: 10000;
    overflow-y: auto;
    box-shadow: -3px 0 15px rgba(0,0,0,0.2);
}

.adesivos-offcanvas.show {
    transform: translateX(0);
}

.adesivos-offcanvas-header {
    padding: 1rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.adesivos-offcanvas-header h5 {
    margin: 0;
    font-size: 1.1rem;
}

.adesivos-offcanvas-header button {
    font-size: 24px;
    padding: 0 8px;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color:black;
}

.adesivos-offcanvas-content {
    padding: 1rem;
    padding-bottom: 120px; /* Extra padding for mobile keyboards */
}

/* Size Options */
.ac-size-row {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 8px;
    transition: border-color 0.2s;
}

.ac-size-row:hover {
    border-color: #ccc;
}

.ac-price {
    color: #006f9b;
    font-weight: bold;
    margin-top: 0.25rem;
    font-size: 0.9em;
}

.ac-select {
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 0.4rem 0.75rem;
    min-height: 44px;
    background-color: #f8f8f8;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.ac-custom-collapse {
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.ac-custom-header {
    padding: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    background-color: #f8f8f8;
    position: relative;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.ac-custom-header:after {
    content: "+";
    position: absolute;
    right: 15px;
    font-size: 20px;
    transition: transform 0.2s;
}

.ac-custom-header.active:after {
    content: "-";
}

.ac-custom-body {
    display: none;
    padding: 0.75rem;
    border-top: 1px solid #eee;
}

.ac-custom-inputs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.ac-custom-inputs input {
    flex: 1;
    min-width: 70px;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    height: 44px;
    font-size: 16px;
}

.ac-mult {
    margin: 0 5px;
    font-weight: bold;
}

.ac-custom-inputs select {
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 0.4rem 0.75rem;
    min-height: 44px;
    background-color: #f8f8f8;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.ac-custom-price {
    margin-top: 0.5rem;
    font-weight: bold;
    color: #006f9b;
}

.ac-save-btn {
    display: block;
    width: 100%;
    padding: 0.875rem;
    background: #006f9b;
    color: #fff;
    border: none;
    margin-top: 1rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 48px;
    text-transform: math-auto;
}

.ac-save-btn:hover {
    background: #006f9b;
}

/* Text customization styles */
.acm-text-field {
    margin-bottom: 15px;
}

.acm-text-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.acm-text-field textarea {
    width: 100%;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    overflow-y: hidden;
    overflow-x: auto;
    white-space: nowrap;
    line-height: 20px;
    font-size: 16px;
    font-weight: 100;
    font-size: 12px;
}

.acm-text-field textarea::placeholder {
    line-height: 20px;
}
/* Efeito hover para o botão de fechar */
.adesivos-offcanvas-header button:hover {
    background: none;
    color: black;    
    transform: rotate(90deg);
}
.acm-char-counter {
    font-size: 10px;
    color: #006f9b;
    text-align: right;
    margin-top: 5px;
}

.acm-char-counter.limit-reached {
    color: #cc0000;
    font-weight: bold;
}

.acm-additional-text-fields h4 {
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 16px;
}

/* Color Options Styles - Grid Layout */
.ac-color-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.ac-color-radio {
    display: none;
}

.ac-color-option {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    border: 1px solid transparent !important;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    align-items: stretch;
}

.ac-color-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 6px;
    border: 2px solid transparent;
    border-radius: 8px;
    justify-content: space-evenly;
    transition: transform 0.1s;
}

.ac-color-option.selected .ac-color-box {
    border-color: #007cba !important;
    box-shadow: 0 0 5px rgba(0,124,186,.5);
}

.ac-color-option:hover .ac-color-box {
    border-color: #666 !important;
    transform: translateY(-2px);
}

.ac-color-preview img,
.ac-color-preview .ac-color-circle {
    margin: 0 auto 6px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
}

.ac-color-preview .ac-color-circle {
    border: 1px solid #d6d6d8;
}

.ac-color-details {
    text-align: center;
}

.ac-color-name {
    display: block;
    font-size: .9em;
    word-break: break-word;
    margin-bottom: 4px;
}

/* Extras Options */
.o-Extras-Container {
    margin: 20px 0;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
}

.o-Extras-Container h4 {
    margin-top: 0;
    margin-bottom: 6px;
    padding-bottom: 8px;
    font-size: 16px;
    text-align: center;
    border-bottom: 0px;
}

.o-Extras-Options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.o-Extra-Option {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: all 0.3s;
    background-color: #fff;
    position: relative;
    min-height: 44px;
}

.o-Extra-Option:hover {
    border-color: #999;
}


.ac-extra-checkbox {
    margin-right: 12px;
    transform: scale(1.2);
    z-index: 2;
    min-width: 22px;
    min-height: 22px;
}

.o-Extra-Content {
    display: flex;
    align-items: center;
    flex: 1;
    cursor: pointer;
    padding-left: 5px;
}

.o-Extra-Image {
    margin-right: 12px;
}

.o-Extra-Image img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 0px;
}

.o-Extra-Details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.o-Extra-Name {
    font-weight: 500;
    margin-bottom: 3px;
}

.o-Extra-Desc {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 4px;
}

.o-Extra-Price {
    color: #006f9b;
    font-weight: bold;
    font-size: 0.9em;
}

.o-Extra-Option input:checked ~ label .o-Extra-Name {
    color: #006f9b;
}

/* Main navigation buttons */
.o-BlockAccordions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 20px;
}

.o-BlockAccordions-ref {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 1.25rem 1rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    min-height: 44px;
}

.o-BlockAccordions-ref:hover {
    background: #f7f7f7;
    color: #333;
    border-color: #ccc;
}

.o-BlockAccordions-ref:hover .acm-label,
.o-BlockAccordions-ref:hover .dashicons {
    color: #333;
}

.o-BlockAccordions-ref .dashicons {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

.acm-label {
    flex: 1;
    text-align: left;
    text-transform: math-auto;
}

.acm-arrow {
    font-size: 1.25rem;
    margin-left: 0.75rem;
    color: #888;
    transition: transform 0.2s;
}

.o-BlockAccordions-ref.option-selected {
    border-color: #006f9b;
}

.o-BlockAccordions-ref.option-selected:after {
    content: "✓";
    position: absolute;
    right: 15px;
    font-size: 16px;
    color: green;
}

/* Admin Style */
.acm-color-item {
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 10px;
    background: #f9f9f9;
}

.color-image-preview {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.image-preview-container {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    overflow: hidden;
    border-radius: 50%;
}

.color-image-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.acm-select-image, 
.acm-remove-image {
    font-size: 12px !important;
    padding: 2px 8px !important;
    height: auto !important;
}

.acm-remove-image {
    color: #a00 !important;
}

/* Text preview styles */
.acm-text-replacement {
    display: none;
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    z-index: 999;
    box-sizing: border-box;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.acm-text-content {
    text-align: center;
    font-size: 48px;
    line-height: 1.2;
    word-break: break-word;
    max-width: 100%;
    max-height: 100%;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: font-size 0.2s ease;
}

/* Total price display */
.acm-total-price {
    margin: 15px 0 10px 0;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    display: none;
    justify-self: left;
    color: #333333;
    background-color: #f9f9f9;
}

.acm-total-price .price-value {
    color: #006f9b;
}

.acm-initial-message {
    margin: 15px 0 15px 0;
    padding: 15px;
    font-size: 16px;
    color: #777;
    justify-self: left;
    text-align: center;
    background: none;
    border-radius: 8px;

}

.civa {
    font-size: 10px;
    opacity: 0.7;
}

/* Media Queries for Responsive Design */
@media (max-width: 767px) {
    .adesivos-offcanvas {
        width: 100%;
        max-width: none;
    }
    
    .adesivos-offcanvas-content {
        padding: 12px;
    }
    
    .ac-color-options {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .o-BlockAccordions-ref {
        padding: 15px 10px;
    }
    
    .ac-save-btn {
        position: sticky;
        bottom: 0;
        margin: 0;
        border-radius: 0;
        z-index: 2;
    }
    
    .adesivos-offcanvas-content {
        padding-bottom: 60px;
    }
}

@media (max-width: 480px) {
    .ac-size-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ac-size-row > div:last-child {
        width: 100%;
        margin-top: 8px;
    }
    
    .ac-select {
        width: 100%;
    }
    
    .ac-color-options {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 8px;
    }
    
    .ac-color-option {
        padding: 6px;
    }
    
    .ac-color-name {
        font-size: 0.8em;
    }
    
    .o-Extra-Option {
        padding: 10px;
    }
    
    .o-Extra-Image img {
        width: 40px;
        height: 40px;
    }
    
    .ac-custom-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ac-custom-inputs input, 
    .ac-custom-inputs select {
        width: 100%;
    }
    
    .ac-mult {
        align-self: center;
        margin: 5px 0;
    }
    
    .acm-text-content {
        font-size: 36px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) {
    .o-BlockAccordions-ref,
    .ac-select,
    .ac-save-btn,
    .o-Extra-Option,
    .ac-color-option {
        -webkit-tap-highlight-color: rgba(0,0,0,0);
    }
    
    .o-BlockAccordions-ref:active {
        background-color: #f0f0f0;
    }
    
    .ac-save-btn:active {
        background-color: #222;
    }
}