/* ==============================================
   WC Product Accordion — Frontend Styles
   ============================================== */

.wcpa-wrap {
    margin: 2rem 0;
    font-family: inherit;
}

.wcpa-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e5e5;
}

/* ------ Accordion Item ------ */
.wcpa-item {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow .15s;
}

.wcpa-item:focus-within {
    box-shadow: 0 0 0 2px #2271b1;
}

/* ------ Header ------ */
.wcpa-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: background .1s;
}

.wcpa-header:hover {
    background: #f9f9f9;
}

.wcpa-thumb {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.wcpa-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wcpa-header-info {
    flex: 1;
    min-width: 0;
}

.wcpa-prod-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wcpa-prod-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #757575;
    margin-top: 2px;
}

.wcpa-chevron {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    position: relative;
    color: #757575;
    transition: transform .3s ease; 
}

.wcpa-chevron::before,
.wcpa-chevron::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 7px;
    height: 1.5px;
    background: currentColor;
    border-radius: 2px;
}

.wcpa-chevron::before { left: 2px;  transform: translateY(-50%) rotate(45deg);  }
.wcpa-chevron::after  { right: 2px; transform: translateY(-50%) rotate(-45deg); }

.wcpa-header[aria-expanded="true"] .wcpa-chevron { 
    transform: rotate(180deg); 
}

/* ------ Badge ------ */
.wcpa-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.wcpa-badge-var { background: #e8f0fe; color: #1a56db; }
.wcpa-badge-sim { background: #dcfce7; color: #15803d; }

/* ------ Body ------ */
.wcpa-body {
    border-top: 1px solid #e5e5e5;
	    margin: 5px !important;
}

.wcpa-price-bar {
    padding: 10px 16px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.wcpa-price-bar del {
    font-size: 13px;
    font-weight: 400;
    color: #9e9e9e;
    margin-left: 6px;
}

/* ------ Discount Badge ------ */
.wcpa-discount-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: #e53e3e;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
    letter-spacing: .3px;
}

/* ------ Variable Table ------ */
.wcpa-table-wrap {
    overflow-x: auto;
    margin-top: 10px;
}

.wcpa-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.wcpa-table th {
    font-size: 11px;
    font-weight: 600;
    color: #757575;
    text-align: left;
    padding: 7px 16px;
    background: #f9f9f9;
    border-bottom: 1px solid #e5e5e5;
    white-space: nowrap;
}

.wcpa-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    color: #1a1a1a;
}

.wcpa-table tr:last-child td { border-bottom: none; }

.wcpa-row-out td { opacity: .5; }

.wcpa-td-details {
    min-width: 100px;
}

.wcpa-detail-price {
    font-weight: 600;
    font-size: 13px;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.wcpa-detail-price del {
    font-size: 11px;
    font-weight: 400;
    color: #9e9e9e;
    margin-left: 4px;
}

.wcpa-detail-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}

.wcpa-td-variation { font-weight: 500; }
.wcpa-td-variation .wcpa-sku { margin-top: 4px; display: inline-block; }

/* ------ SKU ------ */
.wcpa-sku {
    font-size: 12px;
    color: #616161;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ------ Stock Pill ------ */
.wcpa-stock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.wcpa-stock-in  { background: #dcfce7; color: #15803d; }
.wcpa-stock-out { background: #fee2e2; color: #b91c1c; }

/* ------ Qty Control ------ */
.wcpa-qty-ctrl {
     display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    width: 100% !important;
    justify-content: space-between;

}

.wcpa-qty-ctrl[aria-disabled="true"] {
    opacity: .4;
    pointer-events: none;
}

.wcpa-qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .1s;
}

.wcpa-qty-btn:hover:not(:disabled) { background: #f5f5f5; }
.wcpa-qty-btn:disabled { opacity: .3; cursor: not-allowed; }

.wcpa-qty-val {
    min-width: 30px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    pointer-events: none;
}

/* ------ Add Button ------ */
.wcpa-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 12px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    transition: background .1s, border-color .1s, color .1s;
}

.wcpa-add-btn:hover:not(:disabled) {
    background: #f0f0f0;
    border-color: #bbb;
}

.wcpa-add-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.wcpa-add-btn--lg {
    height: 34px;
    padding: 0 16px;
    font-size: 13px;
}

.wcpa-add-btn.wcpa--loading {
    opacity: .7;
    cursor: wait;
}

.wcpa-add-btn.wcpa--added {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}

.wcpa-add-btn.wcpa--error {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

/* ------ Simple Product Row ------ */
.wcpa-simple-row {
    padding: 12px 16px 16px;
}

.wcpa-simple-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 14px;
}

.wcpa-simple-cart {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

/* ------ Responsive Base Rules ------ */
.wcpa-mobile-only { display: none !important; }
.wcpa-desktop-only { display: block !important; }
table.wcpa-table { display: table !important; }

@media (max-width: 600px) {
    .wcpa-desktop-only { display: none !important; }
    .wcpa-mobile-only  { display: flex !important; }
}

/* ------ Mobile variation cards ------ */
.wcpa-mobile-cards {
    padding: 8px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wcpa-var-card {
    border: 0.5px solid var(--color-border-tertiary, #e5e5e5);
    border-radius: 8px;
    padding: 12px;
}

.wcpa-var-card--out { opacity: .5; }

.wcpa-var-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.wcpa-var-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.wcpa-var-card-sku {
     font-size: 11px;
    color: #757575;
    margin-top: 2px;
}

.wcpa-var-card-price {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}

.wcpa-var-card-price del {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #9e9e9e;
    text-decoration: line-through;
}

.wcpa-var-card-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wcpa-add-btn--full {
    flex: 1;
    min-width: 110px;
    height: 32px;
    justify-content: center;
}

/* ------ Notification ------ */
.wcpa-notif-area {
    padding: 0 16px 12px;
}

.wcpa-notif-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #367746;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
}

.wcpa-notif-bar--error {
    background: #b91c1c;
}

.wcpa-notif-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.wcpa-notif-msg {
    flex: 1;
    line-height: 1.4;
}

.wcpa-notif-cart-link {
    color: #86efac;
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}

.wcpa-notif-cart-link:hover {
    text-decoration: underline;
	color: #fff;
}

.wcpa-notif-close {
    background: none;
    border: none;
    color: #fff !important;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 6px 6px 6px !important;
    line-height: 1;
    flex-shrink: 0;
}

.wcpa-notif-close:hover {
    color: #fff;
}