/**
 * Golfyr Slide-Out Cart Drawer Styles
 */

:root {
    --cart-drawer-width: 440px;
    --cart-transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease;
}

/* Backdrop Overlay */
.cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(19, 34, 30, 0.5); /* semi-transparent brand dark */
    backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: var(--cart-transition);
}

.cart-drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Slide-out Drawer Panel */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: var(--cart-drawer-width);
    height: 100%;
    background-color: #ffffff;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    transform: translate3d(100%, 0, 0);
    transition: var(--cart-transition);
}

.cart-drawer.open {
    transform: translate3d(0, 0, 0);
}

/* Header */
.cart-drawer-header {
    padding: 24px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-drawer-header h2 {
    font-family: var(--font-primary), sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.cart-drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-primary);
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-drawer-close:hover {
    transform: rotate(90deg);
}

/* Scrollable Cart Items Container */
.cart-drawer-items {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Empty State */
.cart-empty-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-family: var(--font-primary), sans-serif;
    text-align: center;
}

.cart-empty-message p {
    font-size: 16px;
    margin: 0;
}

/* Cart Item Layout */
.cart-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
}

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

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0px;
    background-color: #EAF5F1;
    border: 1px solid #e2e8f0;
}

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

.cart-item-details h3 {
    font-family: var(--font-primary), sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.cart-item-price {
    font-family: var(--font-primary), sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-green);
}

.cart-item-options {
    margin-top: 4px;
    margin-bottom: 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.cart-item-option {
    font-size: 11px;
    font-family: var(--font-primary), sans-serif;
    color: #64748b;
    line-height: 1.3;
    display: flex;
    gap: 4px;
}

.cart-item-option .option-label {
    font-weight: 600;
    color: #475569;
}

.cart-item-option .option-value {
    font-weight: 400;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

/* Quantity Adjuster */
.cart-item-qty-selector {
    display: flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 0px;
    overflow: hidden;
    height: 32px;
}

.qty-btn {
    width: 32px;
    height: 100%;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    font-family: var(--font-primary), sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: background-color 0.2s ease;
}

.qty-btn:hover {
    background-color: #e2e8f0;
}

.qty-display {
    width: 36px;
    text-align: center;
    font-family: var(--font-primary), sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cart-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    font-family: var(--font-primary), sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.cart-item-remove:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Footer & Checkout Area */
.cart-drawer-footer {
    padding: 30px;
    border-top: 1px solid #e2e8f0;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-drawer-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-primary), sans-serif;
}

.cart-drawer-total span:first-child {
    font-size: 16px;
    color: var(--text-muted);
}

.cart-drawer-total span:last-child {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.cart-drawer-checkout-btn {
    width: 100%;
    height: 54px;
    background-color: #13221e; /* brand dark */
    color: #ffffff;
    border: none;
    border-radius: 0px;
    font-family: var(--font-primary), sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.2s ease;
}

.cart-drawer-checkout-btn:hover:not(:disabled) {
    background-color: #1c332d;
    transform: translateY(-1px);
}

.cart-drawer-checkout-btn:active:not(:disabled) {
    transform: translateY(0);
}

.cart-drawer-checkout-btn:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Spinner for checkout redirect */
.checkout-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: cart-spin 0.8s infinite linear;
    display: none;
}

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

/* Responsive adjustments */
@media (max-width: 480px) {
    .cart-drawer {
        max-width: 100%;
    }
}

/* ------------------------------------------
   Product Gallery Enhancements
   ------------------------------------------ */

/* Floating back button in top left of gallery */
.product-back-btn {
    position: absolute;
    top: 24px;
    left: 24px;
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #13221e; /* brand dark */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10;
}

.product-back-btn:hover {
    background-color: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.product-back-btn svg {
    transition: transform 0.2s ease;
}

.product-back-btn:hover svg {
    transform: translateX(-1px);
}

/* Disable click to enlarge on product gallery images */
#tote-main-image-link {
    pointer-events: none !important;
    cursor: default !important;
}
