/**
 * Ravielson Cart Drawer - Styles
 */

/* ============================================
   DRAWER BASE
   ============================================ */

.rcd-drawer {
    position: fixed;
    inset: 0;
    z-index: 999999 !important;
    visibility: hidden;
    pointer-events: none;
}

.rcd-drawer.is-open {
    visibility: visible;
    pointer-events: auto;
}

/* ============================================
   OVERLAY
   ============================================ */

#rcd-cart-drawer {
    z-index: 9999999999 !important;
}

.rcd-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 999998 !important;
}

.rcd-drawer.is-open .rcd-overlay {
    opacity: 1;
}

/* ============================================
   PANEL
   ============================================ */

.rcd-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 420px;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 999999 !important;
}

.rcd-drawer.is-open .rcd-panel {
    transform: translateX(0);
}

/* ============================================
   HEADER
   ============================================ */

.rcd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
    background: #fafafa;
}

.rcd-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e1e1e;
}

.rcd-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #666;
    transition: color 0.2s;
}

.rcd-close:hover {
    color: #1e1e1e;
}

/* ============================================
   CONTENT
   ============================================ */

.rcd-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.rcd-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================
   CART ITEM
   ============================================ */

.rcd-item {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.rcd-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.rcd-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
}

.rcd-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rcd-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rcd-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e1e1e;
    text-decoration: none;
    line-height: 1.3;
}

.rcd-item-name:hover {
    color: #666;
}

.rcd-item-price {
    font-size: 14px;
    color: #666;
}

.rcd-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

/* ============================================
   QUANTITY CONTROLS
   ============================================ */

.rcd-qty-control {
    display: flex;
    align-items: center;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}

.rcd-qty-btn {
    width: 32px;
    height: 32px;
    background: #fafafa;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #1e1e1e;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rcd-qty-btn:hover {
    background: #f0f0f0;
}

.rcd-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rcd-qty-value {
    width: 40px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #1e1e1e;
    border-left: 1px solid #e5e5e5;
    border-right: 1px solid #e5e5e5;
    padding: 6px 0;
}

/* ============================================
   REMOVE BUTTON
   ============================================ */

.rcd-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 12px;
    padding: 4px 8px;
    transition: color 0.2s;
}

.rcd-remove-btn:hover {
    color: #d32f2f;
}

/* ============================================
   EMPTY CART
   ============================================ */

.rcd-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.rcd-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.rcd-empty-text {
    font-size: 16px;
}

/* ============================================
   FOOTER
   ============================================ */

.rcd-footer {
    padding: 16px 20px;
    border-top: 1px solid #e5e5e5;
    background: #fafafa;
}

.rcd-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 16px;
}

.rcd-subtotal-label {
    color: #666;
}

.rcd-subtotal-value {
    font-weight: 600;
    color: #1e1e1e;
}

/* ============================================
   BUTTONS
   ============================================ */

.rcd-actions {
    display: flex;
    gap: 10px;
}

.rcd-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.rcd-btn-secondary {
    background: #fff;
    border: 1px solid #1e1e1e;
    color: #1e1e1e;
}

.rcd-btn-secondary:hover {
    background: #f5f5f5;
}

.rcd-btn-primary {
    background: #1e1e1e;
    color: #fff;
}

.rcd-btn-primary:hover {
    background: #333;
}

/* ============================================
   LOADING STATE
   ============================================ */

.rcd-loading {
    opacity: 0.6;
    pointer-events: none;
}

.rcd-item.is-updating {
    opacity: 0.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
    .rcd-panel {
        max-width: 100%;
    }
    
    .rcd-item-image {
        width: 64px;
        height: 64px;
    }
}
